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:

Monospaced Font

LISTSERV Archives

LISTSERV Archives

SPM Home

SPM Home

SPM  August 2008

SPM August 2008

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: where is VBM in the latest update of spm5

From:

John Ashburner <[log in to unmask]>

Reply-To:

John Ashburner <[log in to unmask]>

Date:

Tue, 5 Aug 2008 14:29:35 +0100

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (169 lines)

Hi Rik,
There's nothing to be scared of with the spm_jobman structures. If you create
a single job, you can save it as a .m file. This can then be tidied up to
make it a bit more clear. Once you have this, then it is a simple matter of
running the data structure with spm_jobman. For example, importing the data
into a form that DARTEL can use could be by:

matnames = {'/home/john/data/image1_seg_sn.mat'
            '/home/john/data/image2_seg_sn.mat'
            '/home/john/data/image3_seg_sn.mat'};
jobs{1}.tools{1}.dartel{1}.initial = struct(...
            'matnames',{matnames},...
            'odir', {{'/home/john/data'}},...
            'bb', nan(2,3), 'vox', 1.5,...
            'image', 0, 'GM', 1, 'WM', 1, 'CSF', 0);
spm_jobman('run',jobs);


Actually running the DARTEL registration bit is by simultaneously matching the
imported grey and white matter images to their common averages:


images = {{'/home/john/data/rc1image1.nii,1'
           '/home/john/data/rc1image2.nii,1'
           '/home/john/data/rc1image3.nii,1'};
          {'/home/john/data/rc2image1.nii,1'
           '/home/john/data/rc2image2.nii,1'
           '/home/john/data/rc2image3.nii,1'}};
param = struct(...
    'its',{3,3,3,3,3,3},...
    'rparam',{[4; 2; 1e-6],[2; 1; 1e-6],[1; 0.5; 1e-6],...
              [0.5; 0.25; 1e-6],[0.25; 0.125; 1e-6],[0.125;0.0625; 1e-6]},...
    'K',{0,0,1,2,4,6},...
    'slam',{16,8,4,2,1,0.5});
settings = struct('template','Template', 'rform',0,...
                  'param',param,...
                  'optim', struct('lmreg',0.01, 'cyc', 3, 'its', 3));
jobs{1}.tools{1}.dartel{1}.warp = struct('images',{images},...
                                         'settings',settings);
spm_jobman('run',jobs);


Creating modulated and warped grey and white matter is then by:


jobs{1}.tools{1}.dartel{1}.crt_warped = struct(...
    'flowfields', {{'/home/john/data/u_rc1image1_Template.nii'
                    '/home/john/data/u_rc1image2_Template.nii'
                    '/home/john/data/u_rc1image3_Template.nii'}},...
    'images', {{{'/home/john/data/rc1image1.nii'
                 '/home/john/data/rc1image2.nii'
                 '/home/john/data/rc1image3.nii'}
                {'/home/john/data/rc2image1.nii'
                 '/home/john/data/rc2image2.nii'
                 '/home/john/data/rc2image3.nii'}}},...
    'jactransf', 1, 'K', 6, 'interp', 1);
spm_jobman('run',jobs);


Alternatively, you may wish to write warped versions of the original images:

jobs{1}.tools{1}.dartel{1}.crt_warped = struct(...
    'flowfields', {{'/home/john/data/u_rc1image1_Template.nii'
                    '/home/john/data/u_rc1image2_Template.nii'
                    '/home/john/data/u_rc1image3_Template.nii'}},...
    'images', {{{'/home/john/data/image1.nii'
                 '/home/john/data/image2.nii'
                 '/home/john/data/image3.nii'}}},...
    'jactransf', 0, 'K', 6, 'interp', 1);
spm_jobman('run',jobs);


Smoothing the grey matter by 8mm (isotropic) can then be done by:

clear jobs
jobs{1}.spatial{1}.smooth = struct('data',{...
    '/home/john/data/mwrc1image1.nii,1'
    '/home/john/data/mwrc1image2.nii,1'
    '/home/john/data/mwrc1image2.nii,1'},...
    'fwhm', [8,8,8], 'dtype',0);
spm_jobman('run',jobs);


Notice the parallels between what you see in the job manager user interface,
and in the data structures. The meanings of the various fields are
documented via the user interface (or the manual), and should hopefully be
fairly straightforward.

Essentially, all the arguments that would be used are bundled together into a
common structure. If you take the smoothing job, then the
"jobs{1}.spatial{1}.smooth" part of the job structure says that it is a
smoothing job. "jobs" is common to everything. "spatial" indicates that it
is in the "spatial" pulldown menu. "smooth" indicates that the smoothing
routine should be called.

The individual fields that are passed to the smoothing routine are "data",
"fwhm" and "dtype".

My hope was that these data structures, saved in a common format such as XML
or whatever, could eventually have been used by various databasing projects
in order to describe what has actually happened to the data. Doesn't look
like this is going to pan out though.

All the best,
-John


On Tuesday 05 August 2008 12:39, Rik Henson wrote:
> Carlton/John -
>
> I don't suppose either of you have a Matlab batch script for a DARTEL
> VBM analysis in the form of a sequence of function calls to the relevant
> spm*.m functions? (This is how I prefer to batch). It would greatly help
> me get up to speed with DARTEL.
>
> Thanks
> Rik
>
> Carlton Chu wrote:
> > Hi Ze:
> >
> > There is no one simple button for VBM analysis, rather you have to go
> > through several stages by yourself.
> > For the most current version of SPM5, first, you can use the
> > segmentation button to segment the images. You don't really need to
> > generate any output images at this stage, but it is recommended to at
> > least generate the native space Grey Matter map to see if something
> > goes wrong.
> > After applying the segmentation, you should get some sn_*.mat
> > parameter files, go to TASKS->Tools->DARTEL tool->Initial Import, and
> > import those parameter files to generate rc1*.nii,rc2*.nii
> > Then select Run Dartel (create template) to generate the deformation
> > parameters.
> > After that, you can then select "create warped", remmeber to choose
> > "Modulation" in the option.
> >
> > Smooth those modulated, normalized images, and use the Basic models to
> > analys your VBM.
> >
> > See the complete guide for DARTEL
> > http://www.fil.ion.ucl.ac.uk/~john/misc/dartel_guide.pdf
> >
> > Best,
> > Carlton
> >
> > zewang wrote:
> >> Dear all,
> >> I'm trying to do VBM using the latest update, but I can't find
> >> "VBM" in
> >> the toolbox. Instead, I found "PET&VBM" the button after I launched
> >> spm in
> >> matlab. Should I download a separate toolbox from Christian's web
> >> (which is
> >> down now)? Another question is if the separate VBM toolbox is not
> >> necessary, does
> >> this mean VBM in spm5 will not generate a local template?
> >>
> >> Thanks.
> >>
> >> ---------------------------------------------
> >> Ze Wang, Ph. D
> >> Center for functional neuroimaging,
> >> Dept of Neurology,
> >> Medicine school, University of Pennsylvania
> >> 3400 Spruce Stree,
> >> 3W Gates building,
> >> Philadelphia, PA 19104
> >> Tel: 215-662-7341

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

May 2024
April 2024
March 2024
February 2024
January 2024
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
December 2019
November 2019
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

For help and support help@jisc.ac.uk

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