Itk to lta conversion

Is there a way to convert the registration matrix *from-fsnative_to-T1w*_mode-image_xfm.txt to freesurfer’s .lta format?

1 Like

Did you ever figure this out?

Hi @tmorin01 and @mri,

Perhaps this will be useful to you?: https://ftp.nmr.mgh.harvard.edu/pub/docs/html/lta_convert.help.xml.html

Best,
Steven

Thanks Steven! I found that page and was able to get it to work. One note is that the documentation on that page is not entirely up to date. Running convert_lta in the Terminal without any options displays the full documentation. For ANTS itk files (like the xfm.txt files output by fmriprep), there is an additional step required. From the documentation:

EXAMPLE 2
Convert ANTS/ITK transform to LTA (FreeSurfer):

First convert the ANTS binary mat file to ITK text file format and then to lta (adding src and trg geometry info, from images that were used to create the transform in ANTS):

$ANTSPATH/ConvertTransformFile 3 3D_antsAffine.mat 3D_antsAffine.txt

lta_convert --initk 3D_antsAffine.txt --outlta 3D_antsAffine.lta --src src.nii --trg trg.nii
1 Like