JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for SPM Archives


SPM Archives

SPM Archives


SPM@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

SPM Home

SPM Home

SPM  May 2009

SPM May 2009

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: help with normalizing dartel to MNI space

From:

John Ashburner <[log in to unmask]>

Reply-To:

John Ashburner <[log in to unmask]>

Date:

Tue, 26 May 2009 19:19:19 +0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (174 lines)

Hi Darren,
That is totally true - but I really wanted to keep the user interface as 
simple as possible.  I generally suggest that DARTEL is used for 
simultaneously registering GM and WM, and that GM should be selected first.  
I'll make sure that I include this requirement in the documentation though.

Usually, the objective is to spatially normalise GM.  This is where the 
activity is for fMRI and the usual data used for VBM studies.

Best regards,
-John

On Tuesday 26 May 2009 18:13, Gmail wrote:
> One other thing, spm_klaff appears to assume that any template
> conforms to the order of volumes in TPM.nii, which may not be correct,
> i.e., a white matter template
>
> -----
> Darren Gitelman, MD
> sent from my iPhone
>
> On May 26, 2009, at 11:28 AM, Darren Gitelman <[log in to unmask]>
>
> wrote:
> > John
> >
> > That solved the first problem, but I am still getting errors in the
> > normalization routine- as shown below.  This led to the discovery of
> > what I think are a number of other problems caused by having 3D
> > instead of 4D data. See below.
> >
> > Warning: Matrix is singular to working precision.
> >
> >> In spm_klaff at 200
> >
> >  In spm_dartel_norm_fun at 94
> >  In matlabbatch/private/cfg_run_cm at 29
> >  In cfg_util>local_runcj at 1363
> >  In cfg_util at 699
> >  In cfg_ui>MenuFileRun_Callback at 1139
> >  In gui_mainfcn at 96
> >  In cfg_ui at 53
> > Warning: Matrix is singular, close to singular or badly scaled.
> >         Results may be inaccurate. RCOND = NaN.
> >
> >> In expm>PadeApproximantOfDegree at 123
> >
> >  In expm at 39
> >  In spm_klaff at 203
> >  In spm_dartel_norm_fun at 94
> >  In matlabbatch/private/cfg_run_cm at 29
> >  In cfg_util>local_runcj at 1363
> >  In cfg_util at 699
> >  In cfg_ui>MenuFileRun_Callback at 1139
> >  In gui_mainfcn at 96
> >  In cfg_ui at 53
> >  1              NaN                0
> >
> > ----------
> > In spm_klaff.m
> >
> > The first problem caused by having 3D data is that loaddat doesn't
> > load Ng (or Nf) because loops such as starting at line 221
> > for k = 1:d(4)-1
> >
> > don't execute because d(4) -1 is 0. Also, the summing of the first
> > nd-1 volumes to create the last volume won't be right either, etc.
> >
> > Other questions about the code:
> >
> > Around line 45 it says [x,y ,zz] = ndgrid(1:dg(1),1:dg(2),0);
> > This will make zz all 0's, so I don't understand why at line 49 it is
> > added to z and if it really should be all 0's?
> >
> > A second problem occurs at lines 102-104.
> > x1 = M(1,1)*x + M(1,2)*y + M(1,3)*z + M(1,4);
> > y1 = M(2,1)*x + M(2,2)*y + M(2,3)*z + M(2,4);
> > z1 = M(3,1)*x + M(3,2)*y + M(3,3)*z + M(3,4);
> >
> > It turns out that for certain matrices, M, the values of x1, y1 or z1
> > can be very close to but not quite > 1. This causes the subsequent
> > lines (107-109)
> > msk = x1>=1 & x1<=df(1) &...
> >          y1>=1 & y1<=df(2) &...
> >           z1>=1 & z1<=df(3);
> >
> > to generate an empty msk.
> >
> > for example my Nf and Ng matrices resulted in an M matrix of
> > M =
> >    1.5000    0.0000    0.0000   -0.5000
> >    0.0000    1.5000    0.0000   -0.5000
> >   -0.0000   -0.0000    1.5000   -0.5000
> >         0         0         0    1.0000
> >
> > This looks ok but the values of the 3rd row are actually
> > -0.0000000000000001
> > -0.0000000000000001
> > 1.5000000000000000
> > -0.5000000000000142
> >
> > which leads to a z1(1), for example, of: 0.9999999999999856. Since it
> > is < 1, msk ends up as all 0's.
> > so perhaps 102-104 should be rounded?
> >
> > x1 = round(M(1,1)*x + M(1,2)*y + M(1,3)*z + M(1,4));
> > y1 = round(M(2,1)*x + M(2,2)*y + M(2,3)*z + M(2,4));
> > z1 = round(M(3,1)*x + M(3,2)*y + M(3,3)*z + M(3,4));
> >
> > Messing around with all of this doesn't lead to optimum convergence of
> > dM and the resulting warped volumes end up being shifted and tiny...
> >
> > -----
> > Darren Gitelman
> >
> >
> >
> > On Tue, May 26, 2009 at 6:54 AM, John Ashburner <[log in to unmask]
> >
> > > wrote:
> >>
> >> Hi Darren,
> >> At around line 29, try changing the code to
> >>
> >> df = [size(Nf.dat),1,1];   % Dimensions of data
> >> dg = [size(Ng.dat),1,1];   % Dimensions of data
> >>
> >> The reason for the crash is that when the algorithm asks the size
> >> of a
> >> variable, MATLAB gives a vector of length equal to the number of
> >> dimensions.
> >> Usually, the data are 4D but yours were only 3D, so the 'df' variable
> >> contained only three elements and the code didn't know that the 4th
> >> (5th, 6th
> >> etc) dimensions should be 1.
> >>
> >> This will be fixed in the next updates.
> >>
> >> All the best,
> >> -John
> >>
> >> On Tuesday 26 May 2009 07:02, Darren Gitelman wrote:
> >>> Hi
> >>>
> >>> I am having difficulty using the "normalize to MNI space" function
> >>> of
> >>> dartel.
> >>>
> >>> The steps I've taken are as follows
> >>> 1) Import seg_sn.mat files
> >>> 2) Create template: I used just the rc1 files.
> >>> 3) Normalise to MNI space- Selected c1Template6. Selected the flow
> >>> fields and selected the rc1 images.
> >>>
> >>> It produces this error
> >>>
> >>> Running 'Normalise to MNI Space'
> >>> ** Affine registering "c1Template_6" with MNI space **
> >>> Failed  'Normalise to MNI Space'
> >>> Attempted to access df(4); index out of bounds because numel(df)=3.
> >>> In file "/usr/local/imsw/SPM/spm8/toolbox/DARTEL/
> >>> spm_klaff.m" (v3053),
> >>> function "spm_klaff" at line 32.
> >>> In file "/usr/local/imsw/SPM/spm8/toolbox/DARTEL/
> >>> spm_dartel_norm_fun.m"
> >>> (v3032), function "spm_dartel_norm_fun" at line 94.
> >>>
> >>> The following modules did not run:
> >>> Failed: Normalise to MNI Space
> >>>
> >>> thanks
> >>> -----
> >>> Darren Gitelman

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
2006
2005
2004
2003
2002
2001
2000
1999
1998


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager