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  

|
April 11, 2014 11:38AM
Dear AFNI experts,

I have 3 questions pertaining to skullstripping and epi2anat alignment prior to surface-based analyses. My afni_proc.py command and the resulting “align” and “volreg” block scripts are below.

My first two questions are more conceptual (please feel free to point me toward any user/help documentation if you think it can fully answer my question(s)):
1) why does the afni_proc.py command for surfaces put the “align” block before the “volreg” block? This seems unintuitive because I would think you would need to do volume registration across functional runs before aligning the functionals to the anatomical. Is the align block here only calculating the alignment and not actually doing it until the after 3dvolreg? 2) The “align” block also includes the skull stripping step, correct? When does the skull stripped anatomical get used with regards to surface based analyses? If skull stripping fails (i.e., cuts off a chunk of brain) does that impact my surface-based analyses the same way it would a volumetric analysis?

Finally, my third question is practical but related to the above. If I have a participant who’s functional data is not aligning properly to the anatomical data how do I go about fixing that and in what command block? For example, when my functionals get aligned to the anatomy, sometimes they are being aligned improperly, so that the most inferior portions of the occipital regions are not covered by the functionals, which is quite a problem because I am doing retinotopy, as well.

I would greatly appreciate any information you all can give me about these issues.

Thanks in advance,
Kara

I used the following afni_proc.py command to generate my preprocessing script:

afni_proc.py -subj_id p01 -out_dir /Volumes/KaraData/fSIR/p01/p01.results \
-blocks tshift align volreg surf scale \
-copy_anat /Volumes/KaraData/fSIR/p01/struct+orig \
-dsets /Volumes/KaraData/fSIR/p01/WM_run?+orig.HEAD \
/Volumes/KaraData/fSIR/p01/quadlocal_run?+orig.HEAD \
/Volumes/KaraData/fSIR/p01/retinotopy_run?+orig.HEAD \
-surf_anat /Volumes/KaraData/fSIR/p01/fs/SUMA/p01_SurfVol+orig \
-surf_spec /Volumes/KaraData/fSIR/p01/fs/SUMA/std.141.p01_?h.spec \
-volreg_align_to third \
-volreg_align_e2a \

This command gives me the following script for the align and volreg blocks:

# ================================= align ============================
# for e2a: compute anat alignment transformation to EPI registration base
# (new anat will be intermediate, stripped, struct_ns+orig)
align_epi_anat.py –epi2anat -anat struct+orig \
-save_skullstrip -suffix _al_junk \
-epi pb01.$subj.r01.tshift+orig -epi_base 2 \
-epi_strip 3dAutomask \
-volreg off -tshift off

# ================================= volreg ===========================
# align each dset to base volume, align to anat

# create an all-1 dataset to mask the extents of the warp
3dcalc -a pb01.$subj.r01.tshift+orig -expr 1 -prefix rm.epi.all1

# register and warp
foreach run ( $runs )
# register each volume to the base
3dvolreg -verbose -zpad 1 -base pb01.$subj.r01.tshift+orig'[2]' \
-1Dfile dfile.r$run.1D -prefix rm.epi.volreg.r$run \
-cubic \
-1Dmatrix_save mat.r$run.vr.aff12.1D \
pb01.$subj.r$run.tshift+orig

# catenate volreg and epi2anat transformations
cat_matvec -ONELINE \
struct_al_junk_mat.aff12.1D -I \
mat.r$run.vr.aff12.1D > mat.r$run.warp.aff12.1D

# apply catenated xform : volreg and epi2anat
3dAllineate -base struct_ns+orig \
-input pb01.$subj.r$run.tshift+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 struct_ns+orig \
-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+orig
end

# make a single file of registration params
cat dfile.r*.1D > dfile_rall.1D

# compute motion magnitude time series: the Euclidean norm
# (sqrt(sum squares)) of the motion parameter derivatives
1d_tool.py -infile dfile_rall.1D \
-set_run_lengths 264 264 264 264 160 160 120 120 \
-derivative -collapse_cols euclidean_norm \
-write motion_${subj}_enorm.1D

# ----------------------------------------
# create the extents mask: mask_epi_extents+orig
# (this is a mask of voxels that have valid data at every TR)
3dMean -datum short -prefix rm.epi.mean rm.epi.min.r*.HEAD
3dcalc -a rm.epi.mean+orig -expr 'step(a-0.999)' -prefix mask_epi_extents

# and apply the extents mask to the EPI data
# (delete any time series with missing data)
foreach run ( $runs )
3dcalc -a rm.epi.nomask.r$run+orig -b mask_epi_extents+orig \
-expr 'a*b' -prefix pb02.$subj.r$run.volreg
end

# create an anat_final dataset, aligned with stats
3dcopy struct_ns+orig anat_final.$subj
Subject Author Posted

alignment and skull stripping problems for surface analyses

kblacker April 11, 2014 11:38AM

Re: alignment and skull stripping problems for surface analyses

rick reynolds April 14, 2014 04:33PM

Re: alignment and skull stripping problems for surface analyses

kblacker April 17, 2014 04:02PM

Re: alignment and skull stripping problems for surface analyses

Daniel Glen April 23, 2014 11:05AM