We are seeking to batch script SPM to perform some pre-processing of PET data.
We want to run SPM's Realign, Estimate & Reslice to correct for across frame motion in our dynamic data.
When we perform the SPM realignment manually via the GUI in SPM8, we obtain nice, realigned results.
However, when we tried to batch script this to run on multiple subjects in parallel, we are running into the issue of some of the subjects' (n=6) realignment outputs being poor while others look fine (n=11).
Here is the batch script we are using:
matlabbatch{1}.spm.spatial.realign.estwrite.data = b.realignList;
matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.quality = 0.9;
matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.sep = 4;
matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.fwhm = 5;
matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.rtm = 1;
matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.interp = 2;
matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.wrap = [0 0 0];
matlabbatch{1}.spm.spatial.realign.estwrite.eoptions.weight = '';
matlabbatch{1}.spm.spatial.realign.estwrite.roptions.which = [2 1];
matlabbatch{1}.spm.spatial.realign.estwrite.roptions.interp = 4;
matlabbatch{1}.spm.spatial.realign.estwrite.roptions.wrap = [0 0 0];
matlabbatch{1}.spm.spatial.realign.estwrite.roptions.mask = 1;
matlabbatch{1}.spm.spatial.realign.estwrite.roptions.prefix = 'r';
The resulting "rvols" from this script are often cutoff (missing parts of the brain) as if they lack the full number of slices expected in each volume. The voxels in the "blank" portions of the realigned vols are reading "NaN".
For batch processing is it better to estimate the realignment parameters and then reslice separately?
Any insights as to why we are getting this issue when batching versus not would be greatly appreciated.
Thanks,
Chris Smith
Postdoc, Zald Affective Neuroscience Lab
Vanderbilt University
|