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]>
|