Error with @auto_tlrc

Hello,

I am encountering an issue with my preprocessing script using @auto_tlrc. My goal is to align anatomical data to the MNI template but I consistently run into errors. Here is a summary of my setup and the errors:

AFNI version: 24.1.22
Script Setup: I've attached a screenshot of my preprocessing code.

Error Message:

  1. Error: template (or -apar) dset not found: MNI152_2009_template_SSW+tlrc

Could someone help diagnose why @auto_tlrc fails to recognize the MNI template?

Thank you for any assistance!

The template is in NIFTI format, and so the +tlrc might throw it off. Try using MNI152_2009_template.nii.gz .

  • rick

Hello!

Thank you for the quick response. I just ran the script again with the MNI152_2009_template.nii.gz and encountered a very similar error with @auto_tlrc.

Error Message: @auto_tlrc -base MNI152_2009_template_SSW.nii.gz -input files_T1w_BIC7T_V0_20201029124318_7_ss+orig -no_ss

lll: Subscript out of range.

Error: template (or -apar) dset not found: MNI152_2009_template_SSW.nii.gz

I think I converted the gz file to NIFTI format to see if it would work better with tlrc. Please let me know your thoughts!

That error suggests that the dataset (MNI*SSW.nii.gz) can't be found, either in the current directory, your abin/ directory of AFNI binaries, or a place specified with an AFNI environment variable in your ~/.afnirc file.

What is the output of:

@FindAfniDsetPath MNI152_2009_template_SSW.nii.gz

?

--pt

I just ran the command and the output was:

@FindAfniDsetPath MNI152_2009_template_SSW.nii.gz

lll: Subscript out of range.

.

-Nat

Hi Nat,

I would like to be able to duplicate this. What system are you on?

Would you mind just posting the output to:

afni_system_check.py -check_all

Thanks!

-rick

Hello,

Of course! Here is the output:

[hackmn01@li04e04 ~]$ afni_system_check.py -check_all
-------------------------------- general ---------------------------------
architecture: 64bit ELF
cpu type: x86_64
system: Linux
release: 5.14.0-427.13.1.el9_4.x86_64
version: #1 SMP PREEMPT_DYNAMIC Wed May 1 19:11:28 UTC 2024
distribution: rocky 9.4 Blue Onyx
number of CPUs: 96
apparent login shell: bash
shell RC file: .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /hpc/users/hackmn01/afni/afni
afni version : afni: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory
:
AFNI_version.txt : AFNI_24.3.06, linux_centos_7_64, Oct 31 2024, official
which python : /usr/bin/python
python version : 3.9.18
which R :

instances of various programs found in PATH:
afni : 1 (/hpc/users/hackmn01/afni/afni)
R : 0
python : 1 (/usr/bin/python3.9)
python2 : 0
python3 : 1 (/usr/bin/python3.9)

testing ability to start various programs...
afni : FAILURE
afni: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory
suma : FAILURE
suma: error while loading shared libraries: libGLw.so.1: cannot open shared object file: No such file or directory
3dSkullStrip : FAILURE
3dSkullStrip: error while loading shared libraries: libGLw.so.1: cannot open shared object file: No such file or directory
3dAllineate : FAILURE
3dAllineate: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory
3dRSFC : FAILURE
3dRSFC: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory
SurfMesh : FAILURE
SurfMesh: error while loading shared libraries: libGLw.so.1: cannot open shared object file: No such file or directory
3dClustSim : FAILURE
3dClustSim: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory
uber_subject.py : success
3dMVM : FAILURE
R: Command not found.

** missing 3 binary libraries across 7 programs
** missing 2 binary libraries in program R_io.so

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

which tcsh : /usr/bin/tcsh
tcsh version : 6.22.03
which Xvfb : /usr/bin/Xvfb

checking for R packages...
rPkgsInstall -pkgs ALL -check : FAILURE
R: Command not found.

R RHOME : R: Command not found.

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

** failed to load module matplotlib.pyplot
-- matplotlib.pyplot is required

** failed to load module flask
-- flask is not required, but is desirable

** failed to load module flask_cors
-- flask_cors is not required, but is desirable

-------------------------------- env vars --------------------------------
PATH = /usr/local/bin:/hpc/lsf/10.1/linux3.10-glibc2.17-x86_64/etc:/hpc/lsf/10.1/linux3.10-glibc2.17-x86_64/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/usr/local/opt/python/libexec/bin:/hpc/users/hackmn01/afni:/hpc/users/hackmn01/.local/bin:/hpc/users/hackmn01/bin

