.afnirc

Hello,

I modified my .afnirc file to include AFNI_1D_ZERO_TEXT = YES as per my problem in my previous post. Although that worked to fix the previous problem, afni is now not recognizing my other environmental variables like my template and atlas. This is the beginning of my .afnirc file and the message I get when opening afni. Any suggestions?

// This is a sample .afnirc file.
// Copy it into your home directory, with the name ‘.afnirc’.
// Then edit it to your heart’s delight.
// See README.setup and README.environment for documentation.

***COLORS
// Define new overlay colors. These will appear on the color menus.

salmon = #ff8866
navy = navyblue

***ENVIRONMENT
AFNI_GLOBAL_SESSION = /Users/rossisl/macaque_atlas_final/D99_template+tlrc
AFNI_TEMPLATE_SPACE_LIST = D99_Macaque,D99_Macaque_book
AFNI_ATLAS_COLORS = D99_atlas
AFNI_SUPP_ATLAS_DIR = /Users/rossisl/macaque_atlas_final
AFNI_WHEREAMI_DEC_PLACES = 2
AFNI_1D_ZERO_TEXT = YES

// Most (not all) of the Unix environment variables that affect AFNI

IDCODE_PREFIX = AFN // 3 letter prefix for dataset ID codes

Initializing: X11… Widgets… Input files:
** No datasets in AFNI_GLOBAL_SESSION=/Users/rossisl/macaque_atlas_final/D99_template+tlrc
** Searching subdirectories of ‘./’ for data
session # 1 = ./AFNI_data5/ ==> 2 datasets
session # 2 = ./Control/ ==> 10 datasets
session # 3 = ./abin/ ==> 81 datasets
session # 4 = ./macaque_atlas_final/ ==> 3 datasets
dataset count = 96
Time series = 0 files read
NLfit & NLerr= Optimizer (AFNI_NLFIM_METHOD) is SIMPLEX
NLfit & NLerr= Found 28 models
Plugins = 52 libraries read
reading s620_rest_r1+orig(193 million [mega] bytes)…done

Thanks,

Sharyn

There is more info on each environment variable here:
https://afni.nimh.nih.gov/pub/dist/doc/program_help/README.environment.html

But I think the issue is that you have given AFNI_GLOBAL_SESSION as a specific file, when it should be a directory containing the file(s) of interest.

So, if you change:


AFNI_GLOBAL_SESSION = /Users/rossisl/macaque_atlas_final/D99_template+tlrc

to


AFNI_GLOBAL_SESSION = /Users/rossisl/macaque_atlas_final

Does that sort things out?

–pt

Thanks Paul,

Now i get this error over and over… and over :wink:

*** WARNING: Identical ID codes in /Users/rossisl/macaque_atlas_final/D99_template+tlrc.HEAD and ./macaque_atlas_final/D99_template+tlrc.HEAD
*** WARNING: Identical ID codes in /Users/rossisl/macaque_atlas_final/D99_template+tlrc.HEAD and ./macaque_atlas_final/D99_template+tlrc.HEAD
*** WARNING: Identical ID codes in /Users/rossisl/macaque_atlas_final/D99_atlas_1.1_final+tlrc.HEAD and ./macaque_atlas_final/D99_atlas_1.1_final+tlrc.HEAD

Perhaps it’s because I originally changes the .afnirc file using a changes.afnirc script:

settings for use with Macaque atlas

@AfniEnv -set AFNI_WHEREAMI_DEC_PLACES 2
@AfniEnv -set AFNI_SUPP_ATLAS_DIR pwd
@AfniEnv -set AFNI_ATLAS_COLORS D99_atlas
@AfniEnv -set AFNI_TEMPLATE_SPACE_LIST D99_Macaque,D99_Macaque_book

I tried to add this and then run it again:
@AfniEnv -set AFNI_1D_ZERO_TEXT = YES

but I got this error
error: Option or parameter ‘YES’ not understood
Here’s hoping these excerpts from ‘@AfniEnv -help’ enlighten:
‘-h_find WORD: Search for lines containing WORD in -help’

Hmm, are you opening up AFNI from within your AFNI_GLOBAL_SESSION directory? In that case, it is finding each file twice, and I think that is why it is identifying each file with itself as identical.

If you open ‘afni’ from a different directory, does that happen? In general, I would think that shouldn’t be a problem.

–pt

