Hi Beth,
> I use SPM2 to analyze my data. Before I do slice timing, I flip my data
> along the x and y axis using the fsl 3.3 command avwswapdim. When I do this,
> fsl changes my data from radiological to neurological format (the desired
> effect) and also changes the pixdim variable for the X axis to a positive
> number (an undesired effect).
I expect you can sort things out using SPM2. One option would be to
work out how you want to flip the voxel dimensions and simply do this
in Matlab. i.e. instead of avwswapdim, something like:
V = spm_vol('image.img');
dat = spm_read_vols(V);
dat = flipdim(dat, 1); % swap x
dat = flipdim(dat, 2); % swap y
spm_write_vol(V, dat); % now check this!
(see "help flipdim" and also "help permute", to match avwswapdim's
functionality)
Alternatively, if you can get your avwswapdim'ed images to work fine
with your in-house software, then you can probably get SPM2 to be
happy by creating a image.mat file with the desired affine voxel-world
mapping (which can include negative diagonal elements for flips). E.g.
V = spm_vol('filename.img');
mat = diag([-1 1 1 1])*V.mat; % flip in (world) x
M = mat; % (can't remember which name SPM2 wants!)
save filename.mat M mat
In fact, I think you can probably do this with "display" in the SPM2
GUI, and then changing the scaling to negative values, and clicking
"reorient images" and reselecting the image(s), which would make it
easier to play around and work out exactly which flips are necessary.
Do take care to keep track of right and left, of course.
Good luck,
Ged.
P.S. Sorry for polluting the FSL list with two SPM answers today ;-)
|