Print

Print


Here is Tim Coalson's off-list reply to David, in case there are other 4dfp users out there:

> There is a new program I wrote last summer in the 4dfp suite to do some of these conversions, aff_conv.  It can do the conversion between FSL and 4dfp, though that is about the extent of the formats it currently knows.
> 
> usage: aff_conv <source volume> <target volume> <input affine file> <output affine file> <conversion string>
> 	volumes may be either nifti (single file, uncompressed) or 4dfp.  Best results will come from
> 	affine files from transverse images (axis order left/right, posterior/anterior, inferior/superior).
> 	always use the same source and target files that were used to generate the affine.
> 	conversion string is a 2 character string where first character gives current format, and second
> 	character gives desired output format.  Format characters are:
> 4	_t4 file from 4dfp utilities
> f	FLIRT matrix from FSL
> w	world coordinate transform, using nifti LPI axes
> x	extracted matrices from 4dfp xr3d.mat files
> 	if the input matrix was generated with a different pair of files than the output will be
> 	applied to, convert in two steps: first to world using the first pair, then to output format
> 	using the volume it will be applied to, and a volume with the target spacing/center.
> 
> so, for your case, you would probably want to convert in 2 steps:
> 
> aff_conv <fsl individual volume> <fsl target atlas> <fsl .mat> register.wmat fw
> aff_conv <4dfp individual volume> <4dfp target space> register.wmat something_t4 w4
> 
> I forget the naming conventions for t4 files at the moment.  The 4dfp target space is just a 4dfp volume with the field of view you want (you can use nifti_4dfp to convert the FSL target atlas to 4dfp to get the same field of view, and then use it again to convert the volume back to nifti after applying the transform, though you will probably need to copy the sform to the qform and convert the volume to radiological orientation to make FSL happy).
> 
> If your 4dfp suite doesn't have that tool, you should probably update it, we should probably talk to Avi to get the latest.

(Tim is full time with WashU's Van Essen Lab now.)


On Nov 8, 2011, at 3:20 AM, Stephen Smith wrote:

> Sorry - I don't know anything about the 4dfp file format…..
> Cheers.
> 
> 
> On 7 Nov 2011, at 21:17, David Grayson wrote:
> 
>> Hi,
>>  
>> Are there any tools to convert between FSL’s .mat file and 4dfp’s t4 file? We have a lot of infant and monkey data at our lab, and we’ve noticed that FSL’s bet and flirt registration process seems to work better than Avi’s ‘imgreg_4dfp’ command, but we’ve noticed that 4dfp seems to work best for other processing steps, given our kinds of analyses . Consequently , we’d like to use FSL to extract the matrix files, but actually apply them with 4dfp. This means we’ll need to convert the .mat file to a t4.
>>  
>> We generally use caret_command to interconvert between nifti and ifh files, and I understand there may or may not be flipping to account for when this happens. But I’m not exactly clear wherein the differences lie between the transformation matrices, and how to adjust. Thanks in advance for any help you can provide.
>>  
>> -David
> 
> 
> ---------------------------------------------------------------------------
> Stephen M. Smith, Professor of Biomedical Engineering
> Associate Director,  Oxford University FMRIB Centre
> 
> FMRIB, JR Hospital, Headington, Oxford  OX3 9DU, UK
> +44 (0) 1865 222726  (fax 222717)
> [log in to unmask]    http://www.fmrib.ox.ac.uk/~steve
> ---------------------------------------------------------------------------
> 
> 
>