AFNI crashes on switch to TLRC view

AFNI program is crashing when I toggle from Original to Talairach View.

I loaded an anatomical dataset that was preprocessed using align_epi_anat.py and @auto_tlrc (commands below). The three views load in original view and the brain looks normal. When I click Talairach View, the program crashes. The terminal output for the crash is pasted below the AFNI commands. If I load only the target dataset using: afni 1000p.T1_ns+tlrc , then the TLRC dataset loads just fine. So it appears to be an issue with toggling between the two views.

Any ideas?

align_epi_anat.py -anat2epi -anat $subj.$anat+orig
-epi $subj.$run1.tshift+orig -epi_base 2
-save_skullstrip -suffix _al_junk
-epi_strip 3dAutomask
-volreg off -tshift off

@auto_tlrc -base TT_N27+tlrc -input $subj.${anat}_ns+orig -no_ss

Fatal Signal 11 (SIGSEGV) received
AFNI_autorange_label
AFNI_reset_func_range
AFNI_setup_viewing
AFNI_initialize_view
AFNI_switchview_CB
new_MCW_bbox_cbwrap
AFNI:main
Bottom of Debug Stack
** AFNI version = AFNI_19.3.12 Compile date = Nov 8 2019
** [[Precompiled binary macos_10.12_local: Nov 8 2019]]
** 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.
** Crash log is appended to file /Users/cnalab/.afni.crashlog

This might be due to an unset DYLD_LIBRARY_PATH. What is the output from:

afni_system_check.py -check_all

  • rick

Thanks Rick, here is the output:

Michaels-iMac-2:1000p cnalab$ afni_system_check.py -check_all
-------------------------------- general ---------------------------------
architecture: 64bit
system: Darwin
release: 18.7.0
version: Darwin Kernel Version 18.7.0: Sun Dec 1 18:59:03 PST 2019; root:xnu-4903.278.19~1/RELEASE_X86_64
distribution: 10.14.6 x86_64
number of CPUs: 6
apparent login shell: bash
shell RC file: .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /Users/cnalab/abin/afni
afni version : Precompiled binary macos_10.12_local: Nov 8 2019
: AFNI_19.3.12 ‘Nero’
AFNI_version.txt : AFNI_19.3.12, macos_10.12_local, Nov 08 2019
which python : /usr/bin/python
python version : 2.7.16
which R : /usr/local/bin/R
R version : R version 3.5.3 (2019-03-11) – “Great Truth”
which tcsh : /bin/tcsh

instances of various programs found in PATH:
afni : 1 (/Users/cnalab/abin/afni)
R : 1 (/Library/Frameworks/R.framework/Versions/3.5/Resources/bin/R)
python : 1 (/usr/bin/python)
python2 : 0
python3 : 1 (/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/bin/python3.7)

** have python3 but not python2

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

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

R RHOME : /Library/Frameworks/R.framework/Resources

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

------------------------------ python libs -------------------------------
** failed to load module PyQt4
– PyQt4 is no longer needed for an AFNI bootcamp

++ module loaded: matplotlib.pyplot
module file : /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/pyplot.pyc

– python binaries under /usr/local/bin:
/usr/local/bin/python3 (sym link to /usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/bin/python3.7)
/usr/local/bin/python3.7 (sym link to /usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/bin/python3.7)

-------------------------------- env vars --------------------------------
PATH = /usr/local/fsl/bin:/Applications/freesurfer/bin:/Applications/freesurfer/fsfast/bin:/Applications/freesurfer/tktools:/usr/local/fsl/bin:/Applications/freesurfer/mni/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/cnalab/abin:/Applications/workbench/bin_macosx64

PYTHONPATH =
R_LIBS =
LD_LIBRARY_PATH =
DYLD_LIBRARY_PATH (sub-shell) = /Applications/freesurfer/lib/gcc/lib::/opt/X11/lib/flat_namespace
DYLD_FALLBACK_LIBRARY_PATH (sub-shell) =

------------------------------ data checks -------------------------------
data dir : missing AFNI_data6
data dir : missing AFNI_demos
data dir : missing suma_demo
data dir : missing afni_handouts
atlas : found TT_N27+tlrc under /Users/cnalab/abin

------------------------------ OS specific -------------------------------
XQuartz version : 2.7.11

which brew : /usr/local/bin/brew
brew version : Homebrew 2.2.4

++ found PyQt4 under /usr/local/lib/python2.7/site-packages
** warning: have brew? PyQt4, but non-brew python /usr/bin/python
– consider installing gcc under homebrew
– consider installing glib under homebrew
++ found 1 dylib files under ‘/opt/X11/lib/flat_namespace’
– found ‘libXt’ dylib files:
/opt/X11/lib/flat_namespace/libXt.6.dylib
– recent OS X, cheating to check DYLD_LIBRARY_PATH in cur shell ‘bash’…
++ found evar DYLD_LIBRARY_PATH = /Applications/freesurfer/lib/gcc/lib::/opt/X11/lib/flat_namespace
– recent OS X, cheating to check DYLD_LIBRARY_PATH in shell ‘tcsh’…
++ found evar DYLD_LIBRARY_PATH = /opt/X11/lib/flat_namespace

========================= summary, please fix: =========================

  • login shell ‘bash’, trusting user to translate code examples from ‘tcsh’
  • shell bash: consider sourcing (non-login) .bashrc from (login) .bash_profile
  • insufficient data for AFNI bootcamp
  • consider adding /usr/local/lib/python2.7/site-packages to PYTHONPATH
  • have brew? PyQt4, but non-brew python /usr/bin/python

