flirt does not use the nifti origin, I think this may be the cause of your problems. I wrote a utility to convert between simple coordinate to coordinate matrices and the matrices flirt expects (and another convention or two specific to 4dfp). You probably won't have it unless you have a very recent version of the 4dfp suite (look for the source folder/executable "aff_conv" if you do).
To be precise, flirt uses the pixdim field of nifti for the spacing, with an origin at voxel (0, 0, 0), that is, corner of the volume. However, it also checks for the sform having positive determinant, and if so, does an x-flip of the coordinate system (that is, negates the x spacing, and puts the origin at voxel (X, 0, 0) where X is the largest possible value of the first index). In short, yes it should be simple, but it isn't. I actually don't know of a volume transform/resampling utility that works correctly with an unadulterated coordinate to coordinate transform. Tim On Wed, Dec 26, 2012 at 12:16 PM, Colin Reveley <[email protected]> wrote: > thanks donna - I know that. > > I'm talking about volumes and surfaces that are already aigned, and > humming nicely. > > I want to apply an arbitrary linear operation to the volume (actuslly just > two rotations, but it shoould generalise presumably) and the surface, and > have them stay linked. > > so, turn it upside down. double it's size. > > one matrix. two things (MRI data, and surface representations of exactly > that data) that are equivalent in space under any transform I care to > apply. > > > > On 26 December 2012 18:00, <[email protected]> wrote: > >> Send caret-users mailing list submissions to >> [email protected] >> >> To subscribe or unsubscribe via the World Wide Web, visit >> http://brainvis.wustl.edu/mailman/listinfo/caret-users >> or, via email, send a message with subject or body 'help' to >> [email protected] >> >> You can reach the person managing the list at >> [email protected] >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of caret-users digest..." >> >> Today's Topics: >> >> 1. Re: transform surf and vol (Donna Dierker) >> >> >> ---------- Forwarded message ---------- >> From: Donna Dierker <[email protected]> >> To: "Caret, SureFit, and SuMS software users" < >> [email protected]> >> Cc: >> Date: Tue, 25 Dec 2012 15:31:48 -0600 >> Subject: Re: [caret-users] transform surf and vol >> If you import a Freesurfer surface into Caret, it won't align with the >> volume in mri/orig.mgz until you apply an offset transformation defined by >> something like mri_info -cras (I forget the exact command). Depending on >> which surface you apply that transformation -- before or after cras offset >> -- you could get the behavior you describe. >> >> >> On Dec 24, 2012, at 7:51 PM, Colin Reveley wrote: >> >> > Hey, merry christmas. >> > >> > I have a surface. and a volume. they are in register in caret. the >> volume has an origin reported in the nifti header. >> > >> > If I apply a rigid body transform to both, they are both rotated the >> way I want (the way I want is so that the surface, and MR data in the slice >> plane as some microscope slides of the sample) but the surface is no longer >> in register with the volume. >> > >> > the rotations are right. but the translations aren't (there aren't any >> translations intended actually) >> > >> > I can >> > >> > a) manually translate the surface around in caret till it roughly fits >> (which I did, it's fine for now) >> > b) adjust the origin of the nifti (the origin isn't changed by applying >> the transform with flirt) >> > >> > or I guess c) adjust something in the surface header. couldn't see what. >> > >> > It occurred to me to treat the original volume origin as a vector and >> apply the transform to it, then set the origin of the rotated volume to >> those values. >> > >> > Probably that would work. But it's a bit too much linear algebra for me. >> > >> > Moving on from the obvious fact that I'm not that bright, surely doing >> exactly this kind of thing ought to be pretty easy? >> > >> > >> > _______________________________________________ >> > caret-users mailing list >> > [email protected] >> > http://brainvis.wustl.edu/mailman/listinfo/caret-users >> >> >> >> >> _______________________________________________ >> caret-users mailing list >> [email protected] >> http://brainvis.wustl.edu/mailman/listinfo/caret-users >> >> > > _______________________________________________ > caret-users mailing list > [email protected] > http://brainvis.wustl.edu/mailman/listinfo/caret-users > >
_______________________________________________ caret-users mailing list [email protected] http://brainvis.wustl.edu/mailman/listinfo/caret-users
