Cannot run 3dSkullStrip

Hi AFNI experts,

I ran into an error when using align_epi_anat.py. Specifically, it's with 3dSkullStrip. I ran into the same problem with 3dSkullStrip when I run the example scriptd in AFNI_data6. Below is the error message:


#++ Removing skull from anat data

#Script is running (command trimmed):

3dSkullStrip -orig_vol -input ./__XXXX+orig -prefix ./__XXXX_ns

** ERROR: Could not strip skull


My afni version is Version AFNI_23.3.02 'Septimius Severus'. I am running it on macOS Ventura 13.6 (M2 chip).

Thank you in advance!

1 Like

Can you post the output of this command?

afni_system_check.py -check_all

Yes. Here it is:

-------------------------------- general ---------------------------------
architecture: 64bit
cpu type: arm
system: Darwin
release: 22.6.0
version: Darwin Kernel Version 22.6.0: Fri Sep 15 13:41:28 PDT 2023; root:xnu-8796.141.3.700.8~1/RELEASE_ARM64_T6020
distribution: 13.6
number of CPUs: 12
apparent login shell: zsh (current shell is csh)
shell RC file: .tcshrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /Users/xl1549/abin/afni
afni version : Precompiled binary macos_13_ARM_clang: Oct 23 2023
: AFNI_23.3.02 'Septimius Severus'
AFNI_version.txt : AFNI_23.3.02, macos_13_ARM_clang, Oct 23 2023, build
which python : /opt/homebrew/opt/python/libexec/bin/python
python version : 3.11.6
which R : /usr/local/bin/R
R version : R version 4.3.1 (aarch64-apple-darwin20)

instances of various programs found in PATH:
afni : 1 (/Users/xl1549/abin/afni)
R : 1 (/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/bin/R)
python : 1 (/opt/homebrew/Cellar/python@3.11/3.11.6/Frameworks/Python.framework/Versions/3.11/bin/python3.11)
python2 : 0
python3 : 2
/opt/homebrew/Cellar/python@3.11/3.11.6/Frameworks/Python.framework/Versions/3.11/bin/python3.11
/usr/bin/python3

** have python3 but not python2
testing ability to start various programs...
afni : success
suma : success
3dSkullStrip : success
3dAllineate : success
3dRSFC : success
SurfMesh : success
3dClustSim : success
uber_subject.py : success
3dMVM : success

------------------------ dependent program tests -------------------------
checking for dependent programs...

which tcsh : /bin/tcsh
which Xvfb : /opt/X11/bin/Xvfb

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

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

------------------------------ python libs -------------------------------

++ module loaded: matplotlib.pyplot
module file : /opt/homebrew/lib/python3.11/site-packages/matplotlib/pyplot.py
matplotlib version : 3.8.0

-------------------------------- env vars --------------------------------
PATH = /opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/homebrew/opt/python/libexec/bin:/Users/xl1549/abin:/Users/xl1549/abin

PYTHONPATH =
R_LIBS = /Users/xl1549/sw/R-4.3.1

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

----------------------------- eval dot files -----------------------------

----------- AFNI $HOME files -----------

.afnirc                   : found
.sumarc                   : found
.afni/help/all_progs.COMP : found

--------- shell startup files ----------

-- good: .tcshrc seems to contain 'source .cshrc'
-- considered operations: path, apsearch

-- note: followers should not need edits, so edit flags should be 0
(have 1 follower(s), which can be ignored)

no modifications needed across 3 dot files

------------------------------ data checks -------------------------------
data dir : found AFNI_data6 under $HOME (471482M Avail)
top history: ... [gangc]: redo 0.BGA as 1.bga and update run.MSS.txt
data dir : found AFNI_demos under $HOME
top history: ...ct 2020 [taylorp]: updated scripts under FATCAT_DEMO
data dir : found suma_demo under $HOME
top history: ...s_New/data/Build_tmp on Mon Mar 4 11:56:45 EST 2013
data dir : found afni_handouts under $HOME
atlas : found TT_N27+tlrc under /Users/xl1549/abin

------------------------------ OS specific -------------------------------
XQuartz version : 2.8.5

which brew : /opt/homebrew/bin/brew
brew version : Homebrew 4.1.17

-- consider installing gcc under homebrew
-- consider installing glib under homebrew

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

  • just be aware: login shell 'zsh', but our code examples use 'tcsh'

Howdy-

I think we ran into this issue just this week at the Bootcamp. We have a partial fix, but have to check that for a second potential issue. Hopefully this will be resolved pretty soon, though.

--pt

1 Like

Thanks for the info! Are there anyway to work around this for now?

Yes, @rickr and @dglen have resolved that issue.

You can do a build on your macOS 13 (Silicon/Arm chip) machine now with:

build_afni.py -build_root ~/afni_build -package macos_13_ARM_clang

... and things should be good.

Please let us know if you run into any issues.

--pt

2 Likes

It works! Thank you!!

For reference, the compilers may be going through growing pains dealing with the new ARM processors. The problems we have had seem to be caused by the compiler optimization, specifically at level 2 (-O2). That applies to both clang and gcc, which I would guess to share a code base.

The "solution" has been to lower the main optimization level to 1 (-O1). The resulting binaries should be a touch slower because of that, though we have not done any timing comparisons at this point.

  • rick