That output seems to look okay. Can you try 2 more things?

  1. Run afni in a new directory, and see if the problem persists, e.g.
afni ~cnalab/abin
  1. Start a new shell, and try afni again, e.g.
bash
<and from there...>
afni

Do both of those crash in tlrc view?

Thanks,

  • rick

I’ll let you know. I might also do a clean install of AFNI and X11.

Hi Rick,
Neither of those solutions works. AFNI still crashes when switching from orig to tlrc view.

I’m thinking of doing a wipe of AFNI and x11 and reinstalling?

Can we do one more test? It might be nice to be sure there isn’t a corresponding library in the Freesurfer directory, too.
Go to some data and run afni, being sure that variable is set and run:


ls -l /Applications/freesurfer/lib/gcc/lib/libXt*
DYLD_LIBRARY_PATH=/opt/X11/lib/flat_namespace afni

Thanks,

  • rick

Hi Rick,
Sorry, but still crashing.

the ls command returns No Match

I checked the value for $DYLD_LIBRARY_PATH, and this is what I see:

/Applications/freesurfer_dev/lib/gcc/lib::/opt/X11/lib/flat_namespace:/opt/X11/lib/flat_namespace

Clean wipe and re-install both afni and X11, problem still happening. I’m at a loss on what to try next.

I also confirmed that this is not specific to any one dataset – I pulled a random T1 from another study and transformed to tlrc using @auto_tlrc. Then when I open in AFNI, the orig view loads first, as soon as I click Talairach View the program crashes.

With the clean install, here is afni_system_check.py:

[Michaels-iMac-2:~] cnalab% afni_system_check.py -check_all
-------------------------------- general ---------------------------------
architecture: 64bit
system: Darwin
release: 18.7.0
version: Darwin Kernel Version 18.7.0: Sun Dec 1 18:59:03 PST 2019; root:xnu-4903.278.19~1/RELEASE_X86_64
distribution: 10.14.6 x86_64
number of CPUs: 6
apparent login shell: csh
shell RC file: .cshrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /Users/cnalab/abin/afni
afni version : Precompiled binary macos_10.12_local: Jan 29 2020
: AFNI_20.0.04 ‘Galba’
AFNI_version.txt : AFNI_20.0.04, macos_10.12_local, Jan 29 2020
which python : /usr/bin/python
python version : 2.7.16
which R : /usr/local/bin/R
R version : R version 3.5.3 (2019-03-11) – “Great Truth”
which tcsh : /bin/tcsh

instances of various programs found in PATH:
afni : 1 (/Users/cnalab/abin/afni)
R : 1 (/Library/Frameworks/R.framework/Versions/3.5/Resources/bin/R)
python : 1 (/usr/bin/python)
python2 : 0
python3 : 1 (/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/bin/python3.7)

** have python3 but not python2

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

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

R RHOME : /Library/Frameworks/R.framework/Resources

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

------------------------------ python libs -------------------------------
** failed to load module PyQt4
– PyQt4 is no longer needed for an AFNI bootcamp

++ module loaded: matplotlib.pyplot
module file : /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/pyplot.pyc

– python binaries under /usr/local/bin:
/usr/local/bin/python3 (sym link to /usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/bin/python3.7)
/usr/local/bin/python3.7 (sym link to /usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/bin/python3.7)

-------------------------------- env vars --------------------------------
PATH = /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/cnalab/abin

PYTHONPATH =
R_LIBS =
LD_LIBRARY_PATH =
DYLD_LIBRARY_PATH (sub-shell) = /opt/X11/lib/flat_namespace
DYLD_FALLBACK_LIBRARY_PATH (sub-shell) =

------------------------------ data checks -------------------------------
data dir : missing AFNI_data6
data dir : missing AFNI_demos
data dir : missing suma_demo
data dir : missing afni_handouts
atlas : found TT_N27+tlrc under /Users/cnalab/abin

------------------------------ OS specific -------------------------------
XQuartz version : 2.7.11

which brew : /usr/local/bin/brew
brew version : Homebrew 2.2.4

++ found PyQt4 under /usr/local/lib/python2.7/site-packages
** warning: have brew? PyQt4, but non-brew python /usr/bin/python
– consider installing gcc under homebrew
– consider installing glib under homebrew
++ found 1 dylib files under ‘/opt/X11/lib/flat_namespace’
– found ‘libXt’ dylib files:
/opt/X11/lib/flat_namespace/libXt.6.dylib
– recent OS X, cheating to check DYLD_LIBRARY_PATH in cur shell ‘csh’…
++ found evar DYLD_LIBRARY_PATH = /opt/X11/lib/flat_namespace

========================= summary, please fix: =========================

  • insufficient data for AFNI bootcamp

What confuses me most is this is essentially a brand new iMac out of the box. AFNI works fine on my macbook and I confirmed today that I have the current binaries on both. I removed freesurfer from the iMac and rebooted, confirmed that the $DTLD path was set properly, and it still crashes. It seems to run just fine with all of the other AFNI things I try, its just this switch to TLRC view.

All is not lost… I am not entirely sure why this worked, but I went back to the raw DICOM files for the participant in question and rebuilt the afni files. Ran the preprocessing again and it appears to work. I have no idea what was going on with that one dataset, but there was clearly something wrong with the autorange in a previous iteration.

I’ll keep you in the loop if it happens again

That is good to hear, I was actually going to start asking about the data.

If there might be a particular dataset that causes trouble, it would be great if you could upload it, so I could take a look. Please let me know if that is okay and I can PM you with instructions.

Thanks for the update,

  • rick