PYTHONPATH =
R_LIBS =
LD_LIBRARY_PATH = /lib64:/hpc/lsf/10.1/linux3.10-glibc2.17-x86_64/lib
DYLD_LIBRARY_PATH =
DYLD_FALLBACK_LIBRARY_PATH =
CONDA_SHLVL =
CONDA_DEFAULT_ENV =
CC =

----------------------------- 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)

dot file test : want 1 modifications across 3 files:

  file             path  flatdir  apsearch        follower
  ---------------  ----  -------  --------        --------
  .cshrc           0     0        1               0     
  .tcshrc          0     0        0               1     
  .bashrc          0     0        0               0     

------------------------------ 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 /hpc/users/hackmn01/afni

------------------------------ OS specific -------------------------------
which dnf : /usr/bin/dnf
dnf version : 4.14.0
which yum : /usr/bin/yum
yum version : 4.14.0

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

  • just be aware: login shell 'bash', but our code examples use 'tcsh'
  • missing program: R
  • failure under initial "AFNI and related program tests"
  • AFNI programs show FAILURE
  • missing binary library: libpng15.so.15
  • missing binary library: libR.so
  • missing binary library: libGLw.so.1
  • missing binary library: libgsl.so.0
  • have bad tcsh version 6.22.03, has '$var:t' bug
    (please install 6.22.04)
  • missing R packages (see rPkgsInstall)
  • python library matplotlib is required
    (see AFNI install docs for details)
  • dot file test : want 1 modifications across 3 files:
  • insufficient data for AFNI bootcamp
    (see "Prepare for Bootcamp" on install pages)

Please let me know what you think or if there is a better way I could present this. Thank you so much!

-Nat

Hi, Nat-

There are a lot of things missing there for the setup---note the bottom section of "please fix" items. I see that is a Rocky 9 system, which I forget if we now have binaries for separately (@rickr ?), but I believe pretty much all of the Rocky 8 setup notes here apply directly.

I even see a note there that might particularly apply to running the scripts noted in the thread above, which are tcsh scripts:

have bad tcsh version 6.22.03, has '$var:t' bug
(please install 6.22.04)

I think those things should be addressed to get things working well. (The Bootcamp data need not be installed, that is just note for pre-Bootcamp setup.)

--pt

Yes, we have a rocky_8 package, but not rocky_9. And we should be able to make an update to make libgsl less of an issue, but just haven't done so yet.

But indeed, it seems likely that the $var:t bug in that version of tcsh is the culprit here. Nat, you should probably inform the HPC admins of that problem, and see if they can put a different version of tcsh on it. It was fixed right away, I believe, in version 6.22.04.

That seems to be common across the RedHat 9 variants. I am surprised RH has not upgraded that package.

  • rick

Hello!

I followed the setup instructions for Rocky 8, which cleared up a lot of the things missing. The only steps I couldn't complete were the ones involving sudo due to my lack of sudo access. I have included the updated setup below:
[hackmn01@li04e01 hackmn01]$ afni_system_check.py -check_all
-------------------------------- general ---------------------------------
architecture: 64bit ELF
cpu type: x86_64
system: Linux
release: 5.14.0-427.13.1.el9_4.x86_64
version: #1 SMP PREEMPT_DYNAMIC Wed May 1 19:11:28 UTC 2024
distribution: rocky 9.4 Blue Onyx
number of CPUs: 96
apparent login shell: bash
shell RC file: .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /hpc/users/hackmn01/afni/afni
afni version : Precompiled binary linux_rocky_8: Oct 31 2024
: AFNI_24.3.06 'Elagabalus'
AFNI_version.txt : AFNI_24.3.06, linux_rocky_8, Oct 31 2024, official
which python : /usr/bin/python
python version : 3.9.18
which R :

instances of various programs found in PATH:
afni : 1 (/hpc/users/hackmn01/afni/afni)
R : 0
python : 1 (/usr/bin/python3.9)
python2 : 0
python3 : 1 (/usr/bin/python3.9)

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 : FAILURE
R: Command not found.

** missing binary library 'libR.so' in program R_io.so

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

which tcsh : /hpc/users/hackmn01/local/bin/tcsh
tcsh version : 6.24.07
which Xvfb : /usr/bin/Xvfb

