@SUMA_AlignToExperiment Bug?

Hello,

I am having a problem running @SUMA_AlignToExperiment - this worked for me yesterday. When I run @SUMA_AlignToExperiment, I get the following error:

set: Variable name must contain alphanumeric characters.

I have @SUMA_AlignToExperiment written into the script generated by afni_proc.py. Even when I try @SUMA_AlignToExperiment by itself outside of the script, I get the same error. I even tried updating my AFNI binaries. I tried to rerun @SUMA_AlignToExperiment on the dataset that I ran yesterday, and the same error occurred.

======================= surf (map data to surface) =======================

map EPI data to the surface domain

set directory variables

set surface_dir = /Users/sxa308/Box Sync/101/repreprocess_w_surf

align the surface anatomy with the current experiment anatomy

@SUMA_AlignToExperiment -exp_anat anat_final.$subj+orig
-surf_anat $surface_dir/101_SurfVol+orig
-wd -strip_skull surf_anat
-atlas_followers -overwrite_resp S
-prefix ${subj}_SurfVol_Alnd_Exp

I am not sure what might be happening there,
since this works for me. What version of AFNI
are you running (afni -ver)?

And where is this script located
(which @SUMA_AlignToExperiment)?

Would you please run it via ‘tcsh -x’ and send
me the text output via email? So consider:

# (assuming $subj and $surface_dir are set)
mkdir rickr.test
cp anat_final.$subj+orig*  rickr.test
cd rickr.test

tcsh -x `which @SUMA_AlignToExperiment` \
   -exp_anat anat_final.$subj+orig \
   -surf_anat $surface_dir/101_SurfVol+orig \
   -wd -strip_skull surf_anat \
   -atlas_followers -overwrite_resp S \
   -prefix ${subj}_SurfVol_Alnd_Exp \
   |& tee out.a2e.txt

And then send me the out.a2e.txt file via email.

Thanks,

  • rick

Hi Rick,

the same error now occurred also to me hence I am reviving this old thread.

I am running afni on a Macbook Pro 14 with Macintosh 12 Monterey.

afni -ver gives:
Precompiled binary macos_10.12_local: Mar 10 2022 (Version AFNI_22.0.17 ‘Hadrian’)

I send you the other output via PM.

Bests,
Philipp

Hi Philipp,

I think you just have mistakes in your .cshrc or .tcshrc file.

The output starts with something that looks like the (evaluated) $PATH and shows: Command not found.
Then it shows export: command not found.

Both of those should be fixed. Please feel free to mail the files to me directly (click on my name for email).

If you want to package all such files, run:

afni_system_check.py -dot_file_pack for_rick.tgz

and mail the resulting for_rick.tgz file.

Thanks,

  • rick

Hi Philipp,

Thanks for the files.

There is a mistakenly copied “export PATH” line in .cshrc. In that shell, PATH is set using setenv.

However, that is somewhat irrelevant, since you have a .tcshrc file (which means .cshrc is ignored).
The end of the .tcshrc file has the 2 errors that I mentioned:

PATH=…
export $PATH

Those 2 lines should be deleted, and replaced with something like:

setenv PATH /opt/homebrew/bin:${PATH}

You might want to verify where python3 is coming from, too. That PATH list does not look quite right.

  • rick

Hi Rick,

thank you for your help with the shell error messages! I fixed them and they are gone whenever I start them. The main issue with the error “set: Variable name must begin with a letter.” unfortunately still persists when using @SUMA_AligntoExperiment. (see attachment)

May I send you my current dotfiles again per email just to make sure that there is nothing wrong here?

Curiously, if I run @SSwarper this error also occurs, which does not prevent the program vom finishing successfully:

@SSwarper -input anat+orig. -base MNI2009_to_MNI+tlrc.BRIK -subid sswarp_anat2mni
++ Starting: @SSwarper v2.54
++ Default OMP_NUM_THREADS is 10

++ Based on input, the output directory will be:
.
set: Variable name must begin with a letter.
++ 3dTcat: AFNI version=AFNI_22.0.17 (Mar 10 2022) [64-bit]
++ elapsed time = 0.2 s
++ SSW Step 1
++ SSW Step 2
++ SSW Step 3
++ OpenMP thread count = 10

Bests,
Philipp

Screen Shot 2022-05-10 at 4.43.41 PM.png

Hi, Philipp-

Hmm, I am not sure what the issue here is. Could you please run your same command above but also include “-echo” as an option, and then dump a copy of the terminal output to a text file, too. If you are using bash/zsh, this would be done as:


@SSwarper -input anat+orig. -base MNI2009_to_MNI+tlrc.BRIK -subid sswarp_anat2mni \
    -echo \
    2>&1 | tee o.ssw.txt

… and if you are using tcsh/csh, this would be done as:


@SSwarper -input anat+orig. -base MNI2009_to_MNI+tlrc.BRIK -subid sswarp_anat2mni \
    -echo \
   |& tee o.ssw.txt

Then could you please email me the o.ssw.txt text, so I can check it. (If you click on my username in the MB interface here, you will see my email.)

Separately (or perhaps related… but this should not be the cause of your error above) but importantly, when running @SSwarper, you should use only one of the available SSW reference sets as a base:
https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/programs/%40SSwarper_sphx.html#reference-datasets
These are special versions of known templates, because they have multiple volumes. So, probably you should be running with:


-base MNI152_2009_template_SSW.nii.gz

But let’s troubleshoot the first issue first.

thanks,
pt

Done!

Bests,
Philipp

Hi,

I sent you an email with the requested information last Thursday.

Bests,
Philipp

Hi, Philipp-

I saw it, but it has been an extraordinarily busy week.

I will reply to your email now.

–pt

And after further investigation, the culprit for this woe was having spaces in directories on the computer system, which caused some woe in some shell scripts that contained things like:


set here = $PWD

… and later used the “${here}” quantity/string.

Several/most (maaaaybe all?) scripts have been updated to avoid this behavior, wrapping variables in “quotes”. It would still be advisable not to have spaces in filenames (this particular case was caused by an external drive’s name, not set by the user).

-pt