Hi Marc,
> Is it currently possible at all to retrieve
> the native space coordinates for a given
> subject from the skeleton for that subject?
Possibly... I haven't tested it properly, but I have some code which
attempts to use FSL's dof2warp
http://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=ind06&L=FSL&P=R252866
in combination with SPM5's warp inversion code (converting between the
different "warp" formats), to get forward and inverted warps which
should then let you map coordinates.
I originally hoped to be able to complete the process to get back to a
inverse dof file (and I could then at least verify round-trip
consistency) but approximating a general warp with B-splines isn't
part of the FSL distribution of IRTK (I think something similar for
landmark correspondences might be available from Daniel Rueckert or
Julia Schnabel though)
The warp inversion code requires the SPM5 toolbox, running under
Matlab, if that's okay for you, then please try it out!
http://www.cs.ucl.ac.uk/staff/gridgway/fsl/invert_warp.m
I have an additional SPM5 function which can use one of the SPM5
y_warp.nii files to map between coordinate systems:
http://www.cs.ucl.ac.uk/staff/gridgway/vbm/map_coords.m
I haven't tested this at all, but assuming that n2s.dof allows
transformation of a native image to skeleton space (sorry if this
isn't the usual way round -- I haven't actually used TBSS!), then
something like:
invert_warp('n2s.dof', 'skel.nii', 'native.nii');
should generate y_n2s_5D.nii and y_n2s_5D_inv.nii, where, these will
respectively be defined over the skeleton voxels, and over the native
voxels, pointing to coordinates in the other space.
Then things like:
native_vx = [1 2 3]'; % NB one-based, not zero-based!
[skel_mm skel_vx] =...
map_coords(native_vx, '', 'y_n2s_5D_inv.nii', 'skel.nii');
[native_mm native_vx] =...
map_coords(skel_vx, '', 'y_n2s_5D.nii', 'native.nii');
Should take you between the two coordinate systems. (Your input
coordinates can be a 3-by-N matrix for N points at a time, and you can
also use map_coords to get voxel from NIfTI mm coordinates for a
particular image, which might be convenient, since these should match
between FSLview and SPM, unlike the respectively zero- and one-based
voxel coordinates. See "help mapcoords" in Matlab for examples.)
I hope this helps (at least until FMRIB's version arrives, which will
almost certainly be better), but please treat it as very much alpha
quality... You could presumably check the skel_vx to native transform,
by checking if a voxel in the transformed image has the expected
intensity based on the interpolated corresponding voxels in the native
image (again, assuming this is the usual direction of the TBSS mappings).
Best,
Ged
|