Can ANTs Transforms Be Converted/Used with other Software?

This may be a bizarre question. I have just run FMRIPREP and gotten the normal output files, some of which are the .h5 files that make sure the ANTs composite transforms.

I’m not sure how familiar anyone is with AFNI. I’ve never used ANTs for registration before and had never even seen an .h5 file before using FMRIPREP. As an exploratory measure I wanted to use the T1 image in MNI space created from FMRIPREP (since it was amazing) and concatenate that transform with those created by AFNI for the BOLD data (i.e. 3dvolreg for motion correction and align_epi_anat.py for aligning the EPI to the original T1). I have no idea how to access ANYTHING in the .h5 file so just searched blindly until I found this post. Running these commands on my ‘T1w_target-MNI152NLin2009cAsym_warp.h5’ file does indeed give me 12 values that look like a transformation matrix so I used cat_matvec to concatenate this with the .1D files from 3dvolreg and align_epi_anat.py. Although this made sense to me logically the result was basically a vertical line. I suppose my question is, is there any way to use the transformation matrices outputted from FMRIPREP in other analysis softwares? I’m mostly doing this because I was solely an AFNI user before FMRIPREP and as I transition to the latter finding parallels in AFNI’s processing stream for as many steps as possible is helping me teach myself the new pipeline. So I’m really sorry for this bizarre question.

Hi @lhopkins,

This is indeed not a bizarre question. We are currently working on a new transform format that will make it easy to apply and convert transforms generated with different software packages.

That said, it would be actually easier to convert from AFNI’s to ANTs-digestible affine transforms. We are currently working on this in FMRIPREP (see https://github.com/poldracklab/fmriprep/pull/1354).

Then regarding the align_epi_anat.py output, I’d recommend sticking with fMRIPrep’s default (which is bbregister from freesurfer).

Therefore, right now there is no easy way to do what you want without writing quite a bit of code.

Can Convert 3D do this?

http://www.itksnap.org/pmwiki/pmwiki.php?n=Convert3D.Documentation

I don’t think it works with HDF5 transform files, I also think it does not support AFNI’s format, and it does not support displacements fields either. But it is worth noting, we use it at points in fMRIPrep.