Align EPI w/ Brain Lesions to MNI Space Using lesion_align

Hello,

I am trying to align a mean EPI image with brain lesions to MNI space using "lesion_align". Below are the steps that I have tried so far.

lesion_align -input reor_mean_fmri1_brain.nii.gz -base reor_t1_brain.nii.gz -outdir epi_brain_hires_brain -goodside right -maxlev 0

Outputs:
reor_mean_fmri1_brain_shft_at.aff12.1D (affine transformation to the template)
reor_mean_fmri1_brain_shft_at.nii.gz (dataset affine aligned to the template and on the template grid)

reor_mean_fmri1_brain_shft_at.nii.gz aligns well with reor_t1_brain.nii.gz

lesion_align -input reor_t1_brain.nii.gz -base MNI152_T1_2mm_brain.nii.gz -outdir hires_brain_mni_brain -goodside right

Outputs:
reor_t1_brain_shft_at.aff12.1D (affine transformation to the template)
reor_t1_brain_shft_qw_WARP.nii.gz (warp deformations to the template from nonlinear alignment only)
reor_t1_brain_nl.nii.gz (dataset nonlinearly warped to the template)
reor_t1_brain_shft_at.nii.gz (dataset affine aligned to the template and on the template grid)

Both reor_t1_brain_shft_at.nii.gz and reor_t1_brain_nl.nii.gz are aligned with MNI152_T1_2mm_brain.nii.gz

3dNwarpApply -source reor_mean_fmri1_brain.nii.gz -nwarp 'reor_t1_brain_shft_qw_WARP.nii.gz reor_t1_brain_shft_at.aff12.1D reor_mean_fmri1_brain_shft_at.aff12.1D ' -master MNI152_T1_2mm_brain.nii.gz -ainterp cubic -prefix mni_reor_mean_fmri1_brain.nii.gz

mni_reor_mean_fmri1_brain.nii.gz is poorly aligned with MNI152_T1_2mm_brain.nii.gz

Questions

  1. Which lesion_align output image is the fully aligned/warped image (affine + nonlinear)?
  2. What is the recommended procedure for transforming EPI images to MNI using the lesion_align affine transformation and warp files?
  3. Is there a better alternative to transforming EPI and T1 images with brain lesions to MNI space without manually drawing the exclusion lesion mask for each subject?

Thanks,
Eddie

AFNI version info (afni -ver): Precompiled binary linux_rocky_8: Jun 21 2024 (Version AFNI_24.1.22 'Publius Septimius Geta')

Answered via email message already, but posting this here for reference:

The intention of lesion_align is to align an anatomical T1/T2 dataset to a template and for transforming atlases back to the native space of the subject. It is not for aligning EPI and T1 data, which is generally done with align_epi_anat.py or with afni_proc.py within the context of an fmri pipeline. afni_proc.py will take care of the proper transformation order. The nonlinear and affine warps to move the T1 dataset to the template space can be provided as options with afni_proc.py, similarly to the way it's used with sswarper2 or @SSwarper.

lesion_align was developed for the alignment of data with very large lesions, like hemispherectomies, to a template. The "good side" drives the affine transformation. The program is useful for analysis in native space by transforming the atlas regions into the native space, but looking particularly at the good side data. It also has the additional use of providing mirrored, healed brains, so the structural data can be fed back into traditional pipelines, like FreeSurfer.

align_epi_anat.py is limited to affine transformations, so I would try that first for the alignment of epi to anatomical datasets, even with lesions. lesion_align.py might work for that purpose, but you would have to work around the limitations like the nonlinear part, where you used maxlev 0, to minimize that part. If you do want to try, I would mimic the cost functions we typically use for epi-anat alignment - lpc+ZZ, lpc.

If you run into trouble, and you can send example data to me, I could take a look.