checking for R packages...
rPkgsInstall -pkgs ALL -check : FAILURE
R: Command not found.

R RHOME : R: Command not found.

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

++ module loaded: matplotlib.pyplot
module file : /hpc/users/hackmn01/.local/lib/python3.9/site-packages/matplotlib/pyplot.py
matplotlib version : 3.9.2

** failed to load module flask
-- flask is not required, but is desirable

** failed to load module flask_cors
-- flask_cors is not required, but is desirable

-------------------------------- env vars --------------------------------
PATH = /hpc/packages/minerva-centos7/gsl/2.5/bin:/hpc/users/hackmn01/local/bin:/usr/local/bin:/hpc/lsf/10.1/linux3.10-glibc2.17-x86_64/etc:/hpc/lsf/10.1/linux3.10-glibc2.17-x86_64/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/usr/local/opt/python/libexec/bin:/hpc/users/hackmn01/afni:/hpc/users/hackmn01/.local/bin:/hpc/users/hackmn01/bin

PYTHONPATH =
R_LIBS = /hpc/users/hackmn01/R
LD_LIBRARY_PATH = /hpc/packages/minerva-centos7/gsl/2.5/lib:/hpc/packages/minerva-centos7/libGLw/8.0.0/lib:/hpc/users/hackmn01/custom_libs:/hpc/packages/minerva-centos7/python/2.7.17/lib:/hpc/users/hackmn01/local/lib:/lib64:/hpc/lsf/10.1/linux3.10-glibc2.17-x86_64/lib

DYLD_LIBRARY_PATH =
DYLD_FALLBACK_LIBRARY_PATH =
CONDA_SHLVL =
CONDA_DEFAULT_ENV =
CC =

----------------------------- 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)

dot file test : want 1 modifications across 3 files:

  file             path  flatdir  apsearch        follower
  ---------------  ----  -------  --------        --------
  .cshrc           0     0        1               0     
  .tcshrc          0     0        0               1     
  .bashrc          0     0        0               0     

------------------------------ data checks -------------------------------
data dir : found AFNI_data6 under $HOME (125827078M Avail)
top history: 08 Nov 2024 [rickr/ptaylor]: add afni/bad_scripts
data dir : found AFNI_demos under $HOME
top history: 07 Nov 2024 [rickr]: shrank AFNI_pamenc tree
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 /hpc/users/hackmn01/afni

------------------------------ OS specific -------------------------------
which dnf : /usr/bin/dnf
dnf version : 4.14.0
which yum : /usr/bin/yum
yum version : 4.14.0

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

  • just be aware: login shell 'bash', but our code examples use 'tcsh'
  • missing program: R
  • failure under initial "AFNI and related program tests"
  • AFNI programs show FAILURE
  • missing binary library: libR.so
  • missing R packages (see rPkgsInstall)
  • dot file test : want 1 modifications across 3 files:

However, I noticed when I try to locate the MNI template it returns the same error as before:
@FindAfniDsetPath MNI152_2009_template_SSW.nii.gz

lll: Subscript out of range.

@auto_tlrc also encountered the same error as before. I was wondering if it would be worth it to replace @auto_tlrc with 3dAllienate but I have a feeling that the error may not be with @auto_tlrc itself. Please let me know your thoughts and if there is any other information I can provide. Thank you!

-Nat

Thank you so much for pointing out the $var:t bug in the tcsh version, I will inform HPC admins about this issue. When I switched to version 6.22.04 it was immediately fixed. Thank you!

-Nat

That's great, thanks for the update!

  • rick

Hello,

Sorry I think I spoke too soon, I am still encountering the same @auto_tlrc errors as before. Do you think it may be worth to switching to 3dAllienate in the script or using something else?

-Nat

Hi, Nat-

Indeed, we don't really use @auto_tlrc in the main processing parts in practice (we use it in the Bootcamp examples, because it is faster than nonlinear processing but it certainly is not a detailed an alignment), but it would be good to understand what is happening here and troubleshoot it fully. Working on the more modern/high-powered analysis can follow from that. (NB: the R-language related issues shouldn't matter here at all, so we can ignore those for the moment.)

So, just to check, now that tcsh has been updated, what is the output of:

@FindAfniDsetPath MNI152_2009_template_SSW.nii.gz

?

thanks,
pt

Hello!

The output remains the same unfortunately:

111: Subscript out of range.

Please let me know how to proceed. Thank you!

-Nat