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  December 2009

SPM December 2009

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: Longitudinal DARTEL spm8

From:

John Ashburner <[log in to unmask]>

Reply-To:

John Ashburner <[log in to unmask]>

Date:

Thu, 31 Dec 2009 16:31:11 +0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (159 lines)

If you use something like the following script, then it will generate a
bunch of change_*.nii files for each subject.  These can then be
spatially normalised to MNI space using DARTEL (with "modulation" and
some spatial blurring) to do your GLM fitting.

Best regards,
-John


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

P1 = spm_select(Inf,'image','Select first time points');
P2 = spm_select(size(P1,1),'image','Select second time points');

for i=1:size(P1,1)

        ref = deblank(P1(i,:));
        mov = deblank(P2(i,:));
        [pth,nam,ext] = spm_fileparts(ref);
        c1   = fullfile(pth,['c1' nam '.nii']);
        
        odir = pth;
        change = ['change_' nam '.nii'];
        
        [pth,nam,ext] = spm_fileparts(mov);
        jac = fullfile(pth,['jy_' nam '.nii']);
        
        matlabbatch{1}.spm.tools.hdw.data.ref = {ref};
        matlabbatch{1}.spm.tools.hdw.data.mov = {mov};
        matlabbatch{1}.spm.tools.hdw.bias_opts.nits = 8;
        matlabbatch{1}.spm.tools.hdw.bias_opts.fwhm = 60;
        matlabbatch{1}.spm.tools.hdw.bias_opts.reg = 1e-006;
        matlabbatch{1}.spm.tools.hdw.bias_opts.lmreg = 1e-006;
        matlabbatch{1}.spm.tools.hdw.warp_opts.nits = 8;
        matlabbatch{1}.spm.tools.hdw.warp_opts.reg = 4;
        matlabbatch{2}.spm.tools.preproc8.channel.vols = {ref};
        matlabbatch{2}.spm.tools.preproc8.channel.biasreg = 0.0001;
        matlabbatch{2}.spm.tools.preproc8.channel.biasfwhm = 60;
        matlabbatch{2}.spm.tools.preproc8.channel.write = [0 0];
        matlabbatch{2}.spm.tools.preproc8.tissue(1).tpm = ...
        
        {fullfile(spm('dir'),'toolbox','Seg','TPM.nii,1')};
        matlabbatch{2}.spm.tools.preproc8.tissue(1).ngaus = 2;
        matlabbatch{2}.spm.tools.preproc8.tissue(1).native = [1 1];
        matlabbatch{2}.spm.tools.preproc8.tissue(1).warped = [0 0];
        matlabbatch{2}.spm.tools.preproc8.tissue(2).tpm = ...
        
        {fullfile(spm('dir'),'toolbox','Seg','TPM.nii,2')};
        matlabbatch{2}.spm.tools.preproc8.tissue(2).ngaus = 2;
        matlabbatch{2}.spm.tools.preproc8.tissue(2).native = [1 1];
        matlabbatch{2}.spm.tools.preproc8.tissue(2).warped = [0 0];
        matlabbatch{2}.spm.tools.preproc8.tissue(3).tpm = ...
        
        {fullfile(spm('dir'),'toolbox','Seg','TPM.nii,3')};
        matlabbatch{2}.spm.tools.preproc8.tissue(3).ngaus = 2;
        matlabbatch{2}.spm.tools.preproc8.tissue(3).native = [1 0];
        matlabbatch{2}.spm.tools.preproc8.tissue(3).warped = [0 0];
        matlabbatch{2}.spm.tools.preproc8.tissue(4).tpm = ...
        
        {fullfile(spm('dir'),'toolbox','Seg','TPM.nii,4')};
        matlabbatch{2}.spm.tools.preproc8.tissue(4).ngaus = 3;
        matlabbatch{2}.spm.tools.preproc8.tissue(4).native = [0 0];
        matlabbatch{2}.spm.tools.preproc8.tissue(4).warped = [0 0];
        matlabbatch{2}.spm.tools.preproc8.tissue(5).tpm = ...
        
        {fullfile(spm('dir'),'toolbox','Seg','TPM.nii,5')};
        matlabbatch{2}.spm.tools.preproc8.tissue(5).ngaus = 4;
        matlabbatch{2}.spm.tools.preproc8.tissue(5).native = [0 0];
        matlabbatch{2}.spm.tools.preproc8.tissue(5).warped = [0 0];
        matlabbatch{2}.spm.tools.preproc8.tissue(6).tpm = ...
        
        {fullfile(spm('dir'),'toolbox','Seg','TPM.nii,6')};
        matlabbatch{2}.spm.tools.preproc8.tissue(6).ngaus = 2;
        matlabbatch{2}.spm.tools.preproc8.tissue(6).native = [0 0];
        matlabbatch{2}.spm.tools.preproc8.tissue(6).warped = [0 0];
        matlabbatch{2}.spm.tools.preproc8.warp.reg = 4;
        matlabbatch{2}.spm.tools.preproc8.warp.affreg = 'mni';
        matlabbatch{2}.spm.tools.preproc8.warp.samp = 3;
        matlabbatch{2}.spm.tools.preproc8.warp.write = [0 0];
        matlabbatch{3}.spm.util.imcalc.input = {c1,jac};
        matlabbatch{3}.spm.util.imcalc.output = change;
        matlabbatch{3}.spm.util.imcalc.outdir = {odir};
        matlabbatch{3}.spm.util.imcalc.expression = 'i1.*(i2-1)';
        matlabbatch{3}.spm.util.imcalc.options.dmtx = 0;
        matlabbatch{3}.spm.util.imcalc.options.mask = 0;
        matlabbatch{3}.spm.util.imcalc.options.interp = 1;
        matlabbatch{3}.spm.util.imcalc.options.dtype = 4;
        spm_jobman('run',matlabbatch);
