Hi all,
I encountered a strange error with @SUMA_AlignToExperiment on a HPC cluster producing the error described below, essentially not identifying the file, even though it is there.
(base) [me@lh06c21 tmp]$ ls
aparc+aseg.nii brainstemSsLabels.v13.FSvoxelSpace.nii.gz
aparc+aseg+orig.BRIK.gz mp2rage_ws+orig.BRIK
aparc+aseg+orig.HEAD mp2rage_ws+orig.HEAD
brainmask.nii
(base) [me@lh06c21 tmp]$ ml
Currently Loaded Modules:
1) gsl/2.5 3) netpbm/10.79.00 5) afni/24.1.22
2) libGLw/8.0.0 4) libpng/1.5.30
(base) [me@lh06c21 tmp]$ @SUMA_AlignToExperiment -exp_anat mp2rage_ws+orig. -surf_anat brainmask.nii -surf_anat_followers aparc+aseg.nii
lll: Subscript out of range.
Error follower dset aparc+aseg.nii cannot be found
Note that option -surf_anat_followers must be
the last one on the command line
Failed.
Additionally, running the command directly from the folder produced a similar error:
abin=/hpc/packages/minerva-centos7/afni/24.1.22/afni
(base) [me@lh06c21 tmp]$ tcsh -x $abin/@SUMA_AlignToExperiment -exp_anat mp2rage_ws+orig. -surf_anat brainmask.nii -surf_anat_followers aparc+aseg+orig. brainstemSsLabels.v13.FSvoxelSpace.nii.gz
basename /hpc/packages/minerva-centos7/afni/24.1.22/afni/@SUMA_AlignToExperiment
@global_parse @SUMA_AlignToExperiment -exp_anat mp2rage_ws+orig. -surf_anat brainmask.nii -surf_anat_followers aparc+aseg+orig. brainstemSsLabels.v13.FSvoxelSpace.nii.gz
if ( 0 ) exit 0
set stat = 0
set CurDir = /sc/arion/projects/LCNE/users/me/tmp
set tmps = `3dnewid -fun`
3dnewid -fun
goto PARSE_COMMAND
set followers = ( )
set alli_opt =
set skstr_opt =
set folinterp = NN
set cleanup = 1
set Narg = 7
set cnt = 1
set cropt = -coarserot
set prefix =
set UseWarp = 0
set clpbelow =
set SA_in =
set EA_in =
set DownSample = 0
set StripSkull = 0
set okchangeview = 0
set overwrite_resp =
set no_center = 1
set prexform =
set OutResOpt =
set rmlist = ( )
set echo_opt =
while ( 1 < = 7 )
set donext = 1
if ( 1 && -exp_anat == -h || -exp_anat == -help ) then
if ( 1 && -exp_anat == -echo ) then
if ( 1 && -exp_anat == -dxyz ) then
if ( 1 && -exp_anat == -init_xform ) then
if ( 1 && -exp_anat == -out_dxyz ) then
if ( 1 && -exp_anat == -EA_clip_below ) then
if ( 1 && -exp_anat == -prefix ) then
if ( 1 && -exp_anat == -surf_anat ) then
if ( 1 && -exp_anat == -exp_anat ) then
set pLoc = 1
if ( 1 == 7 ) then
@ cnt ++
set EA_in = mp2rage_ws+orig.
set donext = 0
if ( `3dinfo -is_nifti $EA_in` == 1 ) then
3dinfo -is_nifti mp2rage_ws+orig.
endif
endif
if ( 0 && mp2rage_ws+orig. == -wd ) then
if ( 0 && mp2rage_ws+orig. == -al ) then
if ( 0 && mp2rage_ws+orig. == -al_opt ) then
if ( 0 && mp2rage_ws+orig. == -skull_strip_opt ) then
if ( 0 && mp2rage_ws+orig. == -align_centers ) then
if ( 0 && mp2rage_ws+orig. == -ok_change_view ) then
if ( 0 && mp2rage_ws+orig. == -strip_skull ) then
if ( 0 && mp2rage_ws+orig. == -surf_anat_followers ) then
if ( 0 && mp2rage_ws+orig. == -atlas_followers ) then
if ( 0 && mp2rage_ws+orig. == -followers_interp ) then
if ( 0 && mp2rage_ws+orig. == -ncr ) then
if ( 0 && mp2rage_ws+orig. == -keep_tmp ) then
if ( 0 && mp2rage_ws+orig. == -overwrite_resp ) then
if ( 0 == 1 && 2 == 1 ) then
if ( 0 == 1 && 2 == 2 ) then
if ( 0 == 1 && 2 == 3 ) then
if ( 0 == 1 ) then
@ cnt ++
end
while ( 3 < = 7 )
set donext = 1
if ( 1 && -surf_anat == -h || -surf_anat == -help ) then
if ( 1 && -surf_anat == -echo ) then
if ( 1 && -surf_anat == -dxyz ) then
if ( 1 && -surf_anat == -init_xform ) then
if ( 1 && -surf_anat == -out_dxyz ) then
if ( 1 && -surf_anat == -EA_clip_below ) then
if ( 1 && -surf_anat == -prefix ) then
if ( 1 && -surf_anat == -surf_anat ) then
set pLoc = 3
if ( 3 == 7 ) then
@ cnt ++
set SA_in = brainmask.nii
set donext = 0
endif
endif
if ( 0 && brainmask.nii == -exp_anat ) then
if ( 0 && brainmask.nii == -wd ) then
if ( 0 && brainmask.nii == -al ) then
if ( 0 && brainmask.nii == -al_opt ) then
if ( 0 && brainmask.nii == -skull_strip_opt ) then
if ( 0 && brainmask.nii == -align_centers ) then
if ( 0 && brainmask.nii == -ok_change_view ) then
if ( 0 && brainmask.nii == -strip_skull ) then
if ( 0 && brainmask.nii == -surf_anat_followers ) then
if ( 0 && brainmask.nii == -atlas_followers ) then
if ( 0 && brainmask.nii == -followers_interp ) then
if ( 0 && brainmask.nii == -ncr ) then
if ( 0 && brainmask.nii == -keep_tmp ) then
if ( 0 && brainmask.nii == -overwrite_resp ) then
if ( 0 == 1 && 4 == 1 ) then
if ( 0 == 1 && 4 == 2 ) then
if ( 0 == 1 && 4 == 3 ) then
if ( 0 == 1 ) then
@ cnt ++
end
while ( 5 < = 7 )
set donext = 1
if ( 1 && -surf_anat_followers == -h || -surf_anat_followers == -help ) then
if ( 1 && -surf_anat_followers == -echo ) then
if ( 1 && -surf_anat_followers == -dxyz ) then
if ( 1 && -surf_anat_followers == -init_xform ) then
if ( 1 && -surf_anat_followers == -out_dxyz ) then
if ( 1 && -surf_anat_followers == -EA_clip_below ) then
if ( 1 && -surf_anat_followers == -prefix ) then
if ( 1 && -surf_anat_followers == -surf_anat ) then
if ( 1 && -surf_anat_followers == -exp_anat ) then
if ( 1 && -surf_anat_followers == -wd ) then
if ( 1 && -surf_anat_followers == -al ) then
if ( 1 && -surf_anat_followers == -al_opt ) then
if ( 1 && -surf_anat_followers == -skull_strip_opt ) then
if ( 1 && -surf_anat_followers == -align_centers ) then
if ( 1 && -surf_anat_followers == -ok_change_view ) then
if ( 1 && -surf_anat_followers == -strip_skull ) then
if ( 1 && -surf_anat_followers == -surf_anat_followers ) then
set pLoc = 5
if ( 5 == 7 ) then
@ cnt ++
set followers = ( aparc+aseg+orig. brainstemSsLabels.v13.FSvoxelSpace.nii.gz )
foreach fol ( aparc+aseg+orig. brainstemSsLabels.v13.FSvoxelSpace.nii.gz )
set exx = `@CheckForAfniDset $fol`
@CheckForAfniDset aparc+aseg+orig.
if ( 0 ) then
if ( 0 < 2 ) then
echo Error follower dset aparc+aseg+orig. appears not to be a dset
Error follower dset aparc+aseg+orig. appears not to be a dset
echo Note that option -surf_anat_followers must be
Note that option -surf_anat_followers must be
echo the last one on the command line
the last one on the command line
goto BEND
echo Failed.
Failed.
set stat = 1
goto END
cd /sc/arion/projects/LCNE/users/me/tmp
if ( 1 ) then
foreach ff ( )
endif
exit 1
Running the same command on my local machine works fine. Do you have an idea about what is going on there?
There was a previous thread recently about that missing parcellation. The results can be missing either because of an incorrect copy of a link or because FastSurfer (vs FreeSurfer) is missing that file.
thanks for your response! I also consulted our IT personal regarding this issue and sent me the following response:
I don't think it's a system-related issue, but has something to do with the "@SUMA_AlignToExperiment" command itself. I don't have time to look into the whole code in detail at the moment but it seems to me that there's a sort of a bug in the following section of the source:
In line 966,
CHECK_EXISTENCE:
if (@CheckForAfniDset $ExpAnat ... 2) goto NO_EXPANAT
The error message you got means that executing "@CheckForAfniDset $ExpAnat" resulted in a number less than 2. "@CheckForAfniDset" is another afni command. When I manually check it with your input, this gives 0. I believe the correct number is supposed to be 2.
I'd suggest that you reach out to the afni developers to resolve the issue.
This answer combined with your response seems to indicate that there is something "wrong" with the aparc+aseg file I am using but I am not really sure what to do about it because this file came from a standard freesurfer segmentation and not from fastsurfer so there should be no issue recognizing the file. Therefore, I don't know what I can do about it.
That is a problem if the program can't find the file. From the help of @Check...
example: @CheckForAfniDset /Data/stuff/Hello+orig.HEAD
returns 0 if neither .HEAD nor .BRIK(.gz)(.bz2)(.Z) exist
OR in the case of an error
An error also sets the status flag
1 if only .HEAD exists
2 if both .HEAD and .BRIK(.gz)(.bz2)(.Z) exist
3 if .nii dataset
Getting a 0 or a 1 isn't good enough. It might be that the program isn't finding the dataset in a directory that has a path with a space or a strange character that isn't parsed properly. If you can remove all spaces anywhere in the path or move the data to a directory that is in a safer path, that might be solve this problem.
I tried the command @CheckForAfniDset aparc+aseg.nii and received the following error:
lll: Subscript out of range.
and @CheckForAfniDset aparc+aseg+orig.HEAD, which returned '0'.
I checked again with our IT and they said that the command "@CheckForAfniDset $ExpAnat" successfully finds the correct number (2) and the "@SUMA_AlignToExperiment" command works also for the OS Centos7, but not for the new OS version Rocky9. Since all of our nodes have been updated to the new system, they told me to ask you for help to solve this issue as this is OS specific. Is there anything in the code that requires updating?
It seems Rocky 9 has picked a very specific version of tcsh that has this bug. We are pondering some options. You can wait for Rocky 9 to update to a more recent version, downgrade to an older version or use a completely different version. If your administrator allows replacement of the tcsh with a working, non-buggy version in /bin/tcsh, then it's simpler. If not, it's more tedious but possible to do this update as done in this prior thread:
That seems to be an odd bug indeed.
The thread references tcsh version 6.22.03. We use tcsh version 6.24.14 and still seem to have the same issue. If there is no other solution to wait for another update (?) of Rocky 9 then I will discuss with our IT the possibility of using the method from the thread, i.e. changing all afni binaries that call tcsh, if I understood it correctly at first glance. I guess, downgrading is not an option in my case as I have no control of the high performance clusters.
I would like to verify that 6.24.14 poses a problem, since we have tested 6.22.04 which fixed it.
Actually, I had not even realized it before, but it turns out that I am running 6.22.04 on my laptop. That command does not give any error. I suspect that if you have a newer tcsh, then it is not in /usr/bin (which is something for us to ponder on this end).
What is the output from:
which tcsh
tcsh --version
@CheckForAfniDset aparc+aseg.nii
That bug in tcsh seems to have briefly returned, but it should be okay now. On my Mac, I tried the latest version available for conda (6.24.10 and earlier than the most recent tcsh bug) and the latest source version from github (6.24.14 - after the fix for that bug). Both seem to work fine. Rocky package searches show only the 6.22.03 version, the old problematic version. That points to the problem Rick pointed out with the /usr/bin version as a different version than the first one in the path.
(base) [me@lh06c30 test]$ which tcsh
/usr/bin/tcsh
(base) [me@lh06c30 test]$ tcsh --version
tcsh 6.22.03 (Astron) 2020-11-18 (x86_64-unknown-linux) options wide,nls,dl,al,kan,sm,rh,color,filec
(base) [me@lh06c30 test]$ ml tcsh/6.24.14
(base) [me@lh06c30 test]$ which tcsh
/hpc/packages/minerva-rocky9/tcsh/6.24.14/bin/tcsh
(base) [me@lh06c30 test]$ tcsh --version
tcsh 6.24.14 (Astron) 2024-11-26 (x86_64-unknown-linux) options wide,nls,dl,al,kan,sm,rh,color,filec
(base) [me@lh06c30 test]$ tcsh
[me@lh06c30 ~/test]$ ml afni/24.1.22
[me@lh06c30 ~/test]$ @CheckForAfniDset aparc+aseg.nii
lll: Subscript out of range.
[me@lh06c30 ~/test]$ ls
aparc+aseg.nii brainstemSsLabels.v13.FSvoxelSpace.nii.gz
aparc+aseg+orig.BRIK.gz mp2rage_ws+orig.BRIK
aparc+aseg+orig.HEAD mp2rage_ws+orig.HEAD
brainmask.nii
@dglen I have made our IT aware of this issue and this thread hoping that they follow up on this exchange. As you can see by the output above, the version should be fine, but maybe has to be re-downloaded after a fix has been made...?
The /usr/bin/tcsh is the "bad" version. That requires either replacing it or replacing all the /usr/bin/tcsh in the scripts. Your IT people can decide on a workaround.
I agree, but as you can see from the output, even if I load and use the tcsh with version 6.24.14 it still does not work. Hence it seems indeed to be necessary to do the workaround.
in the end it was indeed necessary for IT to change the "/bin/tcsh" in every file of afni to the newest tcsh executable that was saved in a different path.
Sorry for the trouble. We are in the process of allowing tcsh to simply come from $PATH, so you might not need to repeat that process with a later AFNI update.
-rick
1 Like
The
National Institute of Mental Health (NIMH) is part of the National Institutes of
Health (NIH), a component of the U.S. Department of Health and Human
Services.