Print

Print


Hi,

I'm afraid that things are slow here because it does a local inversion of the warpfield everytime.  It is easy to run invwarp to get an inverse warpfield (and it works fairly quickly) but we haven't got anything conveniently written to map the coordinates without the inversion. 

It is possible to take the inverse warpfield (use invwarp), map your mesh coordinates to voxel coordinates, look up the corresponding voxel in the inverse warpfield (easiest with --abs and then divide each 3D volume by the corresponding pixdim to get a voxel coordinate), take the vector from the inverse warpfield at this location (assembled from the three images), and then map this through the sform (just matrix multiplication).  Alternatively, you might be able to use wb_command from HCP's workbench if you have the right format for your meshes.  Check the HCP list, as this has recently been discussed there.

All the best,
Mark


From: FSL - FMRIB's Software Library <[log in to unmask]> on behalf of Arjun Mukerji <[log in to unmask]>
Reply-To: FSL - FMRIB's Software Library <[log in to unmask]>
Date: Friday, 25 September 2015 01:11
To: "[log in to unmask]" <[log in to unmask]>
Subject: [FSL] Applying FNIRT warp for coordinate transformation

Hi all,

I've got an anatomical image and the FNIRT warp field (both coefficients from --cout and the field itself from --fout) that maps the MNI152 standard to it (I realize this is not the usual direction for these transformations, but it's useful for the project I'm working on to operate in the anatomical space). Using img2stdcoord, I have verified that this warp is satisfactory and the correct coordinates can be recovered.

However, I'm trying to transform a large number of coordinates (the vertices of a cortical surface mesh), and img2stdcoord is extremely slow, taking multiple seconds to transform one point, and many hours to deal with the ~300k points of the mesh. Is there a faster way to apply the warp to a list of coordinates (using img2stdcoord or other FSL tools)?

Best,
Arjun