Erros after updating afni and XQuartz on Mac high sierra

Hi experts,

I’ve used afni on MAC (high sierra 10.13.6) without any problem except for a function “@SUMA_Make_Spec_FS”.
So I searched a similar case that I’ve gone through and I updated afni with this command:
@update.afni.binaries -defaults -package macos_10.12_local
But it required the latest XQuartz, so I updated XQuartz as 2.7.11. Updating afni was done (it said ‘no update needed’ at the end of processing) after updating XQuartz, but now I can’t open the afni GUI window when I enter ‘afni’ or ‘afni&’ on a terminal.

I got these messages when I entered afni:
#################
Precompiled binary macos_10.12_local: Aug 29 2019 (Version AFNI_19.2.21 ‘Claudius’)

** Version check disabled: AFNI_VERSION_CHECK forbids
Thanks go to H Garavan for useful feedback

Initializing: X11++ AFNI is detached from terminal.
#################

And I get these messages when I entered ‘afni_system_check.py -check_all’:
################
-------------------------------- general ---------------------------------
architecture: 64bit
system: Darwin
release: 17.7.0
version: Darwin Kernel Version 17.7.0: Wed Apr 24 21:17:24 PDT 2019; root:xnu-4570.71.45~1/RELEASE_X86_64
distribution: 10.13.6 x86_64
number of CPUs: 4
apparent login shell: bash
shell RC file: .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /Users/minsunpark/abin/afni
afni version : Precompiled binary macos_10.12_local: Aug 29 2019
: AFNI_19.2.21 ‘Claudius’
AFNI_version.txt : AFNI_19.2.21, macos_10.12_local, Aug 29 2019
which python : /usr/local/bin/python
python version : 2.7.14
which R : /usr/local/bin/R
R version : R version 3.3.1 (2016-06-21) – “Bug in Your Hair”
which tcsh : /bin/tcsh

instances of various programs found in PATH:
afni : 1 (/Users/minsunpark/abin/afni)
R : 1 (/Library/Frameworks/R.framework/Versions/3.3/Resources/bin/R)
python : 2
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
/usr/bin/python
python2 : 1 (/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7)
python3 : 1 (/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6)

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 : FAILURE

    oo Warning: 
       These packages are not installed on the computer: brms!
    These packages are not installed on the computer: corrplot!
    These packages are not installed on the computer: metafor!

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

** failed to load module matplotlib.pyplot
– matplotlib.pyplot is not required, but is desirable

python binaries under /sw/bin:
/sw/bin/python (sym link to /sw/bin/python2.7)
/sw/bin/python2.7

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

PYTHONPATH =
R_LIBS =
LD_LIBRARY_PATH =
DYLD_LIBRARY_PATH = /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/minsunpark/abin

------------------------------ OS specific -------------------------------
which brew : /usr/local/bin/brew
brew version : Homebrew 1.8.5

++ found PyQt4 under /usr/local/lib/python2.7/site-packages
++ found valid link /usr/local/lib/libgomp.1.dylib
to /usr/local/Cellar/gcc/5.3.0/lib/gcc/5/libgomp.1.dylib
++ found valid link /usr/local/lib/libglib-2.0.dylib
to …/Cellar/glib/2.46.2/lib/libglib-2.0.dylib
++ found 1 dylib files under ‘/opt/X11/lib/flat_namespace’
– found ‘libXt’ dylib files:
/opt/X11/lib/flat_namespace/libXt.6.dylib
++ yay, env var DYLD_LIBRARY_PATH contains /opt/X11/lib/flat_namespace

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

  • login shell ‘bash’, trusting user to translate code examples from ‘tcsh’
  • missing R packages (see rPkgsInstall)
  • insufficient data for AFNI bootcamp
  • consider adding /usr/local/lib/python2.7/site-packages to PYTHONPATH
    ###################

Plus, I saw a message like adding this ‘DYLD_LIBRARY_PATH contains /opt/X11/lib/flat_namespace’ to startup file.

I’d appreciate if you give any suggestions I can do!!!
Thank you very much!

Oops, I changed bash to tcsh, then afni gui popped up!

But I have another question. When I was using @SUMA_Make_Spec_FS, it seemed something is processed but suddenly it aborted. This error is still not fixed after updating afni and xquartz.

@SUMA_Make_Spec_FS returns like below:
###############
writing to /Volumes/M.Park/fMRI_MAE_MVPA/Latest_MAE_fMRI/060717KHW/T1_MPRAGE_SAG_1_0ISO_0006/RetResult/./SUMA/wm.seg.nii…
– running ‘mris_convert lh.smoothwm lh.smoothwm.asc’
Abort
dyld: lazy symbol binding failed: Symbol not found: ___emutls_get_address
Referenced from: /Applications/freesurfer/bin/…/lib/gcc/lib/libgomp.1.dylib
Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ___emutls_get_address
Referenced from: /Applications/freesurfer/bin/…/lib/gcc/lib/libgomp.1.dylib
Expected in: /usr/lib/libSystem.B.dylib

dyld: lazy symbol binding failed: Symbol not found: ___emutls_get_address
Referenced from: /Applications/freesurfer/bin/…/lib/gcc/lib/libgomp.1.dylib
Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ___emutls_get_address
Referenced from: /Applications/freesurfer/bin/…/lib/gcc/lib/libgomp.1.dylib
Expected in: /usr/lib/libSystem.B.dylib

