Print

Print


For your first approach, try this (I think you just left off the file extension):
flirt -ref example_func -in highres -out resampled_T1 -applyxfm -init highres2example_func.mat -interp trilinear

Your second approach might be failing because you're not using FNIRT (i.e., nonlinear registration). With FNIRT, you have to compute the inverse warp field (e.g., to take an image from standard to subject space) and then apply that warp -- which will be an image -- with applywarp. See FNIRT documentation for more information.

Cheers,
David


On Apr 18, 2012, at 12:29 AM, www wrote:

> Dear Experts,
>     I have a very simple task for fsl.   I have registered functional data to T1 and successfully created the inverse transformation mat file, but just couldn't do the resampling using either applywarp or flirt. The error message for using applywarp was weird to me because the "--warp" option should be for supplying a warp matrix file (.mat) but applywarp was looking for a nii file instead.
> Could anyone tell me how to get this resampling work?
> 
> Thanks
> Ze
> The following is the detailed description:
> 
> #register functional data to T1
> flirt -ref highres -in example_func -out example_func2highres -omat example_func2highres.mat -cost corratio -dof 6 -interp trilinear
> # Create mat file for conversion from subject's anatomical to functional
> convert_xfm -inverse -omat highres2example_func.mat example_func2highres.mat
> # resampling  approach 1 and errors:
> 
> flirt -ref example_func -in highres -out resampled_T1 -applyxfm -init highres2example_func -interp trilinear
> Could not open matrix file highres2example_func
> terminate called after throwing an instance of 'NEWMAT::IncompatibleDimensionsException'
> Abort
> # resampling approach 2 and errors:
> applywarp --ref=example_func --in=highres -w highres2example_func --out=resampled_T1
> ** ERROR (nifti_image_read): failed to find header file for 'highres2example_func'
> ** ERROR: nifti_image_open(highres2example_func): bad header info
> Error: failed to open file highres2example_func
> ERROR: Could not open image highres2example_func
> Image Exception : #22 :: Failed to read volume highres2example_func
> An error occured while reading file: highres2example_func
>