Connectome Workbench command line tools (wb_command) can do this easily,
e.g.
wb_command -surface-apply-warpfield <in.surf.gii> <inversewarp.nii.gz>
<out.surf.gii> -fnirt <forwardwarp.nii.gz>
Importantly, when you are transforming surfaces/coordinates you have to
use the inverse warpfield. The forward warp is only used for its NIFTI
header info.
Previously we had a hack that used FSL's img2stdcoord command, but that
required stripping all the header info out of the surface file,
transforming only the coordinates, and then adding it back in.
Peace,
Matt.
On 8/21/13 5:18 AM, "Jesper Andersson" <[log in to unmask]>
wrote:
>Dear Keith,
>
>I'm afraid that we don't have a tool that lets you do this in a
>straightforward manner. If you are reasonably familiar with C++
>programming the tools/classes that fnirt are built upon lets you sample
>the displacement fields in a continuous space (since they are represented
>as splines it is technically not even interpolation) which is what you
>need. But, it will involve getting your hand dirty with some C++.
>
>Jesper
>
>On 17 Aug 2013, at 19:59, Keith Jamison <[log in to unmask]>
> wrote:
>
>> I have a number of surfaces from freesurfer and I want to warp them
>>using a transform from FNIRT. There was a lot of manual editing of the
>>surfaces, so I am hoping to not have to regenerate them from the warped
>>surfaces. All of my attempts have run into problems working between
>>coordinate systems.
>>
>> Is there a straightforward way to apply the FNIRT warp field to sets of
>>X,Y,Z coordinates?
>>
>> Thanks,
>> Keith
|