Abort
c_ras: Subscript out of range.
c_ras: Subscript out of range.
#################

How can I fix this?

Thanks,
MS

Hi MS,

It is a good idea to get PATH things set up in both shells. There was no clear problem shown when running afni_system_check.py from bash, or afni for that matter. The screen output from afni looked fine. What actually happened?

In any case, these errors under @SUMA_Make_Spec_FS show problems with the setup of FreeSurfer. mris_convert does not seem to be able to run (at least from tcsh). What is the output of:

mris_convert --help

  • rick

Hi Rick
Thanks for your kind response!
I set the PATH thing also in bash shell as you recommanded! Many thanks!

Probably I should ask this issue from @SUMA_Make_Spec_FS to Freesurfer, but if there are any suggestions you can give I’d also happy about that!
The output of ‘mri_convert --help’ is
############
bash-3.2$ mris_convert --help
Usage: mris_convert [options]

This program will convert MRI-surface data formats.

Valid options are:
-p input is a patch, not a full surface
-c input is scalar curv overlay file (must still
specify surface)
-f input is functional time-series or other
multi-frame data (must specify surface)
–annot input is annotation or gifti label data
–parcstats infile is name of text file containing
label/val pairs, where label is an annot name
and val is a value associated with that label.
The output file will be a scalar file.
–da_num if input is gifti, ‘num’ specifies which
data array to use
–label infile is .label file
label is name of this label
–labelstats outfile is name of gifti file
to which label stats will be written
-o origname read orig positions
-s scale scale vertex xyz by scale
-r rescale vertex xyz so total area is
same as group average
-t subject apply talairach xfm of subject to
vertex xyz
-n output is an ascii file where vertex data
is the surface normal vector
-v Writes out neighbors of a vertex in each row. The first
column is the vertex number, the 2nd col is the number of neighbors,
the remaining cols are the vertex numbers of the neighbors.
Note: there can be a different number of neighbors for each vertex.
-a Print only surface xyz to ascii file
–combinesurfs
–delete-cmds : delete command lines in surface
–userealras : set the useRealRAS flag in the surface file to 1
–vol-geom MRIVol : use MRIVol to set the volume geometry
–to-scanner : convert coordinates from native FS (tkr) coords to scanner coords
–to-tkr : convert coordinates from scanner coords to native FS (tkr) coords
–volume ?h.white ?h.pial ?h.volume : compute vertex-wise volume, no other args needed
Note: --cras_add and --cras_subtract are depricated. They are included for backwards compatability
Use --to-tkr and --to-scanner instead
–cras_add : shift center to scanner coordinate center (was --cras_correction, which still works)
–cras_subtract : shift center from scanner coordinate center (reverses --cras_add)

These file formats are supported:
ASCII: .asc
ICO: .ico, .tri
GEO: .geo
STL: .stl
VTK: .vtk
GIFTI: .gii
MGH surface-encoded ‘volume’: .mgh, .mgz
Freesurfer binary format assumed for all other extensions.

EXAMPLES:

Convert a surface file to ascii:
mris_convert lh.white lh.white.asc

Write vertex neighbors to ascii:
mris_convert -v lh.white lh.white.neighbors.asc

Convert a surface file to ascii (vertices are surface normals):
mris_convert -n lh.white lh.white.normals.asc

Apply talairach xfm to white surface, save as binary:
mris_convert -t bert lh.white lh.white.tal

Convert a scalar overlay file to ascii:
mris_convert -c lh.thickness lh.white lh.thickness.asc

Convert a .annot file to Gifti label file:
mris_convert --annot lh.aparc.annot lh.white lh.aparc.gii

Convert a Gifti label file to .annot:
mris_convert --annot lh.aparc.gii lh.white.gii lh.aparc.annot

Convert a Freesurfer .label file to Gifti label format:
mris_convert --label lh.V1.label V1 lh.white lh.V1.label.gii

Create a scalar overlay file where each parcellation region
contains a single value:
mris_convert --annot lh.aparc.annot --parcstats lh.parcstats.txt\
lh.white lh.parcstats

See also mri_surf2surf
#########################

Thank you very much!
MS

Hi,
I emailed freesurfer team with the issue and I fixed the problem of @SUMA_Make_Spec_FS.
I updated freesurfer as recommended in this link:
https://mail.nmr.mgh.harvard.edu/pipermail//freesurfer/2018-July/057809.html

Hope this help to anyone who is in trouble with the same issue!

It’s good to know you have resolved it, though I wonder if you just needed to “source” the proper SetUpFreeSurfer.*sh, since the output of “mris_convert --help” looked okay. So maybe bash was properly set up, but not tcsh (which SUMA_Make_Spec_FS uses).

Anyway, thanks for the update!

  • rick

Hi MS,

I have added an -fs_setup option to @SUMA_Make_Spec_FS. Given the $FREESURFER_HOME is set, it will source $FREESURFER_HOME/SetUpFreeSurfer.csh from within @SUMA_Make_Spec_FS, so that it is not necessary to automatically source it from .cshrc, every time a new shell/script is started.

  • rick