AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
November 29, 2022 09:31AM
Hi AFNI people!

We have a set of scripts that has served us well before, but we are now analyzing data from another lab and we have problems with the alignment of the EPI onto the anatomy.

Using tips we got from Paul Taylor we prepp our T1: data by first:
3dcopy T1_$subject.nii tmp
3drefit -oblique_recenter tmp+orig
3drefit -deoblique tmp+orig 
3dcopy tmp+orig T1_do_$subject.nii
#3dZeropad -I -70 -prefix T1_do_zp.nii T1_do.nii (these data don't include much neck at all, so we don't clip anything)
3dCM -set 0 0 0 T1_do_$subject.nii

Then we run SSwarper: on the T1_do_$subject.nii
@SSwarper -input T1_do_$subject.nii -base /usr/local/abin/MNI152_2009_template_SSW.nii.gz -subid ${sub_id} -giant_move -deoblique_refitly -odir $startdir/pre_warp_${sub_id}

This looks good. Then we run afni-proc with these relevant settings:
-blocks despike tshift align tlrc volreg blur mask scale regress \
    -copy_anat pre_warp_$sub_id/anatSS.$sub_id.nii \
    -anat_has_skull no \
    -anat_follower anat_w_skull anat $T1_data \
    -dsets $fmri_data \
    -align_opts_aea -ginormous_move -cost lpc+ZZ -check_flip \
    -tlrc_base MNI152_2009_template_SSW.nii.gz \
    -tlrc_NL_warp \
    -tlrc_NL_warped_dsets \
           pre_warp_$sub_id/anatQQ.$sub_id.nii \
           pre_warp_$sub_id/anatQQ.$sub_id.aff12.1D \
           pre_warp_$sub_id/anatQQ.${sub_id}_WARP.nii \
    -volreg_align_to MIN_OUTLIER \
    -volreg_align_e2a \
    -volreg_tlrc_warp \

Normally, this looks good for other data. But here the EPI seem to be way off. There is no other option than ginormous move, so I tried to align centers of epi and anat prior to this and I tried to use 3dAllineate to move the volumes closer to each other prior to afni-proc but did not mange.

@Align_Centers -base temp_T1_$sub_id.nii -dset $fmri_data -no_cp -cm -1Dmat_only
3dAllineate -master temp_T1_$sub_id.nii -1Dmatrix_apply rs-fMRI_shft.1D -prefix test_pre_align -input $fmri_data

This resamples the EPI, whis not what we want and it still does not overlay well when looking at the native space data in the viewer.

I'm attaching the de-oblieq pre/post and alignment maps.
The T1->MNI looks really good, to this must be an alignment issue.

Data quality of EPI? I think it looks good, visually. So it is probably a distance between EPI and T1 issue?
Attaching EPI snap shot as well. (next post)

Thanks in advance!
Attachments:
open | download - align.png (822.7 KB)
open | download - obliqe.png (688.7 KB)
Subject Author Posted

Poor aligment using scripts that have worked before Attachments

Robin November 29, 2022 09:31AM

Re: Poor aligment using scripts that have worked before Attachments

Robin November 29, 2022 09:32AM

Re: Poor aligment using scripts that have worked before

ptaylor November 29, 2022 10:12AM

Re: Poor aligment using scripts that have worked before Attachments

Robin November 30, 2022 07:29AM

Re: Poor aligment using scripts that have worked before

ptaylor November 30, 2022 08:15AM