end


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%




On Thu, 2009-12-31 at 15:51 +0000, Wei Deng wrote:
> Dear Benetti and John
> 
> On Thu, 25 Jun 2009 16:55:28 +0100, Benetti, Stefania 
> <[log in to unmask]> wrote:
> 
> >Dear SPMers and John
> >
> >Further the previous posts about using DARTEL for longitudinal VBM, 
> we  
> >decided to follow the HDW approach that Kipps used. Briefly:
> >
> >1. co-registration and HDW of late (FU) to early images (BA) for each 
> subject.
> >2. save Jacobian determinats (JY)
> >3. Segmentation of BA images
> >4. BA used to create a DARTEL template
> >5. BA images and JY warped with template ( modulation=yes)
> >6. wmBA multiplied by wmJY-> product images ( this using ImCalc)
> >7. normalisation to MNI
> >8. smoothing
> >
> I process a longitudinal dartel VBM (schizophrenia FU: 6 weeks later) 
> follow step 1-8 and got 2 FU images smwc1FU(GM) and smwc2FU(WM). 
> I have some questions about step5-8:
> (1)
> >5. BA images and JY warped with template ( modulation=yes)
> When  Dartel tools >>Create Warped >>images
> which images should be corrected choose: rc1/ rc2 or c1/c2 (products 
> of step3);
> . (2) In native space c1FU=c1BA multiplied by JY (HDW approach), the 
> volume of c1FU should equal to the GM volume of product images
> (step6), when I compared the two volumes, they are different. As far 
> as I know, science BA images and JY were warped and modulated, 
> when wmBA multiplied by wmJY,the product images seem to be 
> modulated twice! When modified step5-6 as following, the two volumes 
> were  same:
> 5. BA images warped with template ( modulation=yes); JY warped with 
> template ( modulation=no)
> 6.  wmBA multiplied by wJY-> product images ( this using ImCalc)
> 
> (3) if (2) is right,  when prudcing the smoothed and normalized product 
> image, may I instead step 5-8 as
> Step5:
> BA images and JY smoothed  and  spatially normalized to MNI
> Dartel tools >> Normalise to MNI Space 
> Preserve Concentrations: (swJY)
> Preserve  Total:  (smwBA)
> 
> Step6: swmBA multiplied by swJY-> product images ( this using ImCalc)
> 
> There’s 15 minutes to 0:00.
> Happy new year!
> 
> Wei Deng
> Westchina Hospital, Sichuan University
> Chengdu,Sichuan,China
> 


-- 
John Ashburner <[log in to unmask]>

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

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