Hi Josh,
Thank you for your interest in SynthMorph. FreeSurfer includes the tool `mri_warp_convert` for converting between deformation field formats.
To convert to LPS displacements (ITK/ANTs format), you can use the following command:
mri_warp_convert --inmgzwarp synthmorph.nii.gz --outitk ants.nii.gz
For FSL, there is a similar flag:
mri_warp_convert --inmgzwarp synthmorph.nii.gz --outfsl fsl.nii.gz
When you initialize the deformable registration with an affine transform, that transform will be included in the output warp as is. However, joint registration (and, similarly, initialized deformable registration with `-M`) applies half the affine before and the other half after the deformation to ensure end-to-end symmetry.
This means the warp lives in an affine mid-space that includes shear, and we're currently exploring the best way to save it.
I hope this helps, Malte
________________________________________ From: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu on behalf of Josh nimzodisaster@gmail.com Sent: Wednesday, December 11, 2024 18:50 To: Freesurfer support list Subject: [Freesurfer] needed: tools to work with synthmorph deformations in ANTS and FSL pipelines.
External Email - Use Caution
mri_synthmorph is simply an amazing SOTA tool that I want to incorporate into all my pipelines. However, I am unsure how to convert the combined affine+nonlinear deformation image into a format that can be worked with by ants or FSL.
Optimally, synthmorph + lta_convert + mri_convert would provide tools to: 1. separate affine and nonlinear components of the registration (useful in certain applications) 2. convert freesurfer transforms to current standard formats (FSL and ITK ants)
-Josh