align_epi_anat.py: skull strip error

I’m using align_epi_anat.py to align a subject’s anatomical to their resting state epi (for later TMS targeting) but it keeps failing at the skull strip step. Both are deobliqued, and the epi has also been slice time corrected, despiked, and bandpassed.

align_epi_anat.py -anat2epi -anat deobl.MPRAGE+orig -save_orig_skullstrip _strip -suffix _al_junk -epi bp+orig -epi_base 2 -volreg off -tshift off -resample off -ginormous_move -Allineate_opts ‘-warp aff -twofirst’

#++ align_epi_anat version: 1.55
#++ turning off volume registration
#++ turning off resampling
#Script is running:
3dAttribute DELTA /projects/b1033/dervishrs_kw/YA/01DY/AR.results/bp+orig
#Script is running:
3dAttribute DELTA /projects/b1033/dervishrs_kw/YA/01DY/AR.results/bp+orig
#Script is running (command trimmed):
3dAttribute DELTA ./deobl.MPRAGE+orig
#++ Multi-cost is lpc
#++ Removing all the temporary files
#Script is running:
\rm -f ./__tt_bp*
#Script is running:
\rm -f ./__tt_deobl.MPRAGE*
#Script is running (command trimmed):
3dcopy ./deobl.MPRAGE+orig ./__tt_deobl.MPRAGE+orig
++ 3dcopy: AFNI version=AFNI_16.2.12 (Aug 23 2016) [64-bit]
#++ Removing skull from anat data
#Script is running (command trimmed):
3dSkullStrip -orig_vol -input ./__tt_deobl.MPRAGE+orig -prefix ./__tt_deobl.MPRAGE_ns
#Script is running (command trimmed):
3dinfo ./__tt_deobl.MPRAGE_ns+orig | \grep ‘Data Axes Tilt:’|\grep ‘Oblique’
#++ Dataset /projects/b1033/dervishrs_kw/YA/01DY/AR.results/__tt_deobl.MPRAGE_ns+orig is not oblique
#Script is running (command trimmed):
3dinfo ./bp+orig | \grep ‘Data Axes Tilt:’|\grep ‘Oblique’
#++ Dataset /projects/b1033/dervishrs_kw/YA/01DY/AR.results/bp+orig is not oblique
#Script is running (command trimmed):
3dAttribute DELTA ./__tt_deobl.MPRAGE_ns+orig
#++ Spacing for anat to oblique epi alignment is 1.000000
#Script is running (command trimmed):
3dcopy ./__tt_deobl.MPRAGE_ns+orig ./__tt_deobl.MPRAGE_ns_ob; @Align_Centers -base ./bp+orig -dset ./__tt_deobl.MPRAGE_ns_ob+orig -no_cp
++ 3dcopy: AFNI version=AFNI_16.2.12 (Aug 23 2016) [64-bit]
++ 3drefit: AFNI version=AFNI_16.2.12 (Aug 23 2016) [64-bit]
++ Authored by: RW Cox
++ Processing AFNI dataset ./__tt_deobl.MPRAGE_ns_ob+orig
++ 3drefit processed 1 datasets
#Script is running (command trimmed):
cat_matvec ./__tt_deobl.MPRAGE_ns_ob_shft.1D -I > ./__tt_deobl.MPRAGE_ns_shft_I.1D
#++ Creating representative epi sub-brick
#Script is running (command trimmed):
3dbucket -prefix ./__tt_bp_ts ./bp+orig’[2]’
++ 3dbucket: AFNI version=AFNI_16.2.12 (Aug 23 2016) [64-bit]
#++ removing skull or area outside brain
#Script is running (command trimmed):
3dSkullStrip -orig_vol -input ./__tt_bp_ts+orig -prefix ./__tt_bp_ts_ns

Fatal Signal 11 (SIGSEGV) received
SUMA_SurfGridIntersect
SUMA_FindVoxelsInSurface
3dSkullStrip
Bottom of Debug Stack
** AFNI version = AFNI_16.2.12 Compile date = Aug 23 2016
** [[Precompiled binary linux_openmp_64: Aug 23 2016]]
** Program Death **
** If you report this crash to the AFNI message board,
** please copy the error messages EXACTLY, and give
** the command line you used to run the program, and
** any other information needed to repeat the problem.
** You may later be asked to upload data to help debug.
** Memory usage: chunks=245 bytes=61699156
** ERROR: Could not strip skull

** ERROR - script failed

Hmm, that’s odd. What are the outputs of:

$ afni -ver

$ afni_system_check.py -check_all

?

–pt

