coregistration issues

Hello, just want to preface this post by saying that I am very new to AFNI and fMRI data processing in general so if I omit any relevant information to my question then please let me know and ill do my best to provide the information.

That said, I am having issues with coregistration of my individual subjects that are propagating into group analyis. Specifically I am having voxels that are part of larger clusters appearing outside of the anatomical brain volume. The degree of this problem varies from subject to subject but also continues and worsens as I do group analysis. The attached images, (example, a single subject) and (example3, from group analysis) illustrate the problem I am having. My initial preprocessing involved consolidating the dicom files and deobliquing the epi files. After applying the 3dWarp deoblique process there was still some pretty poor alignments so I used the nudge function to provide as best a fit as I could manage. From there I created my processing script, which is utilizing the Lpc-ZZ cost function as it so far has provided the best results by a good margin. functions like giant and ginourmous move have provided worse results with both the original obliqued EPI’s and deobliqued EPI’s. Here are portions of the script that has proved best so far.
align: -anat2epi -anat ${subj}_anat_nudge+orig
-save_skullstrip -suffix _al_junk
-epi vr_base_min_outlier+orig -epi_base 0
-epi_strip 3dAutomask
-cost lpc+ZZ
-volreg off -tshift off

@auto_tlrc -base TT_N27+tlrc -input ${subj}_anat_nudge_ns+orig -no_ss

store forward transformation matrix in a text file

cat_matvec ${subj}_anat_nudge_ns+tlrc::WARP_DATA -I > warp.anat.Xat.1


verify that we have a +tlrc warp dataset

if ( ! -f {subj}_anat_nudge_ns+tlrc.HEAD ) then echo "** missing +tlrc warp dataset: {subj}_anat_nudge_ns+tlrc.HEAD"

register and warp

foreach run ( $runs )
# register each volume to the base
3dvolreg -verbose -zpad 1 -base vr_base_min_outlier+orig
-1Dfile dfile.r$run.1D -prefix rm.epi.volreg.r$run
-1Dmatrix_save mat.r$run.vr.aff12.1D

# create an all-1 dataset to mask the extents of the warp
3dcalc -overwrite -a pb00.$subj.r$run.tcat+orig -expr 1     \
       -prefix rm.epi.all1

# catenate volreg/epi2anat/tlrc xforms
cat_matvec -ONELINE                                         \
           ${subj}_anat_nudge_ns+tlrc::WARP_DATA -I            \
           ${subj}_anat_nudge_al_junk_mat.aff12.1D -I          \
           mat.r$run.vr.aff12.1D > mat.r$run.warp.aff12.1D

# apply catenated xform: volreg/epi2anat/tlrc
3dAllineate -base ${subj}_anat_nudge_ns+tlrc                   \
            -input pb00.$subj.r$run.tcat+orig               \
            -1Dmatrix_apply mat.r$run.warp.aff12.1D         \
            -mast_dxyz 3                                    \
            -prefix rm.epi.nomask.r$run

# warp the all-1 dataset for extents masking 
3dAllineate -base ${subj}_anat_nudge_ns+tlrc                   \
            -input rm.epi.all1+orig                         \
            -1Dmatrix_apply mat.r$run.warp.aff12.1D         \
            -mast_dxyz 3 -final NN -quiet                   \
            -prefix rm.epi.1.r$run

# make an extents intersection mask of this run
3dTstat -min -prefix rm.epi.min.r$run rm.epi.1.r$run+tlrc


make a single file of registration params

cat dfile.r*.1D > dfile_rall.1D

Would love to hear some feedback on what could improve what I am doing, as I said Im very new to this. Thanks in advance and please let me know if any information I left out could help further.



It’s hard to say if that cluster is reasonable without knowing anything about the threshold here. If you handle obliquity outside this script, then you should turn off obliquity handling inside the alignment command with “-deoblique off”. Still, it’s probably better to do this all in one transformation to avoid multiple interpolation steps. The giant or ginormous move may be useful then without the deobliquing. If you like, you can upload some data to me. It may take a little while and a reminder to get back to you though. We will be busy with an AFNI bootcamp next week. I’ll PM you instructions.