Hi Mark,
From the help for spm_reslice "All operations are performed relative
to the first image", but you pass a single image V{ii} at a time, so
relative to itself, nothing needs to be done. Hopefully if you just
replace:
> for ii=1:numberOfScans
> spm_reslice(V{ii})
> end
with:
spm_reslice(V);
then all should be fine.
Best,
Ged.
Mark Schira wrote:
> Hi
> I am trying to use the spm_realign and reslice functions for a scripted fMRI
> preprocessing.
> This seems simple enough, although I have little experience with SPM
>
> So what I do:
>
> for ii=1:numberOFScans
> P{ii}=spm_select... % the appropriate filters finding the right files…
> end
> V = spm_vol(P);
> FlagsC = struct( 'quality',1,...
> 'fwhm',5,...
> 'rtm',1,...% 'wrap',[0 1 0],...
> 'interp',7);
>
> V=spm_realign(V,FlagsC);
> for ii=1:numberOfScans
> spm_reslice(V{ii})
> end
>
> This results in new files with an r in front of the original names – so that
> looks pretty good, does it?
>
> I do then read these files into a different (i.e. not SPM) fMRI tool.
> However, when I am inspecting the files there, I see that the motion (at
> least between scans) is NOT corrected.
>
> Not sure what I am doing wrong.
> One thing is important: I am using SPM5 and I do not read the
> nifti-information of the outfiles, but rather assume that spm_reslice
> applies the rotation to the .img file. ( I think that is the purpose the
> reslice operation...).
> Thanks for advice,
> Best
> Mark
>
|