Aligning EPI-anat question

Hello,

I am using the afni_proc.py to run preprocessing on my multi-echo task and resting state data. Because it is multi-echo, I used the created files from afni_proc.py (which I kept in native space) to feed into a tedana command as my optimal combination method. My first step before all of this was running @sswarper on my anatomical data for a nonlinear anat-template alignment. I have ran my tedana command and now want to perform an EPI-anat alignment on the optimally combined image to put it in standard space. My align_epi_anat.py command is:
align_epi_anat.py -overwrite -epi2anat -anat anatSS.sub-04.nii -epi pb03.sub-04.r01.combine.MIR_mdl+orig -epi_base MIN_OUTLIER -tlrc_apar anatQQ.sub-04 -volreg off -tshift off -epi_strip 3dAutomask -cost lpc+ZZ -giant_move -cmass cmass

but that only gave me the EPI in native space, which I already have. With all of this context, I have a few questions:

  • for my EPI-anat alignment to standard space, should that be a 12 DOF affine or nonlinear transformation?
  • can I use one of the output matrices from @sswarper to perform my EPI-anat alignment to standard space with 3dAllineate? Or should I stick to align_epi_anat.py?
  • If I should still use align_epi_anat.py, are there any follow up commands i should run to successfully align my EPI data?

I appreciate any feedback. Thank you.

You would probably use afni_proc.py to do the anat to epi alignment and sswarper2 to do the anat to a template alignment. First do the sswarper2 and then follow the examples in afni_proc.py help with the tedana options. The transformations from sswarper2 / @SSwarper / @animal_warper / auto_warp.py can all be fed into afni_proc.py with these options:

            -tlrc_base  MNI152_2009_template_SSW.nii.gz \
            -tlrc_NL_warp                                                    \
            -tlrc_NL_warped_dsets   ssw/anatQQ.sub-005.nii \
                               ssw/anatQQ.sub-005.aff12.1D            \
                               ssw/anatQQ.sub-005_WARP.nii          \

Thank you for your reply. I want to do EPI-anat alignment, not the other way around. I first ran @SSWarper, and then ran my afni_proc.py command, which is:

afni_proc.py                                                                 \
    -subj_id                sub-04                                           \
    -blocks                 tshift align tlrc volreg mask                    \
    -copy_anat              anatSS.sub-04_ses-v1.nii                         \
    -anat_has_skull         no                                               \
    -dsets_me_run           sub-04_task-Emostroop_echo-1_bold.nii.gz         \
                            sub-04_task-Emostroop_echo-2_bold.nii.gz         \
                            sub-04_task-Emostroop_echo-3_bold.nii.gz         \
    -tcat_remove_first_trs  3                                                \
    -align_opts_aea         -cost lpc+ZZ                                     \
                            -giant_move                                      \
                            -check_flip                                      \
    -volreg_align_to        MIN_OUTLIER                                      \
    -volreg_align_e2a                                                        \
    -volreg_compute_tsnr    yes                                              \
    -tlrc_base              MNI152_2009_template_SSW.nii.gz                  \
    -tlrc_NL_warp                                                            \
    -tlrc_NL_warped_dsets   anatQQ.sub-04.nii                                \
                            anatQQ.sub-04.aff12.1D                           \
                            anatQQ.sub-04_WARP.nii                           \
    -mask_epi_anat          yes                                              \
    -html_review_style      pythonic

I want to run the tedana command outside of afni_proc.py because I want to customize it with different flags. So I take the output from my afni_proc.py command and input that into my tedana command. I purposely keep the output of afni_proc.py in native space. After I run my tedana command, I want to align my optimally combined EPI image to the standardized anatomical that was produced from @sswarper - if that is the correct way to perform my EPI-anat transformation. But I am stuck on a few things:

  • do i perform EPI-anat after first-level modeling and before group level?
  • which program to use to do that.

Howdy-

What version of AFNI do you have?

There are ways you can pass tedana options via afni_proc.py, so you could still do this all within an AP command. One example is:

 -combine_opts_tedana 

That would also make it possible to let all the alignment be done properly within AP itself. As your command is run here, your data will end up in final template space. Separating out steps will incur more blurring unnecessarily (as well as more complicated separate scripting). Is that necessary?

I would still include the regress block, because that way you will get the useful APQC HTML report to check various processing features, as described here.

Note that instead of using @SSwarper, you could use the newer sswarper2, that performs similarly in many cases and improvedly in many cases. The usage is pretty much exactly the same between the two programs, certainly with how AP applies outputs.

--pt

I am using version 25.1.11 of AFNI. I would actually prefer to not have various separate scripting, so any insight on how to include everything in one AP command is appreciated!

One reason why I did want to use separate scripts is because I am testing tedana's different PCA methods under the -tedpca flag. The options include mdl, kic, aic, kundu, and kundu-stabilize. I'd like to run them all separately to compare which performs the best regarding the scan and component selection. Is there a way I can include those using combine_opts_tedana? If it is possible, which combine_method do I specify?

Noted about sswarper2, I will apply that.

Hi-

Yes, you can add options for tedana's MEICA using -combine_opts_tedana. For example, you can tell AP to use tedana for MEICA and then pass along the --tedpca aic option to it with:

-combine_method           m_tedana          \
-combine_opts_tedana      --tedpca aic      \

--pt