Dear Benjamin,
What John is suggesting is that it is roughly the same model underneath
spm.spatial.preproc and spm.spatial.normalise. The different interfaces
reflect the fact that one is geared towards a VBM analysis while the
second one is geared towards an fMRI data analysis.
The simplest in your case is to use spm.spatial.normalise only.
Best regards,
Guillaume.
On 01/04/2019 15:03, Suarez Jimenez, Benjamin wrote:
> Thank you so much for your reply, so would you be able to advise which
> is the best method (code) to use?
>
>
>
> Should I just use the segmentation code,
>
>
>
> clear matlabbatch
>
> matlabbatch{1}.spm.spatial.preproc.channel.vols= {Structural nii
> file}
>
> matlabbatch{1}.spm.spatial.preproc.channel.biasreg = 0.001;
>
> matlabbatch{1}.spm.spatial.preproc.channel.biasfwhm = 60;
>
> matlabbatch{1}.spm.spatial.preproc.channel.write = [0 0];
>
> matlabbatch{1}.spm.spatial.preproc.tissue(1).tpm =
> {'C:\Users\Documents\MATLAB\spm12\tpm\TPM.nii,1'};
>
> matlabbatch{1}.spm.spatial.preproc.tissue(1).ngaus = 1;
>
> matlabbatch{1}.spm.spatial.preproc.tissue(1).native = [1 0];
>
> matlabbatch{1}.spm.spatial.preproc.tissue(1).warped = [0 1]; %[0
> 1] Normalization, [0 0] for no normalization
>
> matlabbatch{1}.spm.spatial.preproc.tissue(2).tpm =
> {'C:\Users\Documents\MATLAB\spm12\tpm\TPM.nii,2'};
>
> matlabbatch{1}.spm.spatial.preproc.tissue(2).ngaus = 1;
>
> matlabbatch{1}.spm.spatial.preproc.tissue(2).native = [1 0];
>
> matlabbatch{1}.spm.spatial.preproc.tissue(2).warped = [0 1]; %[0
> 1] Normalization, [0 0] for no normalization
>
> matlabbatch{1}.spm.spatial.preproc.tissue(3).tpm =
> {'C:\Users\Documents\MATLAB\spm12\tpm\TPM.nii,3'};
>
> matlabbatch{1}.spm.spatial.preproc.tissue(3).ngaus = 2;
>
> matlabbatch{1}.spm.spatial.preproc.tissue(3).native = [1 0];
>
> matlabbatch{1}.spm.spatial.preproc.tissue(3).warped = [0 1]; %[0
> 1] Normalization, [0 0] for no normalization
>
> matlabbatch{1}.spm.spatial.preproc.tissue(4).tpm =
> {'C:\Users\Documents\MATLAB\spm12\tpm\TPM.nii,4'};
>
> matlabbatch{1}.spm.spatial.preproc.tissue(4).ngaus = 3;
>
> matlabbatch{1}.spm.spatial.preproc.tissue(4).native = [1 0];
>
> matlabbatch{1}.spm.spatial.preproc.tissue(4).warped = [0 1]; %[0
> 1] Normalization, [0 0] for no normalization
>
> matlabbatch{1}.spm.spatial.preproc.tissue(5).tpm =
> {'C:\Users\Documents\MATLAB\spm12\tpm\TPM.nii,5'};
>
> matlabbatch{1}.spm.spatial.preproc.tissue(5).ngaus = 4;
>
> matlabbatch{1}.spm.spatial.preproc.tissue(5).native = [1 0];
>
> matlabbatch{1}.spm.spatial.preproc.tissue(5).warped = [0 1]; %[0
> 1] Normalization, [0 0] for no normalization
>
> matlabbatch{1}.spm.spatial.preproc.tissue(6).tpm =
> {'C:\Users\Documents\MATLAB\spm12\tpm\TPM.nii,6'};
>
> matlabbatch{1}.spm.spatial.preproc.tissue(6).ngaus = 2;
>
> matlabbatch{1}.spm.spatial.preproc.tissue(6).native = [0 0]; %[1
> 0] for native space, [0 0] for none
>
> matlabbatch{1}.spm.spatial.preproc.tissue(6).warped = [0 1]; %[0
> 1] Normalization, [0 0] for no normalization
>
> matlabbatch{1}.spm.spatial.preproc.warp.mrf = 1;
>
> matlabbatch{1}.spm.spatial.preproc.warp.cleanup = 1;
>
> matlabbatch{1}.spm.spatial.preproc.warp.reg = [0 0.001 0.5 0.05 0.2];
>
> matlabbatch{1}.spm.spatial.preproc.warp.affreg = 'mni';
>
> matlabbatch{1}.spm.spatial.preproc.warp.fwhm = 0;spm
>
> matlabbatch{1}.spm.spatial.preproc.warp.samp = 3;
>
> matlabbatch{1}.spm.spatial.preproc.warp.write = [0 0];
>
> spm_jobman('run', matlabbatch);
>
>
>
> should I use the normalization code,
>
>
>
> clear matlabbatch
>
> matlabbatch{1}.spm.spatial.normalise.estwrite.subj.vol(1) = {Structural
> nii file}
>
> matlabbatch{1}.spm.spatial.normalise.estwrite.subj.resample =
> {preprocessed EPI file}
>
> matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.biasreg = 0.0001;
>
> matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.biasfwhm = 60;
>
> matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.tpm =
> {'C:\Users\Documents\MATLAB\spm12\tpm\TPM.nii'};
>
> matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.affreg = 'mni';
>
> matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.reg = [0 0.001
> 0.5 0.05 0.2];
>
> matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.fwhm = 0;
>
> matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.samp = 3;
>
> matlabbatch{1}.spm.spatial.normalise.estwrite.woptions.bb = [-78 -112 -70
>
> 78 76 85];
>
> matlabbatch{1}.spm.spatial.normalise.estwrite.woptions.vox = [2 2 2];
>
> matlabbatch{1}.spm.spatial.normalise.estwrite.woptions.interp = 4;
>
> matlabbatch{1}.spm.spatial.normalise.estwrite.woptions.prefix = 'w';
>
> spm_jobman('run',matlabbatch);
>
> Or both?
>
>
>
> Thanks,
>
> B
>
>
>
>
>
> *From:* John Ashburner <[log in to unmask]>
> *Sent:* Tuesday, March 26, 2019 12:48 PM
> *To:* Suarez Jimenez, Benjamin <[log in to unmask]>
> *Subject:* Re: [SPM] Segmentation + Normalization SPM12
>
>
>
> Spatial normalisation in SPM12 uses the same code as the Segmentation,
> except I've made the user interface simpler.
>
>
>
> Best regards,
>
> -John
>
>
>
>
>
>
>
>
>
> On Tue, 26 Mar 2019 at 16:07, Suarez Jimenez, Benjamin
> <[log in to unmask]
> <mailto:[log in to unmask]>> wrote:
>
> Hi all,
>
>
>
> I was recently advised to do the segmentation and normalization
> together (see code below), is this truly better than doing it
> separately? And if I do, do I run a normalization on the EPI images
> as well or is this step unnecessary?
>
>
>
> Thanks,
>
>
>
> Ben
>
>
>
>
>
> %% Segment structural + Normalization
>
> clear matlabbatch
>
> matlabbatch{1}.spm.spatial.preproc.channel.vols= {Structural nii
> file} matlabbatch{1}.spm.spatial.preproc.channel.biasreg = 0.001;
>
> matlabbatch{1}.spm.spatial.preproc.channel.biasfwhm = 60;
>
> matlabbatch{1}.spm.spatial.preproc.channel.write = [0 0];
>
> matlabbatch{1}.spm.spatial.preproc.tissue(1).tpm =
> {'C:\Users\Documents\MATLAB\spm12\tpm\TPM.nii,1'};
>
> matlabbatch{1}.spm.spatial.preproc.tissue(1).ngaus = 1;
>
> matlabbatch{1}.spm.spatial.preproc.tissue(1).native = [1 0];
>
> matlabbatch{1}.spm.spatial.preproc.tissue(1).warped = [0
> 1]; %[0 1] Normalization, [0 0] for no normalization
>
> matlabbatch{1}.spm.spatial.preproc.tissue(2).tpm =
> {'C:\Users\Documents\MATLAB\spm12\tpm\TPM.nii,2'};
>
> matlabbatch{1}.spm.spatial.preproc.tissue(2).ngaus = 1;
>
> matlabbatch{1}.spm.spatial.preproc.tissue(2).native = [1 0];
>
> matlabbatch{1}.spm.spatial.preproc.tissue(2).warped = [0
> 1]; %[0 1] Normalization, [0 0] for no normalization
>
> matlabbatch{1}.spm.spatial.preproc.tissue(3).tpm =
> {'C:\Users\Documents\MATLAB\spm12\tpm\TPM.nii,3'};
>
> matlabbatch{1}.spm.spatial.preproc.tissue(3).ngaus = 2;
>
> matlabbatch{1}.spm.spatial.preproc.tissue(3).native = [1 0];
>
> matlabbatch{1}.spm.spatial.preproc.tissue(3).warped = [0
> 1]; %[0 1] Normalization, [0 0] for no normalization
>
> matlabbatch{1}.spm.spatial.preproc.tissue(4).tpm =
> {'C:\Users\Documents\MATLAB\spm12\tpm\TPM.nii,4'};
>
> matlabbatch{1}.spm.spatial.preproc.tissue(4).ngaus = 3;
>
> matlabbatch{1}.spm.spatial.preproc.tissue(4).native = [1 0];
>
> matlabbatch{1}.spm.spatial.preproc.tissue(4).warped = [0
> 1]; %[0 1] Normalization, [0 0] for no normalization
>
> matlabbatch{1}.spm.spatial.preproc.tissue(5).tpm =
> {'C:\Users\Documents\MATLAB\spm12\tpm\TPM.nii,5'};
>
> matlabbatch{1}.spm.spatial.preproc.tissue(5).ngaus = 4;
>
> matlabbatch{1}.spm.spatial.preproc.tissue(5).native = [1 0];
>
> matlabbatch{1}.spm.spatial.preproc.tissue(5).warped = [0
> 1]; %[0 1] Normalization, [0 0] for no normalization
>
> matlabbatch{1}.spm.spatial.preproc.tissue(6).tpm =
> {'C:\Users\Documents\MATLAB\spm12\tpm\TPM.nii,6'};
>
> matlabbatch{1}.spm.spatial.preproc.tissue(6).ngaus = 2;
>
> matlabbatch{1}.spm.spatial.preproc.tissue(6).native = [0
> 0]; %[1 0] for native space, [0 0] for none
>
> matlabbatch{1}.spm.spatial.preproc.tissue(6).warped = [0
> 1]; %[0 1] Normalization, [0 0] for no normalization
>
> matlabbatch{1}.spm.spatial.preproc.warp.mrf = 1;
>
> matlabbatch{1}.spm.spatial.preproc.warp.cleanup = 1;
>
> matlabbatch{1}.spm.spatial.preproc.warp.reg = [0 0.001 0.5
> 0.05 0.2];
>
> matlabbatch{1}.spm.spatial.preproc.warp.affreg = 'mni';
>
> matlabbatch{1}.spm.spatial.preproc.warp.fwhm = 0;spm
>
> matlabbatch{1}.spm.spatial.preproc.warp.samp = 3;
>
> matlabbatch{1}.spm.spatial.preproc.warp.write = [0 0];
>
> spm_jobman('run', matlabbatch);
>
>
>
> % %% Normalization
>
> % for ses = 1:sesnum
>
> % clear matlabbatch
>
> %
> matlabbatch{1}.spm.spatial.normalise.estwrite.subj.vol(1) =
> {Structural nii file}
>
> %
> matlabbatch{1}.spm.spatial.normalise.estwrite.subj.resample =
> {preprocessed EPI file}
>
> %
> matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.biasreg = 0.0001;
>
> %
> matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.biasfwhm = 60;
>
> %
> matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.tpm =
> {'C:\Users\Documents\MATLAB\spm12\tpm\TPM.nii'};
>
> %
> matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.affreg = 'mni';
>
> %
> matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.reg = [0
> 0.001 0.5 0.05 0.2];
>
> %
> matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.fwhm = 0;
>
> %
> matlabbatch{1}.spm.spatial.normalise.estwrite.eoptions.samp = 3;
>
> %
> matlabbatch{1}.spm.spatial.normalise.estwrite.woptions.bb
> <https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fspm.spatial.normalise.estwrite.woptions.bb&data=02%7C01%7Cg.flandin%40UCL.AC.UK%7Ca412502ec75749e2339108d6b6aad7d6%7C1faf88fea9984c5b93c9210a11d9a5c2%7C0%7C0%7C636897242221473795&sdata=xB0P3%2FiwnVtxoipDChHiE%2FrMBj64pKfu4sJrKqj7Cgk%3D&reserved=0>=
> [-78 -112 -70
>
> % �� 78 76 85];
>
> %
> matlabbatch{1}.spm.spatial.normalise.estwrite.woptions.vox = [2 2 2];
>
> %
> matlabbatch{1}.spm.spatial.normalise.estwrite.woptions.interp = 4;
>
> %
> matlabbatch{1}.spm.spatial.normalise.estwrite.woptions.prefix = 'w';
>
> % spm_jobman('run',matlabbatch);
>
> % end
>
>
>
>
>
>
>
> --
>
> Prof John Ashburner
> Professor of Imaging Science
> UCL Institute of Neurology
> Queen Square
> Wellcome Trust Centre for Neuroimaging
> University College London
> 12 Queen Square, London, WC1N 3BG
> E: [log in to unmask] <mailto:[log in to unmask]> T: +44 (0)20
> 3448 4365
> http://www.fil.ion.ucl.ac.uk/
>
--
Guillaume Flandin, PhD
Wellcome Centre for Human Neuroimaging
UCL Queen Square Institute of Neurology
London WC1N 3BG
|