From my home directory, if I just type afni (in the past, it would pull up just my template and atlas), it’s not finding anything and giving me that error. If I cd ~ and ls -a -l, I get a 3 permutations of .afnirc (although I didn’t make them)…

What looks weird to me is the path = wheel (???)

drwxr-xr-x+ 71 rossisl NIH\Domain Users 2414 Sep 13 11:58 .
drwxr-xr-x 7 root admin 238 Feb 19 2016 …
-r-------- 1 rossisl NIH\Domain Users 7 Feb 19 2016 .CFUserTextEncoding
-rw-r–r–@ 1 rossisl NIH\Domain Users 20484 Sep 13 11:58 .DS_Store
-rw-r–r-- 1 rossisl NIH\Domain Users 0 Sep 8 10:21 .Rapp.history
drwx------ 58 rossisl NIH\Domain Users 1972 Sep 13 11:58 .Trash
-rw------- 1 rossisl NIH\Domain Users 1282 Sep 13 11:11 .Xauthority
-r-------- 1 rossisl admin 28291 Sep 13 09:32 .account
drwxr-xr-x 3 rossisl NIH\Domain Users 102 Feb 19 2016 .afni
-rw-r–r-- 1 rossisl NIH\Domain Users 4346 Mar 23 15:17 .afni.crashlog
-rw-r–r-- 1 rossisl NIH\Domain Users 1466858 Sep 13 10:34 .afni.log
-rw-r–r-- 1 rossisl NIH\Domain Users 116 Aug 30 09:55 .afni.vctime
-rw-r–r-- 1 rossisl wheel 13303 Sep 13 11:58 .afnirc
-rwxr-xr-x@ 1 rossisl NIH\Domain Users 13295 Apr 11 11:42 .afnirc.Pre160421
-rw-r–r–@ 1 rossisl NIH\Domain Users 13299 Sep 13 11:38 .afnirc.Pre160913
-rw-r–r-- 1 rossisl NIH\Domain Users 588 Apr 10 10:04 .anyconnect

OK, the reason for that is:

when you open ‘afni’ in a directory with no data, it starts looking in subdirectories. In this case, a subdirectory of your home is also what you’ve set your AFNI_GLOBAL_SESSION to, so it is finding the same data sets twice, once as:
./macaque_atlas_final/D99_template+tlrc.HEAD (this is from checking subdirs for data sets)
and once as:
/Users/rossisl/macaque_atlas_final/D99_template+tlrc.HEAD (this is from the environment path)

So, if you open your AFNI from a different directory still, for example one with data sets in it (but not the AFNI_GLOBAL_SESSION), does that sort out your WARNING messages?

As to those ~/.afnirc.* files, those should just be being ignored by afni, since they have other characters attached to their name; I assume that someone (?) put them there as backups of earlier versions?

–pt

Ok yes - sorry. Seems to work fine now without errors when I’m in a directory that contains datasets. (although originally, that was problem so somewhere along the way, it got fixed). Thanks so much for your help!

Cool, glad that sorted everything out.

–pt

Hey there.

Do you have any suggestions for how to configure my .afnirc file if I am analyzing datasets from 2 different experiments on 2 different species? Would I have to change my .afnirc settings to call the individual templates/atlases for each experiment?

For MONKEY:

AFNI_GLOBAL_SESSION = /Users/rossisl/macaque_atlas_final
AFNI_TEMPLATE_SPACE_LIST = D99_Macaque,D99_Macaque_book
AFNI_ATLAS_COLORS = D99_atlas
AFNI_SUPP_ATLAS_DIR = /Users/rossisl/macaque_atlas_final
AFNI_WHEREAMI_DEC_PLACES = 2
AFNI_1D_ZERO_TEXT = YES

For RAT:

AFNI_WHEREAMI_DEC_PLACES = 3
AFNI_SUPP_ATLAS_DIR = …/ratbrain
AFNI_TEMPLATE_SPACE_LIST = waxholm_rat

Thanks!

A few solutions:

  1. Call the AFNI GUI with the variable definitions you want for that session:

    afni -DAFNI_SUPP_ATLAS_DIR=…

Might be easier to make an alias in linux like rafni and mafni

  1. Set the environment variables in the shell or script (tcsh, use setenv).

  2. Concatenate the CustomAtlases.niml files to include both sets of definitions in a single file (use cat). The atlas datasets are specified in the .niml files. If they are not in the same directory as the CustomAtlases.niml file, whereami functions search the directories included in the AFNI_ATLAS_PATH variable.

Thanks Daniel!