Try this:
file=spm_get(inf,'*.img');
v=spm_vol(deblank(file(i,:));
dimz=v.dim(3);
oddidx=1:2:dimz;
evenidx=2:2:dimz;
idx=[oddidx evenidx]; %if you scan even slices first please use
idx=[evenidx oddidx];
for i=1:size(file,1);
v=spm_vol(deblank(file(i,:));
dat=spm_read_vols(v);
data(:,:,idx)=dat;
v=spm_write_vol(v,data);
end
Good luck!
Ze
Mike Yassa wrote:
> Dear SPM,
>
> I have a fMRI time series that was acquired using interleaved slice
> timing (which I can easily resolve using slice timing correction), but
> the slices are also spatially interleaved. It seems as if the scanner
> reconstruction of the 3D image failed, resulting in an interleaved (odds
> then evens) scan. I attached a sample volume to get an idea of what this
> looks like. Is there a way within SPM or MRICro to reorder the slices in
> space (rather than time), based on a specified slice order?
>
> Thanks
>
> Mike
>
>
> --
> ______________________________________________________________________
> | Michael A. Yassa, B.A. |
>
> | ____ ______ __ |
> | ( _ )( __ )( ) Division of Psychiatric Neuroimaging |
> | ) __) )( )( )( Department of Psychiatry and Behavioral Sciences|
> | (__) (__)(__)(__) The Johns Hopkins University School of Medicine |
> | 600 North Wolfe Street, Phipps 322, Baltimore MD 21287 |
> | Tel: 410-955-7861, Fax: 410-614-3676, E-mail: [log in to unmask] |
> | Web: http://pni.med.jhu.edu |
> |_____________________________________________________________________|
|