afni -ver
Precompiled binary linux_openmp_64: Aug 23 2016 (Version AFNI_16.2.12)

afni_system_check.py -check_all

-------------------------------- general ---------------------------------
architecture: 64bit ELF
system: Linux
release: 2.6.32-504.16.2.el6.x86_64
version: #1 SMP Tue Mar 10 17:01:00 EDT 2015
distribution: Red Hat Enterprise Linux Server 6.4 Santiago
number of CPUs: 20
apparent login shell: bash (current shell is tcsh)
shell RC file: .tcshrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /projects/b1033/abin/afni
afni version : Precompiled binary linux_openmp_64: Aug 23 2016
AFNI_version.txt : AFNI_16.2.12, linux_openmp_64, Aug 23 2016
which python : /software/anaconda2/bin/python
python version : 2.7.12
which R : /software/R/3.2.2/bin/R
R version : R version 3.2.2 (2015-08-14) – “Fire Safety”
which tcsh : /bin/tcsh

instances of various programs found in PATH:
afni : 1 (/projects/b1033/abin/afni)
R : 1 (/hpc/software/R/3.2.2/bin/R)
python : 2
/hpc/software/anaconda2/bin/python2.7
/usr/bin/python

testing ability to start various programs…
afni : success
suma : success
3dSkullStrip : success
uber_subject.py : success
3dAllineate : success
3dRSFC : success
SurfMesh : success

checking for R packages…
rPkgsInstall -pkgs ALL -check : FAILURE

    oo Warning: 
       These packages are not installed on the computer: afex!
    These packages are not installed on the computer: phia!

checking for $HOME files…
.afnirc : missing
.sumarc : missing
.afni/help/all_progs.COMP : missing

------------------------------ python libs -------------------------------
++ module ‘PyQt4’ found at /software/anaconda2/lib/python2.7/site-packages/PyQt4
++ module loaded: PyQt4

-------------------------------- env vars --------------------------------
PATH = /software/R/3.2.2/bin:/software/mpi/openmpi-1.6.3-gcc-4.6.3-trq4/bin:/hpc/software/gcc/4.6.3-rhel6/bin:/software/anaconda2/bin:/usr/lib64/qt-3.3/bin:/opt/moab7/bin:/opt/moab7/sbin:/opt/mam/bin:/opt/mam/sbin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/lpp/mmfs/bin:/opt/ibutils/bin:/opt/torque6/bin:/opt/torque6/sbin:/home/knw051/bin:/projects/b1033/abin:/usr/lpp/mmfs/bin:/opt/torque/bin:/opt/torque/sbin:/projects/b1033/abin

PYTHONPATH =
R_LIBS =
LD_LIBRARY_PATH = /software/mpi/openmpi-1.6.3-gcc-4.6.3-trq4/lib64:/hpc/software/gcc/4.6.3-rhel6/lib:/hpc/software/gcc/4.6.3-rhel6/lib64

DYLD_LIBRARY_PATH =
DYLD_FALLBACK_LIBRARY_PATH =

------------------------------ data checks -------------------------------
data dir : missing AFNI_data6
data dir : missing suma_demo
data dir : missing FATCAT_DEMO
data dir : missing afni_handouts
atlas : found TT_N27+tlrc under /projects/b1033/abin

------------------------------ OS specific -------------------------------
which yum : /usr/bin/yum
yum version : 3.2.29

============================ summary comments ============================

  • login shell ‘bash’, trusting user to translate from ‘tcsh’
  • missing R packages (see rPkgsInstall)
  • consider running: cp /projects/b1033/abin/AFNI.afnirc ~/.afnirc
  • consider running “suma -update_env” for .sumarc
  • consider running: apsearch -update_all_afni_help
  • insufficient data for AFNI bootcamp

That’s odd that the 3dSkullStrip comes up fine in that system check. I had been wondering if you didn’t have GSL on your computer.

When putting AFNI on your computer, did you follow these steps (but I guess skipping the R part, from how your system build looks)? https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/background_install/install_instructs/steps_linux_Fed_RH.html

If not, you could try the following from step 1:


sudo yum install -y tcsh libXp openmotif gsl xorg-x11-fonts-misc       \
                    PyQt4 R-devel netpbm-progs gnome-tweak-tool ed     \
                    libpng12
sudo yum update -y

If all of that was done and you still have your error, you could upload your data set here:
https://afni.nimh.nih.gov/sscc/upload

and I can take a look.

–pt

It looks like 3dSkullStrip worked okay for the anatomical dataset but failed on the EPI dataset. So instead of using 3dSkullStrip for stripping the EPI, use 3dAutomask with this option “-epi_strip 3dAutomask” .