Common Options for most AFNI Progams

When you master these, you are a long ways towards being an ACE or maybe even a JAM.


'On-the-Fly' Datasets
Most AFNI programs can take as input datasets that are modified in various ways as they are read in. The methods for specifying such datasets are described below.

They all use special characters such as '$ ( ) [ ] < >' which the shell interprets in ways antithetical to AFNI, so you will have to escape these characters on the command line. This is most easily done by putting the entire dataset plus selection list inside forward single quotes, as in 'fred+orig[5..7,9]', or double quotes "x". Double quotes are necessary if you wish to use the '$' character to expand shell variables, as in

   set nlast = 32
   afni elvis+orig"[0..${nlast}]"
Single quotes are necessary if you want to use the '$' character to indicate the last sub-brick in a dataset, and not have '$' trigger an attempted shell variable expansion.


  • Datasets on the Web
    It is also possible to read datasets across the Web; for example:
      afni -com 'OPEN_WINDOW axialimage' http://afni.nimh.nih.gov/pub/dist/data/TTatlas.nii.gz
    
    The file(s) are actually fetched to the /tmp directory, then read in from disk, locked into memory (marked as un-purge-able in AFNI), and then the files are deleted from /tmp. You cannot use sub-brick selectors or other modifiers on such datasets.


  • 'On-the-fly' 1D Files
    A similar repertoire of methods is available for editing 1D files on the command line.



    -Dname=val
    Sets environment variable 'name' to 'val'.
    Some AFNI program features can only be controlled from outside by setting environment variables. For example:
      1dplot -DAFNI_1DPLOT_COLOR_01=rgbi:0/1/0 -DAFNI_1DPLOT_THIK=.01 '1D: 3 4 5 3 2 1'
    creates a graph with the default line color changed from black to green and also makes the lines very thick.
    For details about AFNI environment variables, see http://afni.nimh.nih.gov/pub/dist/doc/program_help/README.environment.html



    -overwrite
    Allows 3D datasets to be overwritten.
    Most AFNI programs will not destroy existing datasets; this option tells them that it is OK to write over an existing dataset file if necessary.



    -skip_afnirc
    Skips the processing of your ~/.afnirc file.
    This file, if present, can be used to set environment variables to affect AFNI programs. Sometimes you might want to run an AFNI program and not have your settings applied; this option provides an easy way to skip such settings.