Skip to content


Personal tools
You are here: Home » AFNI » News » Old Release Notes

Old Release Notes

Document Actions
From old website
Animation in AFNI
 - 04 Dec 2003 [version 2.55j]

  • You can now animate AFNI image displays without holding down any keys or mouse buttons.
    • To animate an image window through the slice direction, put the cursor over the image itself, then press the 'v' (for 'video') key. 'V' will animate in reverse slice order. Press the space bar (or any other key) to stop the animation.
    • To animate in the time direction, you use the 'v' (or 'V') key in the graph window.
    • By default, the animation is done as rapidly as possible. To slow it down, you can set the environment variable AFNI_VIDEO_DELAY to a time delay in milliseconds; 50..100 is a good range of values.
      • This variable can be set in your .afnirc file or interactively in the Edit Environment controller (available on the Datamode->Misc menu or the Button-3 popup menu in the AFNI image windows).
    • Both types of animation will loop around to the other side (of the slice stack or time grid) when they get to the end.

  • AFNI programs can now read images from MPEG-1/2 files.
    • You can use program aiv (AFNI Image Viewer) to look at such files.
    • You can read them into to3d.
    • AFNI itself will treat an MPEG file as an axial dataset (e.g., the MPEG time-axis is treated as the I-S axis). You can thus read MPEGs directly into AFNI (no sound, though).
    • This is done via the libmpeg2 library.

  • If you use Mac OS X 10.3 (Panther), AFNI will now speak to you when it starts up! If you don't like this, set environment variable AFNI_SPEECH to NO.

  • You can now Undo the Linear Fillin in the Draw Dataset plugin.

  • Rick Reynolds has added the SurfMeasures program to the surface packages within the AFNI+SUMA dominion.
    • This program will output measures over one or two surfaces.
    • Get node-based thickness, areas, volume, normals, etc.
    • Get aggregate surface areas, volume, etc.

  • Ziad Saad has added the SurfSmooth program to the surface packages within the AFNI+SUMA dominion.
    • This program will smooth surface geometry or surface data.
    • For algorithm references see SurfSmooth -help.

To Do or Do Not
 - 20 Nov 2003 [version 2.55i]

  • The "Draw Dataset" plugin now has multiple levels of Undo and Redo.
     - This is to make it more compatible with SUMA's ROI drawing.
  • SUMA now has a "pen" drawing mode similar to AFNI's.
     - This is to make it compatible with drawing tablets such as the Cintiq display from Wacom.
     - If you are interested in how to setup a Cintiq display for use with AFNI and SUMA, post a message on the Message Board.

More Little Fixes
 - 05 Nov 2003 [version 2.55h]

Since the last message in August, in chronological order:

  • Environment variable AFNI_MAX_OPTMENU sets the upper limit on the number of elements in a "option menu" (e.g., the "Anat" button on the "Define Function" control panel). On some systems, more than 255 elements causes the program to crash, so 255 is now the default upper limit. To change this (e.g., so you can access later bricks in a lengthy bucket dataset), set this environment variable to a larger number (e.g., 666).
  • If you type the name of a dataset file on the afni command line, the program will now read it correctly, rather than try to assume it is a directory of dataset files. That is, in "afni x y", x and y can be dataset filenames or directories. Datasets loaded from the command line directory are in a manufactured session called CLI in the "Switch Session" chooser.
  • In the "Draw Dataset" plugin, you can now attach a string label to each value. These labels will be stored in the dataset .HEAD file. The intention is to make it easier to recall which drawn ROI value corresponds to the hippocampus (for example).
  • Clicking Button-1 in the intensity grayscale bar (right of the image) will cause the image window to re-aspect itself. This is because the AFNI_ENFORCE_ASPECT environment variable doesn't always work on some Linux and Mac systems; this new feature makes it easy to manually correct the problem.
  • Too-short input stimulus time series input to 3dDeconvolve will now be extended with zero values, rather than cause a fatal error.
  • Clicking Button-1 down in an image and then dragging the cursor (with the button still down) lets you adjust the data-grayscale mapping curve interactively.
    • For details, see the AFNI_STROKE_* environment variables in README.environment.
    • You can make AFNI plot the data-grayscale mapping function using the "Display Graymap Plot" item on the intensity bar Button-3 popup menu.
    • You can force the grayscale map to run from the 3D dataset minimum to maximum (rather than the slice-by-slice mapping that is the default). This is done with environment variable AFNI_IMAGE_GLOBALRANGE. When you do this, the data-grayscale mapping curve does not change when you change slices.
  • You can popup the "Edit Environment" controls from the Button-3 popup menu attached to the image window.
  • Mac OS X 10.3 is now supported. You'll need the new source code if you want to compile (the 10.2 binaries seem to work on 10.3), since Apple made a couple incompatible changes to the C compiler in the upgrade.
  • The realtime plugin now computes the FIM based on the registered dataset rather than the original dataset, if realtime registration is turned on (Rick Reynolds).

Little Fixes
 - 08 Aug 2003 [version 2.55d]

  • Since 08 Apr 2003, you've been able to input .1D files to most 3dSomething command line programs. The "spatial" direction is down the columns (vertical). The default is that across the rows (horizontal) is a "bucket" dimension. The new environment variable AFNI_1D_TIME, if set to YES, will cause the horizontal direction to be the time axis (with TR=1). This makes it possible to input .1D files to programs that process 3D+time datasets; however, the files will probably need to be transposed first -- so that the time axis is horizontal rather than vertical. For example,
         1dtranspose fred.1D - > fred_q.1D
         3dFourier -prefix fred_filt_q -highpass 0.1 -retrend fred_q.1D
         1dtranspose fred_filt_q.1D - > fred_filt.1D
         rm -f fred_q.1D fred_file_q.1D 
  • Most of the 1dSomething programs that required an output filename (like 1dtranspose) now let you use a "-" as the output filename to indicate that the output will be written to stdout.
  • A bug was fixed in AFNI's Read Session function -- it should be working again.
  • 3dWarp now has a -fsl_matvec option, which lets you input matrices whose coordinates are in the LPI order used by FSL and SPM. For example, you can resample an FSL functional dataset to be on the highres grid by doing
         3dWarp -matvec_in2out example_func2highres.mat -fsl_matvec \
                -gridset highres.hdr -prefix zstat_h zstat.hdr 
    The output dataset will of course be in the AFNI format. You can convert it back to ANALYZE-7.5 format using program 3dAFNItoANALYZE.
    • 3dWarp also now has a -quintic option, which selects 5th order Lagrange polynomial interpolation. (The default is still linear interpolation.)
  • Fixed a bug that occured only when the anatomical and functional (underlay and overlay) datasets are the same. This situation couldn't arise prior to 01 Aug 2003, and I failed to anticipate it.
  • Fixed a typo that made the Cygwin version of AFNI fail to compile.

A Few Big Changes
 - 01 Aug 2003 [version 2.55a]

  • The interactive AFNI program no longer makes a distinction between "functional" and "anatomical" datasets for display. For example, you can display a statistical dataset from 3dDeconvolve as the underlay and an echo-planar dataset as the color overlay. The choice is now yours.
    • This seemingly simple change required editing more than 20 source code files in more than 400 places. (The dichotomy between "function" and "anatomy" goes back to the very first days of AFNI.) There may be some glitches -- please let me know.
    • This is the first step in a plan to revamp the capabilities of datasets and AFNI. Other steps in the plan include:
      • Non-rectangular regions.
      • More complicated data types stored at each node (AKA voxel) location; for example, vector and matrix types.
      • More complicated color generation and overlay schemes; for example, overlaying from more than one dataset.
      Don't ask when!

  • The next major release of SUMA is out! For complete details, downloads, etc., check here. The vast changes include:
    • Much better documentation.
    • Multiple linked surface viewers.
    • Simultaneous left and right hemisphere display.
    • Talairach surfaces.
    • ROI drawing on the surface.
    • Node color data import.
    • Control of color plane order and opacity.
    • Video (continuous) and single frame recording.
    • Volume-to-surface and surface-to-volume mapping programs.
    • Coming soon will be the documentation of the tools for cross-subject surface-based analysis using standardized meshes.

    Kudos for Ziad Saad, who has worked ferociously (in a benign sense) on this for months.

    The source code for SUMA is included with the AFNI source distribution. SUMA binaries are also included with the Mac OS X AFNI binaries, but not in other AFNI binary packages.

Minor changes made recently are:

  • Rich Hammett has fixed yet another problem with the Siemens' DICOM mosaic format.
  • 3dcalc news:
    • The parser now takes much longer expressions.
    • The program now saves the history of each input dataset into the output dataset's history.
    • When saving results into a short- or byte-valued dataset, the program now checks for non-integral values in the output -- if it finds any, it automatically provides a scaling factor (like the "-fscale" option).
  • New options to 1dplot let you control the x- and y-axes more completely.
  • 3dinfo will now print ALL the history from a dataset, not just the first 8000 characters.
  • 3dmerge now has a "-verb" option, so you can get some progress reports while it works.
  • The "Nudge Dataset" plugin now lets you interpolate with the NN (nearest neighbor) option.
  • Conversion to z-scores, etc., which rely on the statistical parameters set in the dataset header, now should properly work again only when the statistical parameters are correctly set. (Doug Ward has been complaining about this on the message board.)

Several Small Changes
 - 21 Jul 2003 [version 2.52i]

In chronological order of implementation:

  • New keyboard presses you can use in the image viewing window:
    • PageUp and PageDown to change slices.
    • Arrow keys to move 1 pixel at a time (like the arrowpad buttons).
    • Delete key as the equivalent of "Draw Dataset" Undo button.
  • Arrowpad buttons in the image viewer windows now wrap back to the other edge when the crosshairs get to the edge of the image.
  • Image viewer windows now won't get bigger than the display screen when you switch datasets (oops).
  • -median option in 3dmaskave.
  • Fixed bug in Double Plot colors from Dataset#N plugin.
  • New "pen" toggle in image viewer window lets you draw using mouse Button 1 (e.g., when using the "Draw Dataset" plugin to draw an ROI).
  • Fixed Solaris 2.8 bug, where Button 3 popup menus wouldn't appear.
  • Numerous changes to SUMA and corresponding changes to AFNI, but we're not quite ready to finalize and document these.

 - 12 May 2003 [version 2.52h]

  • Programs 3dDeconvolve and 3dNLfim have been modified to be able to use multiple processes on shared memory multi-CPU computers, in order to parallelize and speed up their computations. The use of multiple processes is invoked using the the "-jobs J" command line option, where "J" is the number of processes to use. This page contains more details about the code changes and performance enhancement.
  • New environment variable AFNI_TRY_DICOM_LAST specifies that AFNI programs (e.g., to3d) try the DICOM format last when opening an image file. The reasons for this are spelled out in README.environment.
  • New environment variable AFNI_THRESH_BIGSTEP determines the stepsize used when clicking in the "trough" of the Define Function threshold slider, or when using the PageUp/PageDown keys to alter this slider. Again, see README.environment.
  • Program 3dmaskdump has some new options that let you specify a rectangular box of voxels directly on the command line. This feature can be used to dump to stdout the value of a single voxel from a dataset, based on its voxel indexes or spatial coordinates.
  • Program waver can now accept finite duration ON periods with the "-tstim" option; for example,
      waver -dt 2.0 -tstim 13.2:14.7 18.7:22.3
    specifies that times from 13.2 to 14.7 seconds are "ON" and later 18.7 to 22.3 seconds. (Feature requested by Martin Paulus of UCSD.)
  • Pressing the keyboard Shift key while using the Define Function "Rota" buttons will cause the colormap to rotate 4 steps at a time instead of just 1. This is particularly useful with the 128-step "continuous" colorscale, which otherwise take a loooong time to rotate.
You might (or might not) wonder how new AFNI version numbers are decided upon, and when I decide to change the numbers and make a new release. The answer to both questions is, "Randomly."
 - 01 May 2003 [version 2.52g]

  • Input of 1D time series files to AFNI command line programs can now sub-sample along the time (row) axis as well as along the column axis. This is done with braces, as in
    which means to read only rows #0, #2, #4, ..., until the end (signified by the '$'). To read only from columns #3 and #5, and to read the rows backwards, you could use
    See the output of '1dcat -help' for a complete discussion of the 1D selectivity options.

  • 3dcalc has the new '-taxis' option, which is useful for specifying the creation of a 3D+time dataset when only 3D datasets are input. See the output of '3dcalc -help' for the details.

A Bad Shift
 - 24 Apr 2003 [version 2.52f]

  • Bug Fix: Kate Fissell (Carnegie-Mellon) has convinced me that program 3dTshift was incorrect; in fact, that it was shifting things exactly the wrong way. This problem has been fixed (and the analogous one in 3dvolreg). I apologize for this error.

  • New program 3dWarp lets you apply an arbitrary affine coordinate transformation to a dataset (rotations and shears and scalings, oh my).
  • 3dTagalign has been modified to allow tag-based registration to include coordinate scalings and shears, if the user so specifies. Previously, it only would rotation and shifts.
  • You can now choose the colors used in 1dplot (and other similar graphs) using environment variables.
  • 3dUniformize has been added back into the default compilation ("make totality") and also modified to handle byte-valued datasets.

Facial Expression
 - 08 Apr 2003 [version 2.52e]

  • The AFNI distribution now includes a set of small images of AFNI users. One such image will be randomly selected to be shown in the splash screen when AFNI starts up. If you want to contribute your image, create a .jpg image no larger than 128x128, and e-mail it to me as a MIME attachment.
    • Save the JPEG file at quality factor about 90 - higher just wastes disk space. The file should be between about 4K and 8K in size.
    • If you want your name on the image, you'll have to include that in a text overlay. AFNI won't draw your name under the image.
    • Image files are stored in the plugin directory. If you want to put some local images there but not contribute them to be seen by the whole world, then any image fitting the name pattern "face_*.jpg" will be included in the splash screen list.
      • Such images larger than the 128x128 limit will be scaled down when being displayed. The image scaling function isn't particularly efficient, so this will slow down the splash screen display.
    • New faces will be added to the source distribution about weekly. Binary distributions, on the other hand, are usually only re-made at longer intervals.

  • You can now process .1D files through most 3dSomething programs. (3dcalc is the main exception, but 1deval can be used as a calculator on .1D files.)
    • The main application is to use the statistical program 3dANOVA, etc., on collections of numbers not necessarily associated with a 3D grid. This is how surface-based inter-subject statistics will be performed (after surface nodes are brought into anatomical alignment).
      • However, the surface-based statistics package, including display of the results within SUMA, isn't ready yet.
    • Each row of a .1D file corresponds to a "voxel"; each column is a "sub-brick".

  • Program 3dAFNItoANALYZE has a new option "-orient", which lets you specify the orientation of the output volume(s). If necessary, the program will flip the data around from the AFNI orientation to the desired orientation. This can be useful for viewing ANALYZE files in SPM, for example.
  • Fixed a bug in 3drotate that gave bad results when applying rotations from a text file (e.g., "-dfile") that were very small, but not zero.
  • Fixed a problem with reading MINC files that have incomplete slice scaling factors, or have slice scaling factors that make the data values overflow the range of the byte or short data types.

French is Just Another Word for Nothing Left to Lose
 - 13 Mar 2003 [version 2.52d]

  • 1dplot has some new features:
    • It now accepts multiple 1D files (e.g., 1dplot a.1D 'b.1D[3..5]').
    • New option -xzero specifies the x-axis coordinate at the left. (Default is zero.)
    • New option -nopush skips the "pushing" out of the x- and y-axes to round values.
  • The algorithm used 3dAutomask with the -dilate option is altered slightly, to eliminate voids inside the mask created by the dilation.
  • New program 3dAnhist makes an attempt to analyze the histogram of a high-res T1-weighted anatomical dataset for peaks.
    • Its primary motivation is to let you find out if the histogram has 2 well-defined peaks, presumably corresponding to gray- and white-matter.
  • New option -ort in 3dTcorrelate lets you specifiy extra timeseries for detrending (in addition to the polynomials).
  • Number of tags allowed in the tags plugin is increased to 666. This should be enough for all but the most indefatigable user.
  • 3dNotes has been modified to behave as its -help option claims with respect to dealing with the "\n" (etc.) escapes in input Note strings.
    • Some users are soooo picky, aren't they, Adam?

Et Et Cetera
 - 03 Mar 2003 [version 2.52c]

  • Per Lukas Pezawas of CBDB/NIMH, modified 1dgrayplot to have -ps option, like 1dplot.
  • Modified mritopgm to have a clipping option.
  • New-ish program 3dDeconvolve_f is the same as 3dDeconvolve, but does all calculations in single precision instead of double precision. Runs about 40% faster (e.g., 85 vs. 140 CPU seconds on a sample run with 595 time points, 15 regressors, and 21000 voxels).
    • In cases where the matrix is very nearly collinear, the calculations in single precision may lose accuracy.
  • [See 27 Nov 2002]
    Modified mri_read_dicom.c to allow user to skip slice gap/thickness fixup entirely (cf. README.environment, as usual).

04 Mar 2003 Addendum

Fixed a bug in AFNI itself that could cause a crash when switching from viewing a functional bucket overlay to a non-bucket overlay.

05 Mar 2003 Addendum2
  • Yesterday's fix caused AFNI to crash when started without a functional dataset in the current session. That's been fixed.
    • Oops.
  • Rich Hammett of the SSCC/NIMH/NIH/PHS/HHS/USA has modified the DICOM reading function to deal with yet another variant of the Siemens mosaic format.
    • Will no one rid me of this troublesome format!?

Just Et Cetera
 - 24 Feb 2003 [version 2.52b]

  • Some people (e.g., Hauke and Mike) complained about the change in the Rescan operations (see 15 Jan 2003). You can now set environment variable AFNI_RESCAN_METHOD to select the older Rescan method.
  • The Button-3 (right-click) popup for a colorscale now has a label that shows the color value at the level where you clicked the button and also the corresponding functional overlay value.
  • SUMA related changes to AFNI:
    • You can now control the node boxsize and surface linewidth from the "Control Surface" popup.
    • If node boxes are being drawn, the node closest to the crosshair point with have a * drawn inside its box.
    • Fixed a bug so that colormaps drawn from AFNI to SUMA are only sent once (they were sent twice before; we noticed this problem when drawing ROIs in AFNI and displaying them interactively in SUMA).
    • N.B.: You must recompile SUMA to use it with this new version of AFNI, since the interprocess communication protocol used to exchange data between the two programs has been changed.
  • Windows BMP output from the image viewer now uses the "-bpp 24" flag to program ppmtobmp to save the result as a 24 bit image, rather than as a color-quantized 8 bit image.
  • 3dcalc now allows RGB-valued dataset input. Since only one number per voxel is actually used in the calculation, the default is to compute with the grayscale intensity corresponding to the RGB value in each voxel. However, the new option "-rgbfac" lets you change what combination of R, G, and B values is used.
  • When using the "Draw Dataset" plugin, the keypad "Delete" key pressed in an image window now functions like the plugin "Undo" button.

25 Feb 2003 Addendum
  • The DICOM reading function now can handle missing coordinate information found in some editions of the Siemens Numaris Mosaic format. (Thanks to Rich Hammett of the SSCC for this fix.)
  • A time index change in the main AFNI controller will now be reflected in the new volume renderer. This lets you scroll through 3D+time functional datasets in the 2D slice, 3D renderer, and SUMA views all at once. (Only for the truly heroic FMRI data analyst.)
  • 3dhistog now writes it header lines as a comment field, so that the output can be read directly by 1dplot, etc.
  • Fixed a bug in the AFNI grapher Double Plot code with the Plus/Minus option; this bug was introduced with the Dataset#N plugin.

Colorscales, Et Cetera
 - 04 Feb 2003 [version 2.52a]

  • AFNI, at long last, now supports "continuous" colorscale functional overlays. Details on how to setup your own colorscales and so forth, can be found here.
  • Rich Hammett of the SSCC has modified 3dTsmooth to allow the user to input his/her own filter coefficients from a file. For details, see the output of 3dTsmooth -help.
  • .afni.startup_script can now be used to set the colorscale, and to restore the setting of the Function Range controls. For more details, see README.driver.
  • Program 3dcopy will now read non-AFNI datasets (i.e., MINC, SPM, CTF) as input, and then write them out as AFNI-formatted datasets with new names.
  • When you are viewing a functional "fim" dataset that has no threshold statistic attached, the "Thresh" slider scale is now de-sensitized. The old behavior was to hide this slider.
  • The new Imon tool (by Rick Reynolds of the SSCC and Rasmus Birn of the FMRIF) is for users of GE "realtime" EPI. This program can monitor the I.* image files created in realtime to see if any are missing (a problem we get here from time to time). Optionally, it can feed the images, as they appear on disk, to the AFNI realtime acquisition plugin. If you are interested in this software, post your questions on the AFNI message board.

06 Feb 2003 Addendum
  • You can now input double (8 byte float) values into to3d using the new "3Dd:" input specifier. However, since AFNI doesn't support double-valued datasets, these values will be converted to 4 byte floats.
  • I've modified (again) the behavior of the threshold slider when no statistic is attached. Now, it is always active, unless the functional dataset is in RGB format - in that case, no threshold is applied. If no statistic is attached (i.e., a "fim" dataset), then the threshold applies directly to the functional data itself. In this way, you can threshold the functional values themselves, before colorizing them.
  • I added a few more default colorscales, including a couple with gaps in the middle.

New AFNI Interactive Features
 - 22 Jan 2003 [version 2.51n]

  • In an image viewer, the keyboard arrow keys now scroll the crosshairs 1 pixel at a time (like the 4-way arrowpad in the lower right corner).
    • In zoom+pan mode, these keys will pan the image instead of moving the crosshairs.
    • The Page Up and Page Down keys will move the image slider one slice up or down (like the '<' and '>' keys).
  • New environment variables:
    • AFNI_DEFAULT_OPACITY lets you set the default level for the color overlay opacity in the image viewers.
    • AFNI_DEFAULT_IMSAVE lets you set the default image save method (.jpg, .gif, etc.) in the image viewers.
    • AFNI_VALUE_LABEL now defaults to YES rather than NO.
    • AFNI_AGIF_DELAY lets you set the inter-image delay when creating animated GIFs.
  • The beginnings of AFNI scriptability are presented for your consideration. Scripting is the ability to control/execute some AFNI functions from a text file.
    • The "Datamode->Misc->Save Layout" menu item will save a script that will restore some features of your AFNI window setup, if you just press "Set" with a blank filename. The script file is saved into file ".afni.startup_script", in the current directory (not necessarily the current session). When you start AFNI in the same directory, the script will be executed. Features currently saved include:
      • Controllers, image viewers, and graph viewers open (but not plugins).
      • Threshold slider and color pbar settings (from "Define Function".
      • Func and Thr resample modes (from "Define Datamode").
      • The "See Function" state.
    • The "Datamode->Misc->Run Script" menu item will let you read in a script and have its commands executed in the middle of an AFNI run.
    • See README.driver for details about what can be done in a script.

Nothing in particular
 - 15 Jan 2003 [version 2.51m]

  • The C code behind the dataset Rescan buttons now works slightly differently. If you were doing bizarre things like replacing the contents of datasets then pressing Rescan, you may see some different results now.
  • A bug in 3dresample was fixed; this bug made it impossible to Talairach-ize (via the markers) a +orig dataset that was the output of 3dresample.
  • A bug in 3dmerge was fixed; this bug could produce negative values when doing a -1blur on a non-negative dataset. (Can you say "Gibbs phenomenon"?)
  • If you are using surfaces (e.g., SUMA), you can now change the line thickness of the surface intersection overlays in AFNI by altering the AFNI_SUMA_LINESIZE environment variable in the Datamode->Misc->Edit Environment control panel.
  • All instances of C++ reserved words (such as class) have hopefully been replaced in the AFNI source code.

t-test: Unpooled At Last
 - 27 Dec 2002 [version 2.51k]

The -unpooled option to 3dttest lets you use a t-test that does not assume equal variances in the two populations. This option is very old (late 1994); however, the number of degrees-of-freedom (DOF) varies between voxels in this formulation. At present, there is no support in AFNI for statistical distributions whose parameters vary spatially.

As a palliative, I have added the ability to 3dttest to output an auxiliary dataset with the DOF stored in each voxel. The t-statistic and DOF parameter can then be converted to a z-score (for example) using the fitt_t2z function in 3dcalc. Details are given in the -help output of 3dttest.

  • I'm working on a new dataset format that will allow the storage of more complicated information, including spatially varying statistical parameters.

Christmas Stocking Stuffers
 - 24 Dec 2002 [version 2.51j]

  • Some changes to the realtime plugin (which, as far as I know, is only in use at NIH, MCW, UCSD, and Simon Frasier).
  • Fix to DICOM reading software to get the through-slice orientation correct in to3d when reading multiple single-slice files. (Oops.)
  • Also added support for DICOM "Rescale" and "Window" tags. To enable these, you must set the environment variables AFNI_DICOM_RESCALE and AFNI_DICOM_WINDOW to YES, respectively.
    • I'm not sure it makes sense to use the Window tags in FMRI data analysis, but you'll have to be the judge. The DICOM manuals are laconic, terse, obscure, and pleonastically redundant.
    • If a DICOM file has such tags, but the environment variables aren't set, then a warning message will be printed.
  • New program aiv (AFNI Image Viewer) is a simple program for displaying a bunch of images. For example:
       aiv *.jpg
    This will open a window that looks suspiciously like an AFNI image viewer.
    • The motivation that led to aiv was to make it easy to scroll through the Webcam images from our 3 T scanner.
    • aiv can read the same formats as to3d, but is not limited to having all the 2D images have the same size or data type.
    • aiv isn't intended to replace xv or other X11 image viewers - it is just an alternative that you might find handy for some purposes.
  • Matthew Belmonte has fixed an obscure bug in his permutation test plugin.

Very Tiny Changes
 - 11 Dec 2002 [version 2.51i]

  • AFNI can now read CTF MEG SAM and MRI files, so we can display results from our MEG system.
  • 3dIntracranial was modified to work with byte-valued datasets.
  • Image viewer windows now scroll through their slices if you press the '<' or '>' keys while the mouse cursor is in the image sub-window (i.e., like the graph viewer time point moves with the same keystrokes).
  • Some changes to the realtime plugin to make things more flexible for NIH and UCSD users.

More DICOM annoyance
 - 02 Dec 2002 [version 2.51h]

  • Another variation on the Siemens DICOM Mosaic format surfaced last week, from an Allegra scanner at NYU [via George Tourtellot]. The image reading functions have been modified to deal with this case correctly.
    • Also see 13 Nov 2002's entry.

  • The opacity and brightness graphs in the new volume rendering plugin have been modified to let you display the coordinates of the graph 'handles' as you move them. You must drag these handles with mouse Button 3 depressed to get the label to appear - if you use Button 1, the handles move as before, but the (x,y) coordinate label doesn't appear.
    • This feature lets you set the break points for opacity and/or brightness at precise numerical values. [It was suggested by Ziad Saad, who was using the renderer to look at MRA data.]
    • If you Button 3 click in the histogram graph, you'll also get an (x,y) coordinate label.
    • This feature does not work in the older "Render Dataset" plugin, which is no longer being upgraded.
    • On my older X11 server at home, this feature sometimes causes the server to crash. This doesn't happen on my Linux box at the NIH, so I suppose whatever bug in the server that caused the crash was fixed some time ago.

DICOM annoyance
 - 27 Nov 2002 [version 2.51g]

Some disturbing DICOM files were given to me this morning. In them, the "Spacing Between Slices" attribute was set to 1.0 mm, and the "Slice Thickness" attribute to 4.0 mm. The acquisition was done with a 4.0 mm thickness and a 1.0 mm gap between slices. However, the DICOM standard clearly states that "Spacing Between Slices" is the center-to-center slice distance. This is what to3d uses for the "z voxel size". In this morning's data, the result is a falsely thin set of slices.

The fix just implemented is twofold:

  • Check if "Spacing Between Slices" is less than "Slice Thickness". If so, then print a warning and add the two to get "z voxel size".
    • This means that DICOM files with overlapping slices will be misinterpreted. But I've never seen a MRI experiment like this, so I'm not worrying too much.
  • And/or, if the new environment variable AFNI_SLICE_SPACING_IS_GAP is set to YES, then "z voxel size" will always be set to the sum of "Spacing Between Slices" and "Slice Thickness". This will allow for the (rare) case when the interslice gap is larger than the slice thickness.

By the way, these files came from a scanner manufacturer whose name comprises 2 letters from the first third of the alphabet.

29 Nov 2002 Addendum
I have modified program 1dplot to accept a new option "-ps". With this option, the program writes the plot in PostScript format to stdout, instead of to an X11 window on the screen. For example:
  1dplot -ps gort.1D >
This feature (requested by Lukas Pezawas) makes it possible to make such plots as a part of a script file (e.g., from the "-dfile" output of 3dvolreg).
Little Things
 - 22 Nov 2002 [version 2.51f]

  • AFNI (and to3d) can now read JPEG image files. To view a series of identically-sized JPEG files, you can use a command like
      afni -im *.jpg
    Input of JPEG files is done using the external program djpeg as a filter; this program is now built by the make totality command, and is in all the binary distributions as well.
    • If you also install the netpbm software (not included with AFNI), GIF, BMP, TIFF, and PNG image files can be read using filter programs from that package.
    • AFNI and to3d are designed to deal with arrays of images of exactly the same dimensions, so aren't particularly useful for looking at mounds of images of different sizes.
  • The mpeg_encode and whirlgif programs are now also built with AFNI, meaning that saving image sequences to MPEG-1 and animated GIFs should be easier now.
    • To use whirlgif from within AFNI, you still have to have netpbm installed.
    • Cf. 14 Aug 2001 for more details on output image format converters.
  • When the interactive program starts, AFNI now checks its version number with the master copy on this server. If they don't match, a message is printed to the terminal.
    • If you want to disable this check, set environment variable AFNI_VERSION_CHECK to NO.
    • If you aren't connected to the network, you'll get a message like
        ** AFNI Version Check: fails to complete **
    • [25 Nov 2002 Update] Version checks will be spaced at least 12 hours apart. The time stamp is stored in a file named .afni.vctime in your home directory.
      • If you are curious, the value stored therein is the number of seconds since Jan 1, 1970, the same as returned by the Unix system call time().
  • If you input something like "zork+orig" to a "-prefix" option of a 3d* program, you would get a dataset with a name like "zork+orig+orig.HEAD". This is annoying (to me, anyhoo). The software now checks for this, and cuts off the extra "+view" suffix.

Today is the 39th anniversary of the murder of President Kennedy. I was 9 then, and I remember our neighbor coming over to tell us what happened. I was eating lunch at home. School that afternoon was very subdued.

Jaguars, Mosaics, yada yada yada
 - 13 Nov 2002 [version 2.51e]

More Micro Mutations
 - 08 Oct 2002

  • 3dAFNItoANALYZE has been modified to allow the output of 4D ANALYZE format files from AFNI 3D+time or bucket datasets.
  • You can now use Shift+Button1 to draw in the "Draw Dataset" plugin. (Button2 is hard to use if it is on a wheel mouse.)
  • I modified the "Draw Dataset" plugin to have 2D and 3D neighborhood drawing modes, which effectively let you draw with thicker lines.
    • 2D neighborhoods are in the drawing slice only.
    • 3D neighborhoods extend out to neighboring slices, and so it is best to be displaying a 3x3 image montage when using these (so you can see what the out-of-slice results are).
    • The largest 2D neighborhood is the 5x5 square of voxels about the drawn point. The largest 3D neighborhood is the 5x5x5 cube of voxels about the drawn point. If you want to draw larger blobs, see the Addendum, infra.
  • Doug Ward fixed a bug in the deconvolution plugin that would cause it to crash if the baseline was turned off.
Plus, I returned from a trip to Machu Picchu. Visiting the Intihuatana at the vernal equinox was quite interesting, at least from a sociological/anthropological point of view.

16 Oct 2002 Addendum
I've added "2D Circle" and "3D Sphere" modes to the drawing plugin, which let you choose the radius (in mm) of the ball that will be filled in by the drawing value. [Per the request of Brian Knutson of Stanford.]
Bugs Squashed
 - 10 Sep 2002

  • A bug in the DICOM file input function has been fixed. This bug only showed up when reading a large number of files on the to3d command line. It could cause the latter files to fail to be opened, or could cause the X11 server connection to fail.

  • A bug in a dataset creation macro was fixed. This probably doesn't affect any existing program, but did affect something under development.

ANALYZE This Again!
 - 29 Aug 2002

  • AFNI has been modified to read ANALYZE-75 .hdr/.img file pairs directly as AFNI datasets.
    • Since there is no easy way to determine the orientation of an ANALYZE-75 image from the .hdr file, AFNI assumes that these files are oriented with x=Left-to-Right, y=Posterior-to-Anterior, and z=Inferior-to-Superior (i.e., LPI axial slices). This assumption can be modified by setting environment variable AFNI_ANALYZE_ORIENT.
    • ANALYZE files that have 4 dimensions will be loaded as 3D+time datasets.
    • ANALYZE files that have the string "stat" in their name will be loaded as functional (fim) type datasets; all others will be loaded as anatomical type datasets.
    • In particular, AFNI will now load the output files of a FSL FEAT directory (normally named something.feat; cf. this). It will try to read the *2*.mat files to allow you to overlay the stat functionals on the highres and standard anatomicals.
      • A useful trick to check the alignment is to make a copy of example_func that will be read as a functional dataset; then you can semi-transparently overlay this on the anatomicals. The commands
          cp example_func.hdr example_stat.hdr
          cp example_func.img example_stat.img
        will do the trick.
      • All FSL FEAT datasets read are presumed to be aligned with example_func, except for highres and standard.
    • This stuff is still very alpha, and likely has rough spots. In particular, I'm sure the FSL FEAT stuff will have trouble with data that isn't stored in the LPI axial orientation.

  • AFNI now prints (to stderr) a warning message when it loads a "large" .BRIK from disk. The default threshold of "large" is 100,000,00 bytes, but this can be altered by the environment variable AFNI_LOAD_PRINTSIZE. The only function of this message is to let you know what is happening when disk I/O may take a long time.
  • A modification to the use of malloc() on Linux seems to make it work better when allocating large numbers of large blocks of data (as happens with large multi-volume datasets).

03 Sep 2002 Addendum
I have added program 3dDespike, which is intended to remove large spikes in 3D+time datasets. Usage and methods documentation can be found at this page.
Bug Bashing, etc.
 - 16 Aug 2002

  • The following bugs have been squashed (or at least stunned a little):
    • On some systems, closing an image viewer that had a dialog ("Disp" or "Mont") window open would cause AFNI to crash.
    • On some systems, when a graph viewer opened, it would display garbage until the user did something to force a redraw (e.g., resize).
    • When an image viewer window was first opened, it would actually sometimes repaint the image 2 or 3 times. This was due to a timing issue between AFNI and the X11 server.
  • 3dToutcount now writes the output of the -save option as a (time-dependent) FIM functional dataset, rather than an anatomical type. This makes more sense, so you can show the "outlier-ness" of a point as a color overlay on the image time series, and then jump to that point in a graph viewer to see what's screwy about it.
  • The angle and shift ranges on the Nudge Dataset plugin have been enlarged.

19 Aug 2002 Addendum
The problem with Cygwin has been fixed. You should be able to compile and run AFNI on this platform now. We are not supplying binaries for Cygwin.
The new "Control Surface" button lets you control the color of surfaces that have been transmitted to AFNI from SUMA.
Miscellaneous Micro Modifications
 - 07 Aug 2002

  • 3dToutcount has a new option "-polort", which lets you detrend each voxel time series with a polynomial, prior to looking for outliers. Detrending is done with robust L1 regression (described below).
  • Sympathetically, new plugin L1_fit lets you do L1 fitting to time series graphs, much as plugin LSQfit does with L2 (least squares) fitting. The new plugin controls the "Tran 1D" function of the same name, which determines the model that will be fit.
    • L1 regression is done with the CL1 function by Barrodale and Roberts (TOMS 552).
    • The goal is to minimize the error measure in a model fit to data, as given below:
                N-1 |   M-1                          |
          E = Sum   | Sum   ( A[i,j] * y[j] ) - z[i] |
                i=0 |   j=0                          |
      for a given matrix A and N-vector v, by finding the appropriate M-vector y.
      • This is a model fitting the weighted sum of M given reference vectors (the columns of A) to a data vector.
    • L1 regression is conceptually similar to least squares regression, wherein the absolute value term (|...|) in the formula for E is squared. However, using the 1st power instead of the 2nd power of the difference between the model and the data means that a few outliers in z won't grossly influence the fit. (E.g., if z[12] differs from the model 10 times as much as the other values in z, it counts 100 times as much as each other datum in L2 regression, but only 10 times as much in L1 regression.)
    • For example, the sample median is the L1 fit to the model with M=1 and A[i,0]=1 for all i (the constant model). The sample mean is the L2 fit to the same model. If one value in z is grossly wrong, that doesn't affect the median at all, but can arbitrarily corrupt the mean.
    • This robustness property is why L1 regression is used to remove the baseline trend in 3dToutcount, since a few "wild points" won't affect the results much.

  • Starting AFNI in a directory with no anatomicals but with functionals used to fail. Now the first functional will be copied as a warp-on-demand anatomical dataset to let you view something.
  • The realtime plugin, and rtfeedme, have been modified to allow multiple image channels to flow into AFNI. See README.realtime for the details (look for the NUM_CHAN control parameter).
  • A bug was fixed that caused the graphing windows to crash on occasion on some computers.

09 Aug 2002 Addendum
  • I've also added "Load" and "Save" buttons to the Talairach Atlas Colors control panel. "Save" lets you save the current color selections to a file; "Load" lets you read them in.
  • Also, if you set the environment variable AFNI_TTRR_SETUP to the name of a saved color file, this will be loaded when you open the Atlas Colors panel.
    • Even with this autoload option, you still have to open the Atlas Colors panel before "See TT Atlas Regions" has any effect.
    • As usual, you can put the definition of AFNI_TTRR_SETUP into your .afnirc file. However, be sure to use an absolute path (e.g., /home/rwcox/.afni_ttcolors), since otherwise the file will be read relative to the directory in which you start AFNI.
  • The format of the saved color file is a simple set of equations, such as
        Hippocampus = red
    (one equation per line). You could manually edit this file. Note that the color names must be drawn from the labels on the palette defined on the standard AFNI color menus. Region label names that contain blanks have the blanks replaced by underscores, as in
        Middle_Occipital_Gyrus = blue
    Not all regions need be present in the file; regions that are absent will not have their color setting changed when the file is loaded.

 - 22 Jul 2002

Program to3d can now read DICOM files. Since we don't use DICOM here (as far as I know), this facility has not been extensively tested.

  • The input function should read both the DICOM Part 10 format and the earlier ACR/NEMA format.
  • The code can only deal with 1 sample per pixel monochrome uncompressed images.
  • Tags that are required, or images won't be read:
    • 0028 0010 "Rows"
    • 0028 0011 "Columns"
    • 0028 0100 "Bits allocated" (must be 8 or 16)
  • The code can set the voxel dimensions, slice location, and orientation, if the appropriate tags are present in the file.
  • The DICOM input function does not use the Rescale or Window tags to modify the data.
  • I'm not sure if it handles multislice or time-dependent data files correctly, since I didn't have many samples of these. Nor do I have samples from many scanner vendors.
  • This code is derived from the RSNA/Mallinckrodt Institute sample program dcm_dump_file.c. I am grateful to them for making their code freely available, and to Jack Lancaster of UTHSCSA for pointing this software repository out to me.
I am having network troubles for various silly reasons, and so some binaries will be slow in coming.

Binaries News:

  • The following binaries are being retired (i.e., removed forever) since I no longer have easy access to such systems:
    • hpux_10.20 -- HP-UX 10.20 systems
    • linux_rh60 -- Linux Red Hat 6.0 systems
    • linux_mdk72 -- Linux Mandrake 7.2 systems
    • solaris26_gcc -- Solaris 2.6 systems
    • sgi4k_6.5 -- SGI IRIX 6.5 systems with R4000 CPUs
    • cygwin.tgz -- MS-Windows using Cygwin
  • The following binaries are still present and accounted for:
    • linux_glibc22 -- Linux with glibc 2.2
    • linux_glibc21 -- Linux with glibc 2.1
      • To check your version of the C library, type
        ls -l /lib/libc*.so
        The numbers present after the "libc" string will tell you the version.
    • macosx_10.1 -- Mac OS X 10.1 (soon to be 10.2?)
    • solaris28_gcc -- Solaris 2.8 compiled with gcc
    • sgi10k_6.5 -- SGI IRIX 6.5 compiled with SGI's cc

    • solaris28_suncc -- Solaris 2.8 compiled with Sun's cc
      This has been removed, since it has so many problems. -- 21 Nov 2002

For Goodness Sake!
 - 02 Jul 2002

New program SUMA is released today. SUMA is the AFNI surface mapper. Details about downloads, installations, and usage can be found at the SUMA link at the top of this page. Some propaganda/information:

  • SUMA is a standalone cortical surface viewing program that also has the ability to "talk live" to AFNI.
    • Using AFNI and SUMA together, you can simultaneously display functional activation maps overlaid on 2D image slices, on 3D volume rendered datasets, and on the folded or unfolded cortical surface.
    • You can also be linked to the underlying data time series graphs at the same time -- if you have enough screen space to show so many windows.
    • You will need to download the latest AFNI version (2.50, also released today, or later) for it to interoperate with SUMA.

  • SUMA does not generate surfaces from MRI volumetric data. SUMA can read surfaces created by the FreeSurfer (Harvard/MGH) and SureFit/Caret (Washington University) software packages.

  • SUMA is distributed in C source code form with the rest of the AFNI package.
    • Some pre-compiled binaries are also available at the SUMA download link.
    • However, SUMA depends critically on the OpenGL libraries installed on your system. If you use a binary linked here against a different version of OpenGL than is on your system, things are not likely to work well. For this reason, compilation at your site may be the best solution. YMMV.

  • SUMA uses OpenGL to draw the surfaces.
    • It is best if you have an accelerated graphics card, since OpenGL software-only rendering is slow.
    • We have had impressive results with the GeForce 3 and 4 cards with Linux; these cards require installation of the most up-to-date nVidia device drivers.
      • One advantage of the GeForce 4 card is that it also supports dual-monitor display, which is very useful when you want to display surfaces, volumes, slices, and time series all at once.
    • SGI systems with fast graphics subsystems also work well.
    • We have not had a chance to check SUMA on any accelerated graphics cards in other systems.
    • We do know that SUMA works (slowly) with unaccelerated graphics cards on Solaris 2.8 and Mac OS X 10.1.5.

  • Questions about SUMA installation and usage should be posted to the AFNI message board, and not sent via e-mail.

  • The word "suma" means "good" in the language Aymara, which is spoken in the vicinity of Lake Titicaca in South America.

  • Today is the true Independence Day for the United States of America:
    • On July 1, 1776, Congress debated the motion regarding separation from Britain (which had been moved and temporarily tabled back in May).
    • On July 2, Congress voted for the motion and independence.
    • On July 4, Congress adopted Jefferson's (et al.) Declaration as the instrument of secession.
    • I strongly recommend the book "Novus Ordo Seclorum" by Forrest McDonald, a superb discussion of the intellectual origins of Independence and the Constitution.

SUMA was developed by Ziad Saad, who has been working furiously for the last 6 months on this project. With the right (and not very expensive) graphics hardware, SUMA is a visually stunning program - and a very useful one. I want to thank and congratulate Ziad for his efforts and accomplishments.

SUMA and AFNI talk to each other using an in-development protocol named NIML. For more information on this topic click here.

 - 24 Jun 2002

  • New program 3dANALYZEtoAFNI lets you produce a .HEAD-only AFNI dataset from 1 or more 3D ANALYZE *.hdr/*.img file pairs. This new type of dataset will not have a .BRIK file. Instead, the *.img files will collectively be used as the source of image volumes when the dataset is read in by an AFNI program (which means you can't delete the *.img files!).
    • The input files for 3dANALYZEtoAFNI should not be 4D (or higher dimensionality) files. Each input file stores exactly 1 sub-brick (3D volume) in the AFNI dataset that is created.
    • If some of the sub-bricks are statistical parameters (e.g., t-statistics), then you can attach auxiliary parameters (e.g., degrees-of-freedom) to the resulting dataset .HEAD file using program 3drefit.
    • Note that AFNI programs do not write datasets in this format. They always write datasets in the .BRIK file format.
    • However, you can use 3dAFNItoANALYZE [cf. 29 Nov 2001], to convert a .BRIK formatted dataset to a sequence of ANALYZE format 3D files.
    • The output of 3dinfo applied to a dataset created with 3dANALYZEtoAFNI will include a line like so:
         Storage Mode:    Volume file(s)
      which indicates that the dataset is stored in a list of separate volume files (stored in the .HEAD file attribute named VOLUME_FILENAMES).
    • After you create the dataset 3dANALYZEtoAFNI, you could compress the *.img files with gzip, as in
         gzip -9v *.img
      AFNI will be able to read these in when it opens these files as a dataset; however, other (lesser) software packages probably will not be able to use them in this format.

Working to be Good
 - 18 Jun 2002

Recent efforts have been largely devoted to making changes to prepare for the release of SUMA, the AFNI surface mapper program (to be released by the end of June, we fervently hope). Other changes since the last installment include, in more-or-less chronological order:

  • You can now create RGB-valued datasets using PPM input 2D files to to3d (these could be converted from other image formats using various image conversion programs, such as are found in the netpbm package). In particular, this allows you to compute (outside of AFNI itself) the exact colors you want at each voxel of an overlay.
    • Note that the color pure black (R=G=B=0) will not be overlaid when the dataset is a "fim".
    • You can also input 2D or 3D RGB files to to3d using the 3Dr: input format, similar to 3Df: etc., as described in FAQ #12.
    • New program 3dThreetoRGB lets you create an RGB dataset from 3 input bricks. In this way, you could use 3dcalc to compute the R, G, and B components separately, then combine them to make a funky overlay.
    • At this time, you cannot volume render an RGB dataset, or do much of anything else with it, for that matter. Except display it as an overlay (Function dataset) in a 2D slice viewer window.
  • Program 3dAutomask has been modified somewhat to produce what I think is a better mask.
  • The rendering plugins now have a new toggle button "I" to the left of the view-angle choosers. When "I" is selected, then changes in the angles made by pressing an arrow key are "incremental" in the direction chosen, as opposed to absolute changes in the angles.
    • This lets you spin the brain volume about a chosen anatomical axis (assuming the dataset was correctly oriented in to3d).
    • When you change an angle with "I" selected, the incremental viewpoint is computed and the new absolute angles are recorded in the angle text fields.
  • The "Where Am I?" Talairach Atlas popup now includes a display of the coordinates in MNI template coordinates as well as in Talairach-Tournoux Atlas coordinates. The transformation is the one described at this page.
    • Correspondingly, there is a "Jump to (MNI)" button available on the Button-3 popup menu in the slice viewer windows, when you are in the +tlrc view.
    • If you use 3dclust on a +tlrc view dataset, you can add the command line option -mni to have the coordinates reported in MNI template coordinates instead of Talairach coordinates.
  • 3dclust has also been modified to let you specify the "rmm" parameter as 0 to mean 6 nearest-neighbor clustering, "vmul" as zero to specify no volume editing, and "vmul" as negative to specify minimum volume = abs(vmul)*voxel volume.
  • Program Ifile (by Ziad Saad) is for assembling the files output by the GE RT-EPI pulse sequence into AFNI datasets.
    • Also, Ziad generated a new Saad, little Samia!
  • Changes from Doug Ward:
    • Option -stim_base was added to 3dDeconvolve (and the Deconvolution plugin). This allows the user to specify which input stimulus functions are to be included as part of the baseline model.
    • Option -one_col has been added to program RSFgen. With this option, the input stimulus functions are written as a single column of decimal integers (rather than multiple columns of binary numbers).
  • Program 3dZeropad has a new option, -master, which lets you specify that a dataset should be padded/cut down to match the size of another dataset.
  • Several changes to the AFNI image viewer module:
    • The default font size for control buttons in the image viewers has been reduced, and the buttons have been squished slightly closer together.
    • Certain keystrokes, pressed when the mouse cursor is over the image sub-window, can be used to control actions:
      • Q or q: close the window (like pressing "Done")
      • Z or z: change zoom factor (Z increases, z decreases)
      • P or p: turn panning mode on or off
      • C or c: turn cropping mode on or off (see below)
      • I or i: change image fraction (I increases, i decreases)
    • The new environment variable AFNI_CROP_ZOOMSAVE tells the program to cut zoomed images down to the viewing size. The default when saving a zoomed image is to save the entire magnified image, including the parts not visible.
      • This variable can be set in your .afnirc file, or interactively in the Datamode->Misc->Edit Environment pseudo-plugin.
      • This variable has nothing directly to do with the new crop feature, described next.
    • The new "crop" button at the right lets you choose a sub-region of the image to display:
      • Press "crop" (the button will now invert colors);
      • Click and hold down the mouse at the upper left corner of the sub-region which you want to crop to;
      • The cursor will change to a yellow and red diamond;
      • Drag the mouse (holding the button down still) to select a cropping rectangle;
      • Release the mouse button to finalize the crop rectangle (the "crop" button will now revert to normal colors).
      To uncrop (return to the full image), press the "crop" button to invert its colors, then press it again to change it back, without doing the crop region selection. Other points:
      • You can directly select the crop region, without using the "crop" button, using Shift+Button-2. To turn cropping off, just click and release Shift+Button-2, without any dragging.
      • Keystroke "C" or "c" is like pressing the "crop" button.
      • The smallest crop rectangle allowed is 9x9 image voxels.
      • You can select a crop region while showing an image Montage, but if the rectangle you drag crosses sub-image boundaries, the program will insult you.
        • A Montage of cropped images usually is confusing unless you put a colored border between them (using the Mont control panel).
      • Cropping while zoomed will actually crop a larger region than you drag, so that the zoomed sub-region displayed will correspond to the dataset voxels crop region that you selected. The program tries to center the zoomed sub-region on the crop region, but this is not always possible if you selected a crop region that is right up against the edge of the dataset volume.
      • Turning "crop" on will turn the zoom "pan" off, and vice-versa.
      • Switching to a dataset that has a different image size should turn cropping off immediately. However, this may not be immediately apparent if the window is also zoomed, since zooming is not turned off when the image size changes.
      • You can also crop in the volume rendering windows, since these are just further instantiations of the same image viewing module that is used for displaying 2D slices.
      • Saving images from an image viewing window that is cropped will save only the cropped region.
      • The array of numbers that makes up an image is cropped immediately as it is presented for display to the viewing module.
        • This fact means that the auto-contrast computations work only on the cropped image array.
        • This in turn means that the mapping from image numbers to grayscale values is likely to alter when you crop an image, since the min-to-max or 2%-to-98% range of values in the cropped region may not be the same as in the whole image.
        • You can set the numerical-to-grayscale mapping range to a fixed value (thereby disabling auto-contrast) by using the "Choose Display Range" item on the intensity bar Button-3 popup menu. This is discussed more fully in FAQ #8.
  • New program 3dAutobox tells you how many planes on each face of a dataset are all zeros in the mask that would be produced by 3dAutomask - these planes could be cut off the dataset (with 3dZeropad) with little loss of information.
  • New program 3dLRflip flips a dataset left-to-right. This was written because some impaired person gave me datasets to register (via 3dvolreg) that were mirror images of each other.
  • 3dvolreg has a new option -wtrim which can be used to save memory and time when registering large (anatomical) volumes.
    • This option will probably become a default in the future.
    • Also, the -clipit option is now the default in both 3dvolreg and 3drotate; if you don't want this, then you now have to use -noclipit on the command line.
    • The default termination threshold for 3dvolreg has been reduced, meaning that the program will probably iterate a little longer trying to find a better fit.
  • AFNI now includes the RGB cyclic spectrum colors from Ziad Saad. These 20 colors cycle around the spectrum at even increments, and were formerly only available in AFNI if you defined them in your .afnirc file (e.g., copying from the sample AFNI.afnirc file).
    • These colors are now loaded into the functional color overlay "pbar" when the number of color panes is set to 20.
    • One use is for mapping phase delays in retinotopic mapping.
  • New program 3dresample (by Rick Reynolds) lets you re-sample and re-orient a dataset to a new grid. This can be useful when you want to compare dataset gathered at different voxels sizes and/or slice orientations.
    • In particular, it will be used in the scripts needed to use SUMA, when you want to use an Axial SPGR with a surface derived from a Coronal MPRAGE (just to name one possibility).

More Minor Mutations: MINC, Masks, Mac, ...
 - 11 Apr 2002

  • New program 3dAFNItoMINC will write an AFNI dataset out in MINC format.
    • This program requires that the MINCtools program rawtominc be in your path.
    • If you need the MINCtools package, look at I use version 1.0 of the minc package and version 3.5.0 of the netcdf library.
  • New program 3dAutomask will generate a binary mask file from a 3D+time EPI dataset, which is supposed to only include the brain voxels. The output of this program can be used as the -mask input to 3dDeconvolve, for example.
  • Some minor changes to get AFNI working on Mac OS X 10.1.3. (The Web page for AFNI+OS X is not yet updated to reflect these changes.)
  • You can now zoom in/out with the 'Z'/'z' keys in an image window, and toggle panning mode withe the 'p' key.
  • You can now save zoomed images (but the entire image is saved in its magnified state, not just the visible part).
  • New plugin Dataset#N lets you plot multiple extra time series in a graph window (like Dataset#2, but more so).
  • Talairach Atlas "Where Am I" window now shows the (x,y,z) coordinates of the focus point.

Zoom Boom
 - 25 Mar 2002

  • Zooming has been speeded up (quite a lot), by rewriting the image resampling code to use fixed point operations instead of floating point.
  • Save One of a zoomed image now will save the entire image as zoomed (not just the part you see). It will also draw any geometric overlays into the saved image file (e.g., crosshair lines, slice label overlay, and the as-yet undocumented surface-slice intersection overlay).
    • To get good resolution on the geometric overlays, you may need to save them when zoomed.
    • Geometric overlays can be turned on/off from the Button-3 popup menu attached to the intensity bar to the right of the image.
  • You can now have the crosshairs drawn with a geometric overlay instead of a voxel overlay. The advantage is that such crosshairs are always only 1 screen pixel wide, no matter how much you expand the image window or zoom level. This feature is activated by setting environment variable "AFNI_CROSSHAIR_LINES" to "YES".
    • This variable can be set at runtime in the Datamode->Misc->Edit Environment pseudo-plugin, or in your .afnirc file.
    • In the future, this may become the default way of drawing the crosshairs.

The Ides of March (Almost)
 - 13 Mar 2002

A number of small to medium sized changes since FDR was introduced in February. In temporal order of the changes to the source code (ignoring small bug fixes):

  • The Histogram plugin now lets you write results to a file (changes courtesy of V Roopchansingh of MCW).

  • Doug Ward has added some new wrinkles to 3dDeconvolve:
    • The "-tout" option was extended in order to write a t-statistic sub-brick for each of the GLT linear combinations. That is, if the -tout option is used along with the -glt option, then the output bucket dataset will contain one t-statistic sub-brick for each row of each GLT matrix.
    • The "-nocout" option can be used to suppress outputs for the individual coefficients in a model. In this case, you will want to use "-glt" to specify the statistics you want to save.
    • Option "-polort -1" can be used to specify that no baseline parameters be used in a model. This would be appropriate for cases where the baseline was removed previously by some other program.
    • Option "-nobout" can be used to suppress saving into the bucket dataset the baseline parameters and statistics thereof.

  • to3d was modified so that if the "-2swap" option is present on the command line, but the image reading routines auto-swap the image data, then the images won't be byte-swapped again. (Such auto-swapping only occurs with GEMS I.*, Siemens *.ima, and ANALYZE *.img files.)
  • Pressing the 'q' key while the cursor focus is in an image will cause the image viewer window to close. This makes the image viewers be a little bit more like the graph viewers.
  • If you start AFNI with a list of directories that don't actually have datasets, the old behavior was to ignore that list entirely and create a "Dummy" dataset and session in the current working directory ("./"). The new behavior is to make the dummy session be the first directory on the command line. [Only of real interest to users of the realtime plugin.]

  • The image viewer windows have a new "Zoom" feature, controlled by the new "Z" button on the right edge. You can zoom in by a factor of 2, 3, or 4. The "pan" button underneath the Z button lets you move the zoomed image around in its window. Use the BHelp feature on these buttons to see the details on how to pan.
    • You can combine this feature with the Draw Dataset plugin when drawing ROIs to make precise selection of the regions a little easier.
    • This feature was implemented very quickly, and as a result isn't that fast or slick. (My actual motivation was to provide functionality for viewing the details of the intersection of cortical surface models with a slice plane; see the Preview below.)
    • Zooming is implemented by rendering the entire magnified image into an X11 Pixmap -- an off-screen window stored by the X11 server. Then, as needed, pieces of this are copied into the visible image window. This copying operation is very fast -- since it is done entirely by the X11 server -- so after the zoom level is established (the slow part), panning around is quite quick. However, this approach means that if you have several zoomed image windows open at once, you can consume a lot of memory in the X11 server. On some systems, this will cause unpleasant problems, such as crashing AFNI (benign) or crashing the X11 server (bad). If this problem arises, you should avoid zooming more than a factor of 2 or 3.
      • Consider a 1000x1000 image window, zoomed up by 4. The Pixmap would be 4000x4000, or 16 million pixels. If each pixel is 3 bytes (a 24 bit visual), this would occupy 48 megabytes of memory. Do this too much, and the X11 server will likely be very unhappy with you (e.g., crash).
    • At this time, "Save", "Mont", and "Rec" do not interoperate with zooming.

  • Rick Reynolds has put out a new version of the volume renderer. It is still being worked on, and has some rough edges. However, it is not based on Volpack, and so should be more extendable than the old one. We plan to integrate volume rendering more closely into the AFNI experience, allowing display of non-cubical non-axial datasets, adding rendering projections such as MIP, etc. Stay tuned to this spot for the latest news.

  • New environment variables by the millions! As usual, see README.environment for the details.
    • "AFNI_GRAPH_TEXTLIMIT" can be used to make the Button-3 popup window in the graph viewers be a scrollable text window instead of a spring-loaded menu pane. This is useful if you use the Deconvolution plugin, and get so many lines of text output that they don't fit on the screen anymore.
    • "AFNI_GRAPH_BASELINE" and "AFNI_GRAPH_GLOBALBASE" let you change the default mode of the graphing baseline. This is useful for users (such as Mike Beauchamp) who want to start AFNI already set up for global baselines with a base of 0, for example.
    • "AFNI_VALUE_LABEL" lets you specify that the dataset value label at the bottom of the Define Function control panel will be turned on even if only 1 or 2 image viewers are open. (The default is that all 3 image viewers must be open.)
    • "AFNI_FIM_IDEAL" lets you specify the name of the initial FIM ideal timeseries file. [Only of real interest to users of the realtime plugin.]
    • "AFNI_KEEP_PANNING" keeps the zoom panning mode turned on until you explicitly turn it off -- the default is to turn panning mode off after you release mouse Button #1.

At this moment, the only binaries available are linux_mdk72, solaris26_gcc, and solaris28_gcc. The other platforms for which I have customarily compiled AFNI (IRIX and HP-UX) are at my former employer (MCW), and I no longer have access to those systems. On the brighter side, I'm close to getting my own SGI and Macintosh, so I'll be able to support those systems better than in the past.

Preview of Coming Attraction:
We (Ziad Saad and I) are working hard on incorporating the display of surface models into AFNI. The models will be imported from other software (e.g., SureFit, FreeSurfer). You will be able to view functional overlays on the surface dynamically linked to the AFNI functional overlays. This is where the bulk of our efforts is going now. We hope that the alpha-test version of this will be available sometime in April. (But in software, the best laid plans gang aft agley, even more than in other human or rodent endeavors.)

Franklin Delano
 - 01 Feb 2002

  • Doug Ward has contributed a new program 3dFDR, which implements the False Discovery Rate (FDR) algorithm for thresholding of voxelwise statistics. Instead of controlling for alpha (the probability of a false positive anywhere in the volume), the FDR algorithm controls for the proportion of false positives relative to the number of detections. The documentation is available in the new file

  • Doug has also made a few changes to 3dDeconvolve (instigated by the notorious Luiz Pessoa).
    • The -nlast input option has been modified so that it always has the same meaning (i.e., whether or not the -nodata option is in effect). Thus, for concatenated runs, -nlast indicates the last data point that will be used from each individual run within the concatenated dataset.
    • The screen output from 3dDeconvolve (and the Deconvolution plugin) has been extended to include the p-values for the individual IRF coefficients (previously, p-values were reported only for each stim function). Also, when the -glt option is used, the t-statistics and p-values are reported for each row of the GLT matrix (previously, F-stats and p-values were reported only for the entire GLT matrix).

  • A bug was fixed in AFNI that could result in the Define Function control widgets not being set up correctly when viewing the same functional bucket dataset in 2 separate AFNI control windows.
  • New program 3dAutoTcorrelate takes as input a 3D+time dataset and produces as output an anatomical bucket dataset where sub-brick #n is the correlation of voxel #n with all other voxels. This can produce gigantic datasets, so should only be used on 1- or 2-slice datasets (which you can cut out of larger datasets using the 3dZeropad program). This program was produced at the instigation of the notorious Peter Bandettini (dude, where's my bagel?).
  • Slice image viewers in AFNI now can display interslice projections. These are controlled from the Disp control panel, as usual, with the new Project menu. You can choose the projection slab width (e.g., plus/minus 3 slices), and the projection function (e.g., Minimum, Maximum, Mean, Median). This function may be useful for viewing MRA datasets.
  • Since the Disp control panel is getting so big, some people have complained it overflows the screen height. You can force it to be enclosed with scrollbars by setting the environment variable AFNI_DISP_SCROLLBARS to YES.
  • This version is labeled "2.40d" and is dated "01 Feb 2002".

The End Times Approach
 - 09 Jan 2002

I have ported most of AFNI to run under the Cygwin Unix emulator on Microsoft Windows. The link that describes what you must do to install/run AFNI on Windows is at the top of this page. Please let me know (via the Message Board) what your experiences are with this port, and if you wish it to be maintained in the future.

Happy New Year Redux
 - 02 Jan 2002

The distribution tar+gzip archives for AFNI have been renamed to afni_src.tgz (unpacks into afni_src/) and afni_doc.tgz (unpacks into afni_doc/). This is partly because the year 1998 is fairly long gone by now (and thus the old afni98.tgz and AFNI98/ are anachronistic), and partly because I've been reorganizing the way I keep files stored here (e.g., I now use CVS instead of RCS). The files in afni_src/ are somewhat rearranged from those in the older AFNI98/ directory.

Happy New Year
 - 27 Dec 2001

  • The GE I.* image file reader in to3d now properly reads and sets the x-axis and y-axis offsets, which are useful when using non-centered 2D images acquired by surface coils.
    • The other image input methods (ANALYZE *.hdr and Siemens *.ima) do not set x- and y-offsets in to3d. I don't think that information is present in the ANALYZE format, and don't know where it is in the Siemens format. (If someone would enlighten me and give me some sample off-center images, that would be useful.)
    • Also in to3d, the default anatomical type for a 3D+time dataset has been changed from SPGR to Echo Planar. This has no impact on anything, since the anatomical type of a dataset is not used anywhere, but makes more sense to me (and I am the arbiter of sense).
  • If you set the environment variable AFNI_GLOBAL_SESSION to the name of a directory with datasets, then copies of these datasets will appear in each AFNI Switch Session chooser. Since the datasets in each session are presumed to be aligned in space, the only useful function that I can think of for this capability is to put some common Talairach (+tlrc) datasets in this global directory. You could then use such a dataset as a universal anatomical underlay, for example.
    [Suggested by Sally Durgerian of MCW.]

One More Little Thing
 - 12 Dec 2001

It is possible (even easy) to create huge functional bucket datasets using 3dDeconvolve (for example). It can get to the point where the option menu for sub-brick selection in Define Function is too wide to fit on the screen. I've added two ways to get around this problem:

  • If you set environment variable AFNI_MENU_COLSIZE to a number like 40, then the maximum number of entries in a option menu column will be raised from the default 20. This will make the menus be taller and narrower.
    • If you make the menus too tall, then they won't fit on the screen vertically, of course. On my 1280x1024 screen, 40 is a good number. YMMV.
  • You can also now right-click (Button 3) on the label to the left of a option menu. This action will popup a scrollable chooser that lets you pick an item from the menu (then press Apply or Set to have it take effect).
    • The maximum number of entries visible at once in a scrollable chooser is set by environment variable AFNI_chooser_listmax (if defined) or by AFNI_MENU_COLSIZE.
    • The scrollable chooser menu-substitute is also a handy way to switch between sub-bricks progressively.
    • Note that only one scrollable string chooser can be open at once in AFNI. Thus, if you press something like Switch Session that pops up a chooser window, then the menu-substitute chooser will disappear. This "feature" is a deliberate design decision, made to simplify the program's structure.
  • These changes are documented (a little) in README.environment (as is customary).
The reason these shenanigans are needed is that Motif 1.2 does not provide a "combobox" scrollable menu interface widget. Motif 2.1 does, but AFNI is intended to run on some legacy systems that do not have the later version of Motif. Motif 1.2 does have "tear-off" menus, but in my experience, they tend to crash the program, which is not apparently desirable.

[13 Dec 2001]: If you downloaded the change above before this date, you should re-upgrade. I discovered that if you press Button 2 in an option menu that is itself in a popup menu, then the application and X11 server hang up forever, and you have to go to another terminal to kill AFNI. This problem is independent of these changes (I just happened to discover it now), and appears to be a bug in the Motif graphics library which is used to build the AFNI user interface. I have patched the ButtonPress handler for option menus in AFNI to avoid this problem. (Technical detail: if Button 2 is detected in the event handler for the option menu, then XUngrabPointer is called. This action releases the popup menu, and everything seems to goes back to normal.)

[14 Dec 2001]: Another Motif mouse-click bug: hold down the Ctrl key, and press Button 1 in a blank area of the AFNI controller. This is a very fast way to exit the program. (I found out about this bug on the newsgroup. It is only present on some systems.)

Sorry About That, Chief
 - 11 Dec 2001

  • Late last week, I posted a release of AFNI that would crash in the rendering plugin and maybe a couple other places. I hope that this is fixed now.
  • 3dAxialize has been modified to allow flipping of the input dataset to an arbitrary cardinal orientation (there are 48 of them). This can be useful if you need to present your data to some other program that needs it in LPI order, say (x=Left-to-Right, y=Posterior-to-Anterior, z=Inferior-to-Superior).
  • 3dIntracranial now has a -nosmooth option, to turn off the smoothing of the mask surface. This has some application, but I can't recall what at this moment.
  • 3dTstat can now compute the standard deviation without linear detrending of the voxel time series.
  • The new environment variable AFNI_START_SMALL lets you tell the program to set the initial dataset to be the smallest one in the first session directory. If you use the layout feature to open an image and/or graph window when AFNI starts, then it must perforce load the initial dataset from disk. The "normal" thing is for the initial dataset to be the first in collation (alphabetical) order. If that dataset happens to be huge and compressed, then it might take AFNI quite a while to open. This setting may help you get around this problem.
  • Programs ge_header, mayo_analyze, and siemens_vision are now compiled in the binary packages and by "make totality". They print out header information from GE I.* files, ANALYZE *.hdr files, and Siemens *.ima files, respectively.
  • I changed the cursor shape and color slightly in many places in AFNI. The first person who figures out why (without any hints from Ziad or Rick!) gets a free cup of coffee from me - but you have to be in Bethesda to collect.

 - 04 Dec 2001

With this release, to3d can now read GE Medical System I.* image files (with the "IMGF" magic number at the start of the file). The program can extract the voxel grid sizes and orientations from the image header (the first 7900 bytes or so of each I.* file), as well as the image TR and the spatial offset. If you wish to use the image header's TR, you can set TR to 0 in the "-time:zt" or "-time:tz" command line option. If you do supply your own TR, the program will print out the image file's TR for comparison.

  • The slice thickness of an individual slice will be used as the "z voxel size". If there are gaps between the slices, then you will have to adjust this size to match the slice thickness plus gap, in order to allow the slices to be spatially distributed correctly. (Or you can use the ancient abut program to intercalate slices of zeros.)

  • If you are creating a 3D+time dataset and are presenting the slices in "-time:tz" order, then the z orientation may not be calculated correctly, since it is computed from the slice positions of the first 2 input images. (In particular, this orientation may end up backwards.)

  • Since the combination of the GE header information plus (and the "-time:*" information, if present) is enough to specify a dataset, if you also use the "-prefix" option on the to3d command line, the dataset will be saved without the GUI opening. If you want to have the GUI open up (if only to check that the header information was correct), then you must either omit the "-prefix" option or you must add the "-nosave" option.

  • The new software will automatically determine if the GE file needs to be byte-swapped, as it does with the Siemens and ANALYZE formats. This means that you do not want to put "-2swap" on the to3d command line if you are reading one of these file formats. This new feature may affect scripts that you are using to assemble AFNI datasets automatically; for example, GE images need to be byte-swapped on Intel/Linux platforms, so if you are using to3d on such a system, you might already have "-2swap". This will have to be removed from your script.

  • These changes have only been verified with some images from the 3 Tesla GE scanner here at the NIH. Problems should be reported to me, along with some sample images. Thanks go to David Clunie for his authorship of the Medical Image Format FAQ.

  • Image files reconstructed from GE P-files (k-space data) by home-brew software will not have the proper header, and so will not be recognized as a GE I.* file, even if it has the proper type of name. In that case, you will have to continue using the older methods for getting arbitrary image files into to3d (FAQ #12).

  • Only 16 bit uncompressed GE image files can be read with this software. (These are the only types I have ever seen; the other types seem mostly to be used with CT data.)

  • The new program ge_header will print out some of the information from a GE image file header. This program is not compiled in the default build for the AFNI package; you have to compile it yourself with "make ge_header". Some sample output:
      % ge_header I.67[89]
      File I.678
       nx=64  ny=64  skip=7904  swap=YES  compressed=NO  bits-per-pixel=16
       dx=3.75 dy=3.75 dz=6 slice offset=46 orient=APSI TR=1.65(s) TE=30(ms)
      File I.679
       nx=64  ny=64  skip=7904  swap=YES  compressed=NO  bits-per-pixel=16
       dx=3.75 dy=3.75 dz=6 slice offset=54.5 orient=APSI TR=1.65(s) TE=30(ms)
    where the parameters reported mean
       nx,ny        = image matrix size
       skip         = byte offset of image data
       swap         = YES or NO (data needs to be byte-swapped?)
       dx,dy,dz     = voxel sizes in mm
       slice offset = slice position in mm
       orient       = orientation of this 2D slice
                      AP -> Anterior to Posterior (in this example, x-axis)
                      SI -> Superior to Inferior (in this example, y-axis)
                      LR -> Left to Right, etc
       TR           = repetition time in seconds
       TE           = echo time in milliseconds

Vox Populi, Vox Dei
 - 29 Nov 2001

Two changes made by request from message board denizens:

  • Program 3dclust now has an option "-prefix" which will write out a cluster-edited version of the input dataset. That is, each sub-brick in the output dataset is a copy of the corresponding input, but with all voxels not in a cluster set to zero. This can be used to cluster-edit a bucket dataset from 3dDeconvolve, for example. In this application, you would want to use the "-1thresh", "-1tindex", and "-1dindex" options.

  • New program 3dAFNItoANALYZE will write out the sub-bricks of an AFNI dataset into a collection of ANALYZE .hdr/.img file pairs (one 3D pair for each sub-brick). Coupled with the ability of to3d to read ANALYZE files, this conversion ability should make it relatively painless to interoperate with SPM (to choose a random software package).
As usual, the only real documentation for new features and codes is the output of the "-help" option of the relevant programs.
 - 27 Nov 2001

It turns out that many programs (e.g., SPM) store a scale factor in the "funused1" ANALYZE 7.5 .hdr location. The AFNI image input functions have been modified to allow for this scale factor, if it is positive and not equal to 1.0. This change makes it easier to import SPM-derived images into to3d and thence into AFNI:

  • If you do not want to use this scale factor, then you must set the Unix environment variable AFNI_ANALYZE_SCALE to NO.

  • Values are scaled and then stored back in-place; for example, shorts are stored back into the range -32767..32767, so if the scale factor causes the shorts to be scaled into the range -0.5..0.5, then the result will be that the data is all set to zero.
    • If you set the environment variable AFNI_ANALYZE_FLOATIZE to YES, then ANALYZE .img files will be converted to floats on input to to3d (regardless of the scaling factor).

  • The ANALYZE input function also attempts to detect if the .hdr file was written by SPM. (It does this by looking at the "originator" field.) If it thinks that the file came from SPM, it guesses that the volumes are oriented in order x=L-R, y=P-A, z=I-S, and transmits that information to to3d. Otherwise, no orientation information is passed to to3d, and you must supply the dataset orientation manually (as usual).

  • If you want to see the contents of an ANALYZE .hdr file, then the AFNI program mayo_analyze will print it out for you. (However, this program is not compiled in the pre-packaged binaries; you have to compile it yourself via "make mayo_analyze".)

 - 09 Nov 2001

You can now search the documents at this Web site, using the Search link in the "Main AFNI Links" section (e.g., at the top of this page).

  • Some people have reported a problem with AFNI programs on Linux machines. A program will run out of memory before the system itself runs out of memory. This seems to be caused by a bad interaction between Linux's mmap() and malloc() library functions when a program uses both methods to allocate large amounts (100+ Mbytes) of memory. The solution is to set environment variable AFNI_NOMMAP to YES, preferably in your login script (e.g., .cshrc, .profile) or in your .afnirc file. You only need to try this if you run into this particular problem.

  • You can try the search string AFNI_NOMMAP in the new Search feature to see how often it has been referred to on this Web site.

 - 05 Nov 2001

  • Last time [below] I said there was a problem in Linux malloc() that would cause to3d to crash during outlier checking. Well, that was wrong - it was my fault. The bug has been fixed; the source and binary distributions are available from the usual suspects.
  • In the past, 3dmerge didn't complain if you tried to average together datasets that didn't have .BRIK files - it just silently ignored those datasets. Now it prints an error message and exits.
    • Please note that only the interactive AFNI program can deal with warp-on-demand datasets.

Fine Canadian Minc
 - 31 Oct 2001

  • AFNI programs can now read MINC format image files directly as datasets -- you don't have to run through to3d to convert them to AFNI format. When AFNI starts, it now searches for filenames ending in ".mnc" as well as ".HEAD". You can also specify a .mnc file on a 3dSomething command line as an input dataset.

    • The goals of this effort were to
      • Mollify (or molluskify?) Sean Marrett.
      • Make AFNI easier to use alongside the MNI and MGH toolsets.
    • AFNI programs do not write MINC files.
    • New program 3dMINCtoAFNI can be used to convert a MINC file to an AFNI dataset.
      • If present, the global MINC attribute ":history" is preserved into the dataset's History Note.
    • You can disable the reading of MINC datasets by setting environment variable AFNI_MINC_DATASETS to NO.
    • You can force the conversion of MINC datasets to floats on input by setting environment variable AFNI_MINC_FLOATIZE to YES.
    • No doubt there are MINC files that AFNI won't be able to handle. In particular, the image data must be either 3 or 4 dimensions, and the 3 primary dimensions must be named "xspace", "yspace", and "zspace" (in any order - AFNI determines the orientation of the dataset from the MINC dimension order).
    • If the image data has 4 dimensions, and there are 10 or more points along that axis, then the dataset is taken to be 3D+time EPI; otherwise, it is treated as an anat bucket (MINC datasets are not converted into func datasets at this time).
      • The TR stored in the header of the MINC files that I've seen is not reliable.
      • Slice-dependent time offsets are not set up for MINC 3D+time datasets.
    • To see how AFNI thinks of a particular .mnc file, try running "3dinfo filename.mnc".
    • You cannot use sub-brick selectors with .mnc files in command line AFNI programs. You'll have to use 3dMINCtoAFNI if you want this capability.

  • AFNI has a new command line option "-q" (for "quiet") that will suppress most startup messages that are printed to the terminal.

  • You can download datasets (.HEAD or .mnc files) from Web/FTP servers directly from within AFNI, using the Datamode->Read Web button; .BRIK.gz and .mnc.gz files will be automatically un-gzip-ed when they are read in this way. (Staging of temporary files for FTP and/or decompression is done in the directory defined by environment variable TMPDIR, or in /tmp if TMPDIR is undefined.)

  • One user (Jerzy Bodurka of NIMH) found a problem with to3d's automatic outlier count on Linux. This occurs only when he has 8 slices of 64x64 short images with 512 time points. The program crashes in malloc() about halfway through the outlier check. This seems to be a bug in the Linux C library's malloc(); I can't make this error occur with other image configurations or on other systems, so there is no real way to fix the problem. If this crash occurs with your data, turn off the outlier check with the command line option "-skip_outliers" or by setting the environment variable AFNI_TO3D_OUTLIERS to NO.

  • By mistake, the earliest release of this date had some debugging messages left in a dataset timeseries extraction function. This would result various junk strings starting with "ab" to be printed to the screen (depending on which code was being run). Sorry about that - the stuff at the Web/FTP site has now been fixed.

X Officio
 - 18 Oct 2001

  • Mac OS X 10.0 binaries are now available at the usual download places, under the name "macosx_10.0".
    • Please also read for details about other software you must install to get AFNI to run on OS X.
    • Please note that I don't have a machine with OS X 10.1, so I don't know if (or how well) AFNI runs on that system.
  • The old program FD2 has been modified to run under X11 TrueColor visuals (at long last). This work was done by Andrzej Jesmanowicz of the Medical College of Wisconsin.
  • Plugin menu alphabetization is now the default. If you want the older menu order back (which was loosely based on functionality), you have to set the environment variable AFNI_PLUGINS_ALPHABETIZE to NO (e.g., in your .cshrc or .afnirc file; cf. README.environment).
  • Some changes were made to the interactive AFNI program to make it less likely to crash when it runs out of memory. (Of course, these changes may induce new ways of crashing, or may be totally ineffective ....)
  • Doug Ward has updated 3dDeconvolve as described here.

Drawing Upon New Resources
 - 25 Sep 2001

  • The Draw Dataset plugin has been modified to have 3 new convenient features:
    • You can now create a copy of a dataset on input, and draw on that, rather than drawing on a pre-existing dataset. This basically incorporates the functionality of the Copy Dataset plugin.
    • The new drawing mode Filled Curve lets you draw a closed curve and have it filled with the current drawing value.
    • The new SaveAs button lets you save the current drawing to a new dataset, which will become the current dataset for further drawing.
    I also fixed a bug in the Undo feature: if you used Quit to cancel editing, then restarted the plugin, Undo would no longer work. It does now (I think).
  • New program 3dcopy does what it sounds like: it copies datasets (.HEAD and .BRIK files, and changing the ID code). In this regard, it can be considered a sibling of 3drename (as Unix utility cp is to mv).
  • The 2D image viewer Labels can now be controlled to a limited extent by setting some environment variables, either from the Edit Environment controls (on the Datamode->Misc menu), or in your .afnirc file. Look for the AFNI_IMAGE_LABEL_* variable names in Edit Environment (near the bottom).
  • The HP-UX system on which I compile the hpux_10.20 binaries is down (maybe permanently), so the precompiled binary package for this system is not available.
[02 Oct 2001]:
  The AFNI educational materials page now contains a description of how to use the drawing plugin to create ROIs (item #11).
  The HP-UX binaries are back.
Ceterus Paribus
 - 21 Sep 2001

  • I have fixed a bug in the "Sav1.jpg" (and similar functions) in the image viewers. When an image had no colored pixels, it would be saved incorrectly, and garbage would result.
  • There is a new and experimental feature in the image viewers for 2D slices. You can now have each image get a text overlay indicating its slice position (e.g., 20I, 40.7R). This is controlled from the "Label" item on the hidden Button-3 popup on the image intensity bar (just to the right of the image).
    • Caveat: these overlays are not saved with any of the "Save" functions. Currently, the only way to save these to an image file is to do a window snapshot (e.g., with program xv).
    • Although you can enable Labels in other image viewing windows (e.g., the volume renderer) they won't display anything, since the driving modules for these don't supply label strings to the images when requested.

Mac OS X, et cetera
 - 13 Sep 2001

  • I have ported the AFNI package to Mac OS X (Darwin). Information on how to compile on this platform can be found here. No doubt there will be problems, but give it a try.
  • Experimental new program 3dAnatNudge will try to align a "scalped" (3dIntracranial) high-resolution T1-weighted volume (SPGR, MP-RAGE) to a lower resolution EPI volume. This may or may not be useful; read 3dAnatNudge -help carefully before using.
  • The volume rendering plugin "Color Opacity" menu has a new item "ST+Dcue". This is the same as the "ShowThru" option, with depth cueing added: colored voxels in the back half of the volume will be faded out, giving the impression that they are farther away. Combined with a rotating brain animation, this makes it a little easier to visualize the spatial layout of a complex set of blobs.

Bug Fix Redux
 - 28 Aug 2001

Fixed a bug in 3dTcorrelate that resulted in incorrect Pearson correlations being computed on some types of computer systems (primitive non-Linux systems, that is).

Bug Fix, Et Cetera
 - 24 Aug 2001

  • I have fixed a bug in the outlier message handling in program to3d. In batch mode, the program would try to popup a message window anyway - this is illegal, and would cause a crash.
    • In the words of Maxwell Smart, "Sorry about that, Chief."
    • One user here has found to3d crashing with an "out of memory" message during the outlier count. I think this is due to the outdated Linux system he is using, since I can't reproduce it on a more up-to-date system, but am not sure. If anyone else sees this problem, let me know the details (exact error messages, and system you are using -- from output of uname -a).
    • I have also added an option -save_outliers fname, which will cause to3d to save the outlier count to a 1D file (named fname), which can later be plotted using a command like 1dplot -one fname -- this is intended to let you look at the outlier information after a non-GUI run, without having to run 3dToutcount on the 3D+time dataset.
  • New program 3dTcorrelate lets you compute the correlation coefficient of 2 3D+time datasets, voxel-by-voxel. (Why you would want to do this is good question.)

TTatlas ROI Drawing
 - 22 Aug 2001

I have modified the "Draw Dataset" plugin to allow you to load regions from the Talairach Atlas database into the drawing. For this feature to be active, you must either be drawing in a +tlrc dataset, or in a +orig dataset when the anatomical underlay dataset has a transformation from +orig to +tlrc already defined. Please use this feature with caution; blind adoption of the Talairach Atlas database as defining ROIs for analysis is a very bad idea. You should use it instead as a starting point for manually adapting the ROIs to each subject.

TTatlas fixup
 - 20 Aug 2001

I have fixed a couple of problems with the Talairach Atlas database that is used in the "See Atlas" and "Where Am I?" features:

  • Several errors in the database have been corrected: those involving Brodmann areas 28, 29, 32, 37, and 42 (which I alluded to in an earlier installment).
  • The Nucleus Accumbens is now in the database, and its center of mass in the "Talairach to" feature has been corrected. (I added this myself manually by looking at the Atlas pages; it is a small region, and may not be represented accurately herein.)
  • To use these fixes, you need to not only re-download the AFNI package binaries (or re-compile them from the new source), but also re-download the dataset files TTatlas+tlrc.HEAD and TTatlas+tlrc.BRIK.gz. These files, as before, need to be stored in the same directory with the AFNI plugins (replacing any existing copies of this dataset). If you fetch binaries using wget, then the new atlas dataset will be fetched at the same time. If you fetch binaries or source in .tgz archive form, then you will need to fetch the dataset manually. You can get the dataset files at these URLs: Be sure to "Save Link As..." both files (.HEAD and .BRIK.gz); loading them into your browser is not useful!
  • The current systems for which I compile binaries are:
    Operating System Archive Name
    Hewlett Packard HP-UX 10.20 hpux_10.20.tgz
    Linux Mandrake 7.2 (Intel CPU) linux_mdk72.tgz
    Linux Red Hat 6.0 (Intel CPU) linux_rh60.tgz
    SGI IRIX 6.5 (R10000 CPU) sgi10k_6.5.tgz
    SGI IRIX 6.5 (R4400 CPU) sgi4k_6.5.tgz
    Sun Solaris 2.6 solaris26_gcc.tgz
    Sun Solaris 8 solaris28_gcc.tgz

    This list is subject to change at any point in the space-time continuum (including the past).

to3d Outlier Check
 - 16 Aug 2001

  • Many more programs now log their usage to the ${HOME}/.afni.log file.

  • When creating a 3D+time dataset, to3d now checks the voxel time series for outliers, using the same method as program 3dToutcount (described in 3dToutcount -help). If any sub-brick has a "significant" number of outliers, then this fact is reported. If to3d is being run with the graphical user interface, then a graph of the outlier count vs. sub-brick index is popped up. These default behaviours can be turned off with use of the environment variable AFNI_TO3D_OUTLIERS; see the output of to3d -help for details. A sample display is shown in the image below:

    outlier graph

    In this particular example, the large number of outliers in the early images is due to the initial transient equilibration of longitudinal magnetization, the spike at about sub-brick 33-34 is due to a sudden head movement, and the general rise in outliers after #53 is due to my deliberate replacement of slice #13 with slice #12 (mimicking an error in the scanner's reconstruction software that sometimes occurs here; which is why we prefer our own reconstruction software).

    The horizontal red line near the bottom of the graph is the threshold for reporting a sub-brick as having a "significant" number of outliers. After the outlier counts are computed for each sub-brick, their median and median absolute deviation (MAD) are computed. The red line threshold is set at median+3.5*MAD.

Minor changes
 - 14 Aug 2001

  • New programs 3dZcutup and 3dZcat let you cut datasets up and reassemble them in the slice (z) direction. This could be useful for analyzing very large time series: break them into 1 or 2 slice datasets, analyze them into functional buckets (say with 3dDeconvolve), then assemble the functional buckets back into the full 3D dataset you want.
  • AFNI and to3d can now work with and create single slice datasets. I hope this works for you (i.e., doesn't crash).
  • New programs 3dTqual and 3dToutcount produce "quality indexes" of 3D+time datasets: they measure how "weird" each volume is with respect to the median volume. Sub-bricks that are large in "weirdness" should be examined visually to determine if there is something wrong with them (e.g., large head motions).
  • A number of AFNI programs now log their usage to a file named .afni.log in the user's home directory. If you wish to disable this feature, set the environment variable AFNI_DONT_LOGFILE to Yes. The purpose of this log file is to help you recall what you did in the past. As time goes on, more programs will include this feature.
  • The new "Save Anim MPG" toggle (on the image viewer Disp panel) lets you save an image sequence to an MPEG-1 video file. This uses the UC Berkely program mpeg_encode, which is not made by the default AFNI "make totality"; however, you can manually do "make mpeg_encode; mv mpeg_encode bindir/" to compile your own copy. (Copies are in the wget binary directories for all the systems I currently support.)
  • You can now impose a global baseline for graphs, using the new pullright "Opt->Baseline" menu in an AFNI dataset graphing window.
  • You can also set the Double Plot timeseries to be treated as a value to be added and subtracted to the data timeseries graph, rather than as an overlay. This is controlled from the new "Opt->Double Plot" pullright submenu in an AFNI graphing window. I use this for plotting the 3dDeconvolve -iresp output with -sresp generated error bands around it.

Talairach Atlas Stuff Fixes
 - 01 Aug 2001

  • I have fixed an error with the Talairach Daemon rendering that prevented some people from seeing the Atlas regions overlays in 2D image or 3D rendering windows. Also fixed a bug in the "Where Am I?" window that could cause AFNI to crash. Sorry about any trouble, and hope these features work for you now.
  • Added a new option to waver, so that you can specify the hemodynamic response function with an arbitrary 3dcalc-like command line expression.
  • Added a popup hint to the intensity bar in a 2D image window, so that it shows the voxel values that are mapped to the intensity bar's gray/color scale.

More Talairach Atlas Stuff
 - 27 Jul 2001

  • AFNI now has more features that use the Talairach Daemon database from San Antonio. These are addition items on the Button 3 popup menu in the 2D slice image viewer window:

    • The "Where am I?" feature will show you what anatomical structures in the database are within 7 mm of the current focus (crosshairs) position. This feature only works if you are currently in +tlrc coordinates, or in +orig coordinates in a dataset that has a transformation to +tlrc already defined.
    • The "Atlas Colors" feature lets you overlay the regions from the database onto 2D image viewers and the volume rendering plugin. This feature requires that you be viewing datasets in +tlrc coordinates at 1 mm resolution (the default).
    • Note well that these features are enabled only from the 2D slice image viewer windows; they cannot be enabled from the volume rendering image viewer window.
    To use these new features, you must have the dataset containing the database information in your executable path. This dataset is named TTatlas+tlrc. The simplest thing for you to do is put it in the same place you store the AFNI binaries and plugins. If you retrieve AFNI updates using the wget program, then this dataset is already stored in the binary directories, so you will get it next time you update. If you compile AFNI from scratch, or you copy binary distributions in .tgz archives, then you have to fetch this dataset manually from this directory. You will need to get both the .HEAD and .BRIK.gz files, and put them into the correct binaries directory (don't put them into a normal dataset directory where you keep your data -- AFNI looks for these files in the path).

    Warning: You must not rely completely on the Atlas database for identification of anatomical regions. Each brain is different. Also, there is no guarantee that the database is a perfect representation of the Talairach-Tournoux Atlas.

    • In particular, I believe there are some problems with a few of the Brodmann Areas (28, 29, 32, 37, and 42).
    • The Nucleus Accumbens appears to be missing from this database (but hey, it can't be that important, right?).

  • The 2D image viewers "Save" function has been altered slightly:

    • The "Save One" option is now in a separate control box on the "Disp" control panel. This lets you save an image montage (which can only be done with "Save One" turned on) in any of the newly supported image formats (e.g., .tif).
      • These formats require the presence on your system of the netpbm programs, which are not supplied with the AFNI package.
    • The new "Save Anim GIF" button lets you save a sequence of images to an Animated GIF file (which you can put on a Web page for the edification/mystification of the masses).
      • This option requires that you have netpbm installed in your path, plus one of the programs gifsicle (preferred) or whirlgif. These two programs are actually shipped with the AFNI source code, but are not made by default; you can make gifsicle by issuing the command "make gifsicle" once you have selected your AFNI Makefile; then you have to mv the gifsicle binary to the AFNI binaries directory. Or you can download the entire source for the gifsicle package from here, if you want to get the latest version straight from the horse's mouth.
    If both "Save One" and "Save Anim GIF" are turned on, then "Save Anim GIF" takes precedence. "Save Anim GIF" can also be selected from the "Save" button's Button 3 popup menu (but "Save One" can only be selected from the "Disp" control panel).

  • The rendering plugin now selects the upper threshold for underlay bricks more cleverly (at the 99.5% point on the cumulative histogram, rather than always using the dataset maximum). This makes the default rendering more reasonable for T1-weighted underlay images, since a few sporadic ultra-bright voxels won't determine the rendering brightness any more. If you are rendering a dataset where you only want to see the ultra-bright voxels (e.g., MRAs), then you will need to manually adjust the upper threshold ("Top") for your purposes; note that the dataset value range is given at the left of the row with the "Top" control.

  • An example of the combination of all the above changes can be seen here (contains a 1.5 Mbyte animation).

It's Been a While
 - 06 Jul 2001

  • AFNI now incorporates some of the data from the U Texas San Antonio Research Imaging Center Talairach Daemon database. The first manifestation of this is the new "Talairach to" choice on the image window Button-3 popup menu (available only when viewing a dataset in Talairach coordinates, or one that has a transformation to Talairach coordinates defined with it). Choosing this pops up a list of brain structures. Choose one, and the crosshair focus position will jump to the centroid of that structure, as defined by the Talairach-Tournoux Atlas.

    • Thanks go to Jack Lancaster and Peter Fox of the RIC at UTHSCSA for providing me with the Talairach Daemon database and with instructions on how to read it. Any problems with this feature of AFNI are of course not their responsibility in any way.

    • Users must be aware of the limitations of the Talairach system -- inter-subject variability is about 7 mm (root-mean-square), and possibly higher in some cortical regions far from the commissures (e.g., occipital lobe). Thus, it is not wise to depend solely on this feature for anatomical navigation through the human brain. It will get you close, but the final identification is up to your visuo-cognitive system.

  • Doug Ward has made a number of changes to the 3dDeconvolve package. These are too numerous and involved to list here, but are documented at this page.
  • The Save button on the image viewing windows now lets you save to a variety of other image formats, if your system has the netpbm package of image conversion filters installed (and if they are in your path). Choosing the image save format is done from the Disp control pane, or from a Button-3 popup that is now "attached" to the Save button.
  • New program strblast lets you replace identifying strings buried in binary files. This is useful if you plan to distribute raw image files from MRI scanners, which often have the subject's name inside them somewhere.
  • Program 3drotate can now take its rotation+shift parameters from a file, rather than from the command line (per the request of David Glahn of UCLA).
  • Program waver has a new option -tstim, which lets you input only the stimulus times. This is supposed to be an aid to making reference .1D files for use with 3dDeconvolve, 3dfim+, or other analysis programs.

More Smallish Changes
 - 01 May 2001

  • A new button is on the image viewer windows: "Rec" (just to the right of the "Done" button). This menu button lets you record a sequence of images and save them for display in a new image viewer window. As each new image is displayed in the master image viewer, a copy is saved to the recording window. Once you are satisfied with the sequence of recorded images, you can save them to disk. In this way, you can save animations of images as you change some viewing parameter (e.g., correlation threshold, or overlay color rotation). At present, the only detailed documentation is displayed when you use "BHelp" on the "Rec" button.
  • A potentially fatal bug in 3dAttribute was fixed.
  • to3d now prints an error message if it can't find an image file specified on the command line.
  • Doug Ward has added the new program 3dExtrema, which finds local maxima (or minima) in a functional volume. The documentation is in file or 3dExtrema.pdf.
  • Doug also added some features to program RSFgen (for generating random stimulus patterns). It is documented in file or 3dDeconvolve.pdf.

Smallish Changes
 - 20 Apr 2001

Source and binaries for these changes are available now. New binary packages are available at this time:
  linux_mdk72 = Linux Mandrake 7.2
  solari26_gcc = Solaris 2.6 (SunOS 5.6)
The following binary packages are no longer being updated, since I do not have access to machines of this type:
  hpux_10.20 = HP-UX 10.20
  linux_rh52 = Linux RedHat 5.2

  • New program 3dRowFillin lets you fill in skipped slices when doing ROI drawing - this capability is also in the Draw Dataset plugin. You can now draw on every third slice (say) and then have the gaps filled in by the program or plugin. (You'll probably have to clean up the results afterwards.)
  • The "-@" switch has been added to a lot of programs, which lets you extend the command line. See FAQ 32 for more details.
  • A problem with the Linux malloc() library function was discovered and worked around. This affects programs that allocate large numbers of large blocks of memory.
  • New program 3dToutcount tries to estimate the number of "outliers" in 3D+time datasets. [This program is based on a brief discussion with Bill Eddy of CMU and is subject to change!]
  • The Define Function control panel has a new item: the "Rota" buttons, which let you rotate the colors on the color pbar. This is great for making dynamic images. (Now just have to get a way to save them.) Also, added "hints" (AKA "tooltips") to the color pbar to show the range of values in each color pane. [Per the suggestion of Ziad Saad of NIMH.]
  • Fixed another potentially fatal (SEGV) error in 3dvolreg [pointed out by Tom Ross of MCW].
  • Added -sum and -sqr options to 3dMean, to provide a faster-than-3dcalc way to sum dataset values (and sum the squares).

Excitement Beyond Measure
 - 15 Apr 2001

The new AFNI Web/FTP server is up!

Oops, Et Cetera
 - 15 Mar 2001

  • A bug in the new 3dvolreg could cause the program to crash with a Segmentation Fault or Bus Error. This has been fixed (I hope).
  • The volume rendering plugin now lets you render the crosshairs in the color overlay, which means you can let them "Show Thru" the brain. For details, read the "Help" text for the "See Xhairs" control.
  • to3d can now read Siemens Vision .ima image files. I only had one example of this format, so am not sure it will work for all such files. Program siemens_vision will print out information from the header of a .ima file.

Somethings Else
 - 07 Mar 2001

A set of small-ish additions to the last week's update:

  • 3dTsmooth now has a new set of options, allowing you to use Blackman or Hamming windows for lowpass filtering of 3D+time datasets.
  • New environment variable AFNI_AUTOGZIP allows you turn on write compression ("gzip -1") only for datasets that will compress about 80% or more (e.g., mask datasets).
  • You can use the special filename "ALLZERO" when inputing via the 3D: mechanism to to3d -- this will let you create a dataset of all zeros with a specified geometry very easily. (If you want to create a dataset of all zeros that is a geometrical copy of an existing dataset, you could use something like
        3dcalc -a dset+orig -prefix zero -expr "0"
    This is a brute force approach, but works.)
  • AFNI now lets you overlay the color function on grayscale slices in a translucent fashion. The opacity of the overlay is controlled in each image/slice viewing window by a new control at the right edge of the window (just below the "i" image fraction control). The default is still opaque overlays (indicated by "9" on the control), but smaller opacities will let some of the grayscale anatomical underlay show through -- a setting of 4-6 seems to produce nice combinations. (This control is only available if you are using an X11 TrueColor visual. Still using PseudoColor? Too bad.)
  • In most programs, the -prefix option now lets you redirect the output into another directory, as in "-prefix ../fred" to put the new dataset into the parent directory of the current location.
  • 3dTstat now has -min and -max options.

Registration Redux
 - 28 Feb 2001 - AFNI 2.29a

Many new things, small and large, since the previous installment in our continuing story.

  • Many changes to 3dvolreg and 3drotate to make registering data from the same subject on different days better and simpler. Please read file README.registration carefully for important details on how to combine these programs for this purpose. New options include:
    1. -rotparent for specifying that rotation parameters are to be copied from the header of a previously registered dataset (usually an SPGR from the same day, that was registered to a master SPGR)
    2. -gridparent for specifying that the output dataset should be adjusted to fit the grid location of another dataset (usually an EPI from the master session)
    3. -tshift for doing the equivalent of 3dTshift prior to registration (mainly a convenience)
    4. -zpad for zeropadding the volumes on all 6 faces before rotation and then stripping these buffer slices off after resampling to the new grid; the intention is to reduce edge-effect artifacts, especially in Fourier interpolation
    Please note that these registration methods are works in progress, and may not always succeed. It is important to visually examine the results to make sure they are reasonable. [Thanks go to Ziad Saad and Sally Durgerian for testing these additions and providing feedback.]
  • New program 3dZregrid will resample (interpolate) a dataset to a new slice thickness in the z-direction. This is intended to make it possible to register anatomical datasets between sessions when you forgot to specify the same slice thickness (d'oh).
  • New program 3dMean makes it easy to take the voxel-wise mean of a bunch of datasets (3D or 3D+time). This is faster and simpler than using 3dcalc for this purpose. The principal application seems to be averaging a collection of 3D+time datasets prior to analysis.
  • New program 3dOverlap lets you compute the number of nonzero voxels in common in a collection of dataset bricks. The output is a single number. For example, if the input is a single brick, the output is the number of nonzero voxels in that brick. (You can optionally save the count of overlaps from each voxel into a new 3D dataset. This could be useful as a mask in later applications.)
  • New program 3dAttribute will print out values of attributes from dataset header files. The main application of this is for use in scripts, and is intended to help people stop digging through the .HEAD files. [This means you, Ziad.]
  • New program 3dClipLevel is a little toy that tries to estimate the value at which you should clip an anatomical dataset to exclude the background (air) region. This is intended to work on EPI, SPGR, and similar images. You probably want to check the value with some experiments (e.g., with the Histogram plugin) in order to make sure they are reasonable for your datasets.
  • Matthew Belmonte's ( thresholding and permutation test plugins are now incorporated into this release. See file README.permtest for details, and for the paper to cite if you use these items.
  • Program to3d can now read Mayo ANALYZE 7.5 .hdr/.img files. You specify the .hdr file on the command line. [Why support this format? Because some people at NIH use it.]
  • Program to3d also has a new -zpad option, but it is designed to add slices of zeros in the z-direction only. The intention is to make it easier to pad a dataset at creation time, which is useful when doing inter-session registration. This operation can also be carried out later with the new -z option to program 3dZeropad.
  • Program 3dclust now has the -dxyz=1 option, making it easier to form clusters based on voxel criteria rather than geometrical ones. [per the request of Petr Hlustik]
  • Program 3drefit can now zero out the slice-dependent time-offsets using the new option -notoff. This is useful if you have processed a 3D+time dataset in some way that destroys the integrity of these shifts (e.g., done some interslice calculations, such as blurring the dataset spatially).
  • Program 3dmerge now allows input datasets to use the sub-brick selectors [..]. [per the request of MS Beauchamp]
  • Doug Ward has added some options to RSFgen for generating random stimuli patterns using Markov chains.
  • Graphs of anat bucket datasets in AFNI now interact correctly with the anat bucket chooser in Define Function. [per the request of ZS Saad]
  • AFNI image viewing windows now have a minimum size. This helps avoid problems with small datasets that produce tiny windows, which are hard to manipulate. This size is controlled by the environment variable AFNI_IMAGE_MINFRAC -- see file README.environment for details. It can also be altered interactively from the Datamode->Misc->Edit Environment control.
  • You can now interactively add hosts to the AFNI "trusted" list, which is used for accepting connections from realtime image sources and from plugouts. This is done from the Datamode->Misc->Edit Environment control (AFNI_TRUSTHOST item). [Someday this may even be useful.]
  • You can now change the current working directory (CWD) during an AFNI run. This is done from the Datamode->Misc->Edit Environment control (AFNI_CWD item). By default, the CWD is the directory in which you start AFNI. If you want to write files (e.g., Save:One), they go into the CWD. [per the request of ZS Saad]
  • The command line sub-brick selection apparatus [..] has been extended to also allow you to edit the dataset during input; that is, you can set all voxels outside a certain range to be zero. For example:
    will read in the #5 sub-brick of the dataset, and set all values outside the range 100..200 (inclusive) to zero. You can use <..> by itself, or with [..]. For more information on these matters, read the output of afni -help.
  • The mcw_malloc() functions have been speeded up considerably. This makes AFNI start up much faster when there are many input files/directories. [Does this make you happy, Mike?]
  • Several scripts by Ziad Saad have been added to the distribution. These files are useful for automating certain repetitive functions in the AFNI package. Their names all start with the character "@", and they all have -help options.
  • Don't ask how I make up the version numbers -- I don't know where they come from.

 - 23 Jan 2001

A few small changes to the AFNI package:

  • Doug Ward has upgraded 3dDeconvolve to allow for stimulus times that fall in-between TR times.
  • A problem with the layout code has been fixed. If you use layouts and let AFNI run for hours, you need to upgrade. Otherwise, you will find that AFNI starts doing bizarre things. (This problem was discovered by Z Saad of NIMH.)
My new e-mail address is .
 - 21 Dec 2000

The final release of AFNI from MCW takes place today. The source code and binaries are now released under the GNU Public License (GPL). The documentation is released under the Open Content License. This version of AFNI is still copyrighted by the Medical College of Wisconsin, but may be redistributed freely under the terms of the licenses.

The AFNI package will continue to be extended and distributed from the NIH, once I am established there. There will be a hiatus until I can get a new server set up there.

The most visible change when you run AFNI itself is a new logo. Other recent changes include

  • You can now have the buttons on the Plugins menu be sorted alphabetically, by setting the environment variable AFNI_PLUGINS_ALPHABETIZE to YES.
  • The Dataset Copy plugin now has the ability to change the datum type when making a zero-filled copy of a dataset. (This change courtesy of Vinai Roopchansingh of MCW).
  • Program 3dNotes now has an option to replace the History Note - this can be useful if you have some compromising information in there.
  • The -twopass option of 3dvolreg now is more robust in finding displacements due to large-ish head motions between scanning sessions.

Yet again
 - 27 Nov 2000

  • Fixed a bug in 3dTcat with the -rlt+ option. The proper action of this option is to preserve the mean of each input voxel time series. Due to an indexing error, the mean of each time series would be slightly altered.
  • Added option -points to program 3drotate. This lets you compute the transformed (rotated+shifted) points corresponding to a set of (x,y,z) input triples (e.g., cluster centers).
  • You can now make the plugin menu buttons be alphabetized, by doing

Once more into the breach
 - 03 Oct 2000

  • The ROI Average plugin now has a To Disk? option to allow writing of a time series to disk directly.
  • The Nudge Dataset plugin now lets you print out the equivalent command line for 3drotate. Also, the help message now warns of the problem that can occur when nudging a plugin so that values are shifted outside of the 3D volume over which the dataset is defined. (To avoid this problem, the dataset should be 3dZeropad-ed before nudging.)
  • The new -twopass option to 3dvolreg is designed for registering high resolution volumes gathered on the same subject in different scan sessions. It can find rotations up to 10-15 degrees, unlike the standard algorithm.
  • The new -rotcom option to 3dvolreg will print out the equivalent 3drotate command options. You can use this in conjunction with -twopass to register anatomical datasets between sessions, and then apply the same rotations/shifts to the functional datasets. This is intended to make it easier to compare data from the same subject between scanning sessions. (You will probably need to use the new -duporigin option to 3drefit after these operations, so that the adjusted datasets are defined over the same 3D volume in (x,y,z) coordinates.)
  • The AFNI Datamode->Lock menu now has the new IJK lock toggle, which lets you lock together controllers based on the voxel index (i,j,k) rather than the voxel spatial coordinate (x,y,z).
  • New option -dxyz=1 to 3dmerge lets you have the clustering and filtering options behave as if the voxel grid spacing were set to 1 mm, rather than the values in the dataset header. This is useful if you want to define these operations on a voxel-wise basis rather than a coordinate-wise basis.
  • AFNI Graph buttons now work for datasets with no time-axis (but they still must have .BRIK files). When there is only 1 sub-brick, the graphs are replaced with a number in each sub-graph box showing the voxel value.
  • You can now setup the AFNI window layout that is opened at startup. This is done by giving a description in a "layout" file. See README.environment and the new Datamode->Misc->Save Layout button for more details.
  • AFNI now support the Xinerama extension to XFree86. This is used to "glue" multiple video cards/monitors on one system into a super-sized single logical display. (We now have a Linux box with 4 18" 1280x1024 LCD panels at our scanner. If you are interested in the details of getting AFNI to work with such a beast, please contact me.)
  • New program 3dUndump lets you create a dataset from an ASCII list of voxel coordinates and values. This is sort of an inverse to program 3dmaskdump.
  • The binary distributions no longer support Red Hat Linux 5.x. If you are using a Pentium II or above with Red Hat Linux 6.x (or any glibc-based system, I think, including Mandrake 7.x), then you might try the linux_rh61_pgcc distribution. This is compiled with the Pentium GCC compiler, which produces floating point code that is 10-15% faster than the "vanilla" gcc.

Yet more little stuff
 - 10 Aug 2000

  • Additional filtering options for 3dmerge allow you to exclude some voxels from the filtering calculations (using a mask) and to define your own linear filter weights.
  • Edit Environment now allows you to set the AFNI_ENFORCE_ASPECT flag (to overcome a problem with KDE).
  • You can now specify your own image for display in the AFNI splash window. See file README.environment for information.

Do You Like This New Header?
 - 18 July 2000

A few small additions/changes:

  • New program 3dTagalign, in conjunction with the Edit Tagset plugin, lets you align datasets based on manually placed "tags".
  • The order of display of sub-graphs in the coronal and axial graphing windows has been altered when the user has set the environment variable AFNI_LEFT_IS_LEFT. This is to make the graph layout correspond to the pixel order in the corresponding image windows. Before this release, when AFNI_LEFT_IS_LEFT was set, the images were in the coronal and axial windows were flipped but the graphs were not.
  • New program 3dZeropad lets you add planes of zeros to the edges of a dataset. The primary motivation for this is to let you pad older "small" Talairach box datasets to the size of newer "large" Talairach box datasets (the date of change was March 1996).
  • Added the new 2D transformation function 2D Chain. This function lets you chain together several 2D filtering operations. It is controlled from the Datamode->Misc menu.

Ugh - 22 June 2000

  • Doug Ward added a -mask option to program AlphaSim.
  • New environment variable AFNI_BYTEORDER_INPUT lets you specify the byte-ordering assumed for datasets that do not have byte-order specified in their header files (pre May 1998). This can be useful if you are transporting a lot of datasets from Sun/Solaris (say) to Linux/Intel (say).
  • The new Edit Environment item on the Datamode->Misc menu lets you alter some AFNI_ environment variables interactively - which means you don't have to exit and restart AFNI to change AFNI_RENDER_SHOWTHRU_FAC, for example.

Yet More Increments - 16 June 2000

  • The popup menu under the "Inten" label atop the color pbar in an AFNI controller menu has had 3 menu items added.
    • "Save to PPM" will save a color representation of the current pbar to a PPM formatted image file.
    • "Tran 0D" and "Tran 2D" let you apply transformation functions to the functional image slice prior to colorization. You may need to change the "Range" used for the pbar if you use a function such as "Log10".
    In addition, the checked display used for the "none" color has been fixed to work properly with TrueColor X11 visuals.
  • 3dNLfim can now compute the R2 "coefficient of multiple determination" - a measure of goodness of fit of the nonlinear model analogous to the square of the correlation coefficient. This value can be used in the experimental Betafit plugin.
  • Some changes to the Hilbert Delay and Gyrus Finder plugins were made to make them work with SCO Unix. If any problems show up, please let us know!
  • 3dcalc now has a "-nscale" option to turn off the autoscaling that sometimes causes problems (e.g., when computing a 0-1 valued image).

Solaris 2.8 - 26 May 2000

The Solaris machine to which I have access has been upgraded to Solaris 2.8 (SunOS 5.8). Thus, from now on the Solaris binaries which I distribute will be compiled on this system, and will not work on earlier levels of Sun's operating systems. I  have modified the name of the binary file to solaris28_gcc.tgz to mark this change. The wget directory name has also been changed accordingly. Sorry about this, but this computer is not under my control in any way (I've never even seen it).

Incremental Improvements - 19 May 2000

  • Doug Ward has added the -mask option to 3dNLfim, which should make it easier to eliminate unwanted extra-brain voxels from the analysis.
  • The new plugin Dataset#2 controls the new 1D transformation function of the same name. This is designed to let you overlay the graphs of a second dataset onto the usual timeseries graphs of the current anatomical dataset. In particular, it can be used with the output of 3dNLfim -snfit to graph the timeseries fit on top of the original data (using Dataset#2 and Double Plot).
  • Command line program imcutup can be used to cut up image files that are arranged in 2D layouts, so that they can be input into to3d (which requires a 1D string of images). This program was written since I've found that some sites get their 64x64 images back as 4x4 montages in a 256x256 image file.

A New Way to Fetch AFNI - 09 May 2000

A new way to get AFNI (source, binaries, and documentation) is documented on this page. This new method allows you to fetch only files that have changed since you last got them.

FIM+ing - 01 May 2000

A new command-line program, 3dfim+, is now available. Written by Doug Ward, it computes the same things as the FIM+ codes in the interactive AFNI program. Doug has written a manual for the program, which is available from the documentation directories.

Nudging - 19 Apr 2000

A new plugin, Nudge Dataset (plug_nudge.c) is now available. It lets you move a dataset around, via small rotations and/or small translations. It is intended to let you fine tune the placement of one dataset with respect to another.

Lots of Changes in the Last Few Months - 12 Apr 2000

  • New program 3dWavelets by Doug Ward does some basic wavelet time series decomposition on 3D+time datasets.
  • 3dIntracranial now works a little better.
  • You can now add your own function to the FIM+ menu. Usage instructions and sample codes are in the file afni_fimfunc.c.
  • Added some random number generation functions to 3dcalc.
  • Added 3A: input formats to allow to3d to read image data that is formatted in ASCII.
  • Added -median and -MAD options to 3dTstat.
  • Added -sagittal and -coronal options to 3daxialize (thus rendering its name kind of pointless).
  • Some new features of AFNI that you can control using Unix environment variables (cf. README.environment):
    • You can force switching back to "view brick" mode when switching datasets in AFNI.
    • You can specify a system-wide .afnirc-style startup file to be read when AFNI initializes (in addition to the user-specific file).
    • You can specify the darkest level in the grayscale image display.
  • AFNI now allows direct input of datasets, using the new -dset option. See the output of afni -help for information.
  • Some programs now support input of "on-the-fly" calculated datasets. See the section CALCULATED DATASETS in the output of afni -help for syntax details, and the -help options for the various programs to see if this input option is supported.
  • The rendering plugin now allows you to change datasets in script files. Details can be found in the FAQ list at Q65.
  • 3dvolreg (and the corresonding plugin) now has an option -1Dfile to write out the estimated movement parameters to a *.1D formatted file. This can be used as input to FIM as an "ort", which will then cause any residual signal components correlated with the subject movements to be detrended out. This can help correct for interpolation errors.

Bug Fix - 24 Jan 2000

  • Sally Durgerian of MCW discovered a bug in the way that 3dROIstats handles the -mask option. When the 6th character of the dataset name was a numeric digit, the program thought this was a sub-brick selector - this is because it should have been looking at the 6th character of the "-mask###" string, but was using the wrong pointer. This error has been fixed.
  • Program to3d now displays a warning message when short input images (16 bits - the usual kind you get from scanners) contain negative numbers. This can be a sign that the images need to be byte-swapped. (See the answer to Q18 in the FAQ list for more details on byte-swapping.)
  • Program 24swap now allows the specification of areas of the input file that should not be swapped at all.

Are we having fun yet? - 18 Jan 2000

  • Doug Ward has added a few features to programs 3dDeconvolve and RSFgen - the details are posted here.
  • Added a new item "ShowThru" to the volume rendering Color Opacity menu (on the Overlay control panel). This allows you to have the color overlay show through otherwise opaque grayscale underlay voxels. This can be useful or confusing, depending on your mental state.
  • New command line program afni_vcheck will print out the AFNI version it was compiled with, and will also query the MCW web server to see what the latest available version is. This functionality is also available interactively from the Misc menu on the Define Datamode control panel in AFNI.
    [The version at this moment is 2.25b.]
  • A new plugin for scatter-plotting the voxel values from 1 sub-brick vs. another has been created.
  • Program from3d has a couple of new options to let you dump 2D image data out of a dataset more usefully.

Welcome to the Twenty-First Century - 04 Jan 2000

  • The maximum number of datasets per directory has been increased from 192 to 512. The maximum number of directories has been increased from 60 to 80. These changes apply to the interactive AFNI program.
  • The rendering plugin has a new menu item on the Button-3 popup under the Color label in the Overlay control panel. This item is labeled Mixing, and controls how overlay colors are mixed after the ray-based compositing done by Volpack. See the output of the rendering Help button for more information.
  • 3dROIstats has a new option -summary, written by Mike Beauchamp of the NIMH.
  • The FIM+ computations in AFNI now have 3 more options. See the answer to Q41 in the FAQ list for more information.
  • 3dcalc now has a Gaussian random number generation function gran(m,s), which can be useful when making up sample datasets.

One More Thing - 20 Dec 1999

Doug Ward of MCW found that the sub-dataset feature (06 Dec 1999, infra) wasn't properly set up in 3dttest. This oversight has been corrected.

Yet More About Anatomy Parents - 15 Dec 1999

After I wrote the screed about the importance of "anatomy parents", Tom Ross (MCW Dept. of Psychiatry) pointed out that it would be nice if AFNI programs would preserve the anatomy parent relationship when they make new datasets from old. So now they do. If necessary, you can use 3drefit -apar to alter the anatomy parent of a newly created dataset. Unfortunately, this is what you will have to do for datasets created before you installed this update.

Four More Little Things - 13 Dec 1999

  • A bug in the "convert to z-score" routine, as used in 3dmerge -1zscore, was fixed. Values of z larger than 13.0 will no longer be generated. N.B.: The p-value of z=13.0 is less than 10**(-38). That should be unlikely enough for you. [fix requested by Michael Beauchamp]
  • Program adwarp has been modified so that it will not overwrite existing datasets, unless the new -force option is used. [fix requested by Tom Ross]
  • 3dcalc has 2 new functions: lmode() and hmode(). They compute the mode (most common value) of their arguments - they only differ in how they break ties. [change requested by Michael Beauchamp]
  • The ROI Average plugin had a bug when it was being applied to multiple sub-bricks at once. It did not properly re-initialize itself with each separate sub-brick. [fix requested by Rasmus Birn]

One More Little Thing - 08 Dec 1999

New program 3drename is for renaming datasets from the command line - .HEAD and .BRIK files together. See the output of 3drename -help for usage information (it isn't very complicated).

Further Changes - 06 Dec 1999

  • Over the last couple months, a number of command-line programs have been modified to allow input of "sub-datasets". A sub-dataset is a dataset composed of a subset of 3D volumes (sub-bricks) selected from a dataset stored on disk. For example, fred+orig[3..9] would mean the dataset composed of sub-bricks #3 through #9 of the fred+orig dataset. This usage allows you to process only the sub-bricks you want, and it also allows the input of a particular sub-brick from a dataset into a program that expects a single sub-brick dataset (e.g., the inputs to 3dttest). The list of programs that accept such subscripted sub-datasets is
       3dANOVA     3dANOVA2        3dANOVA3      3dDetrend     3dFourier
       3dFriedman  3dKruskalWallis 3dMannWhitney 3dROIstats    3dRegAna
       3dStatClust 3dTcat          3dTshift      3dTsmooth     3dTstat
       3dWilcoxon  3dbucket        3dcalc        3dfractionize 3dhistog
       3dmaskave   3dmaskdump      3dpc          3drotate      3dttest
       3dvolreg    from3d
    The full syntax for sub-dataset selection is described in the ouput of 3dcalc -help.
  • A bug in 3dTshift didn't allow the specification of "-tzero 0.0" or "-slice 0". This problem has been fixed. (Thanks - or curses - to Tom Ross of MCW for pointing this out.)
  • A bug in the volume rendering plugin was fixed. When displaying a functional overlay on a grayscale underlay, switching underlay datasets would cause the images to be rendered badly (essentially invisibly). This error has been fixed.
  • A warning message about datasets without "Anatomy Parents" has been added to AFNI. For details, please read the answer to Q58 in the FAQ list.
  • The text label just below each AFNI image window now displays what AFNI thinks is the orientation of the image being displayed. Specifically, it will say something like "left=Anterior", or "left=Right", indicating its understanding of what anatomical direction is at the left edge of the image window. These labels are based on the image orientation information entered into to3d when the dataset was created (for +orig data). The labels will change correctly (I hope) if you use the Disp control panel to rotate and/or flip the images.
  • Programs 3dclust and 3dROIstats now have "-quiet" options to suppress most non-numeric output. These changes were made by Mike Beauchamp to make it easier to incorporate the text output of these programs directly into spreadsheets. I added a similar option to 3dmaskave.

Additions to 3dDeconvolve, et cetera - 24 Nov 1999

Doug Ward has added a number of capabilities to program 3dDeconvolve. He has described these fully on the (OLD) AFNI Message Board.

Bug Fix, et cetera - 23 Nov 1999

  • Programs AFNI and adwarp did not work correctly when writing out a dataset that was supposed to be written out in a byte-swapped order (relative to the CPU native order). This can occur, for example, if the environment variable AFNI_BYTEORDER is set. The data was actually written to disk in the native order, but the .HEAD file was set to the same as AFNI_BYTEORDER -- the result was unpleasant, since the dataset was now marked as being in a byte order different than it actually was. This error has been fixed.
  • 3dcalc now allows inter-voxel computations, using the new "differential subscripting" option. See the output of 3dcalc -help for the usage details.

Small Changes - 18 Nov 1999

  • New program 3dDetrend is for removing linear trends from voxel time series, using linear regression. The component time series to be removed can be specified as *.1D files and/or mathematical expressions a la program 3dcalc.
  • Program 3dcalc now allows the use of sub-vector selection with the *.1D input option. The list of pre-defined variables has been extended to include 't' (= time coordinate) and 'l' (letter 'ell' = time index).
  • The interactive AFNI program now recognizes a new environment variable AFNI_OPTIONS. If present, the string value of this variable will be placed on the afni command line. This allows you to set things up so that your desired command line options will always be executed, even when you forget to type them. See file README.environment for more details.
  • The code that pops up control windows in AFNI has been modified in an attempt to ensure that such windows are entirely on-screen when they appear. (When they appear partially off-screen, they are a pain to use; eventually, I couldn't take it any more.)
  • Matthew Belmonte of Cornell has contributed a new Makefile for OSF/1 and patched a few programs to work better under this operating system.

Bug Fix - 02 Nov 1999

  • Doug Ward of MCW found a bug in 3dcalc: when using a sub-brick selector of the form "-b3 name+orig" (the older method), and if name+orig is 3D+time, and if it was used as the template for the creation of the output dataset, then the output dataset would be marked as being 3D+time, even though that would not be true (since only 1 sub-brick was being used). This error would prevent the output dataset from being usable. This bug has now been fixed.

    Sub-brick selection of the form "-b name+orig[3]" (the newer method) did not have this problem. In fact, the solution was simply to "mangle" the input from the older method into the format of the newer method.

2 Changes and 2 Additions - 01 Nov 1999

  • Program 3dclust is one of the oldest AFNI programs, and has a somewhat clumsy command line usage, with the rmm and vmul values appearing just before the dataset. This sometimes causes problems, if the user inadvertently puts some command line option (e.g., -1dindex) between vmul and the dataset name. Some warning messages have been added to detect this problem. In addition, a new command line option -verbose will print out some progress information to let the user know what the program is doing.
  • New program 3dTshift allows you to time-shift the voxels in a 3D+time dataset to have the same temporal origin. [Note that using Fourier interpolation (the default method) will not introduce extra serial correlation in the data time series, which is a worry that has been expressed.]
  • New program 1dtranspose is for transposing rows and columns of an ASCII file of numbers like the AFNI *.1D files. For example, you could take the row-wise output of 3dmaskdump and turn it into column-wise output, if that is more convenient for your purposes.
  • You can now set the colors of the buttons on the Plugins menu, using environment variables. Details are in file README.environment, as usual. The purpose of this change is to let you highlight the plugins you use the most, since the size of the Plugins menu is getting kind of long.

Yet More Additions - 18 Oct 1999

  • Added program 3dmaskdump as a command line way to dump out to ASCII values from datasets, using a mask file to select which voxels.
  • 3dfractionize can now preserve the values of the input file in the output mask, rather than create a fractional count. This is useful when dealing with multi-valued mask files, as might be created using the -1clust_order option of 3dmerge.
  • The interactive AFNI program can now read images and display them as time-dependent data, so that you can use the graph viewers. (Formerly it could just display image files as spatially-dependent data - images only, no graphs.) The new options are -tim and -zim - see the output of afni -help for details on usage. (The purpose of this change is to let AFNI function something like FD2 as a way to take a quick look at image time series data, without having to assemble it with to3d.)

Some Additions - 14 Oct 1999 = Version 2.24b

  • Added program 3dStatClust by Doug Ward - this does clustering on parameter vectors as output by (say) 3dNLfim. The purpose is to find groups of "similar" voxels, as defined by closeness in some parameter space. For details on the method and usage, see the documentation file (available in file afni_doc.tgz, at the AFNI distribution site).
  • Added the Histogram plugin, which lets you graph a histogram of the data values stored in a dataset sub-brick.
  • Added program 1deval, which evaluates an expression at a sequence of evenly spaced points - the purpose is to simplify the creation of .1D files.
  • Added AFNI_ENFORCE_ASPECT environment variable, to make AFNI to enforce the aspect ratio constraint on image windows when the X11 window manager fails to do so (this happens on some Linux window managers).
  • Added program 3dTstat to compute the same stuff that plug_stats.c does, but in a batch program. Statistics of a 3D+time dataset that can be computed are the mean, slope, and standard deviation (all for each voxel).
  • Added option -apar to 3drefit, which allows you to (re)set the "anatomy parent" of a dataset after creation. See the answer to Q58 in the FAQ list for a reason why you might want to do this.
  • Added option -warp to 3dfractionize, to allow inverse warping from +tlrc coordinates back to +orig coords during the fractionation process. This allows you to create a mask in Talairach coordinates, and then create a version of it back in the scanner coordinates, so you can use it to extract voxel values from a +orig dataset.

Minor Changes - 25 Sep 1999

  • The Write Center ('w') menu item in a graph window writes out the center time series to a file. This filename is formed from the index coordinates of the center voxel. It has now been rearranged so that the order of these coordinates is the same as is displayed using the Voxel Coords? mode, and as output by the various voxel dumping programs and plugins.
  • The Set 'w' Suffix menu item in a graph window had a bug: when used twice in an AFNI run, it would overwrite its allocated buffer by one byte, eliciting a complaint from AFNI's internal memory checking functions. This error has been fixed.

Minor Changes - 20 Sep 1999

  • Datasets that do not have a byte order flag in their .HEAD files are assumed to be in the native order of the machine currently being used. All AFNI programs, since May 1998, create datasets with such a byte order flag, but datasets created with more ancient versions will not contain this type of information. Such datasets have caused confusion, since they are processed incorrectly if moved from an SGI system to an Intel system (say). AFNI programs now print out a warning message when such an un-byte-ordered dataset is opened.
  • The History Note now has the username and hostname added to the time stamp, so that you can know not only when a dataset was created, but also where and by whom.
  • to3d now cuts out all but a few of the input image filenames from the History Note, since otherwise you might end up with a History Note that was uselessly long.
  • 3dclust now recognizes the -1dindex and -1tindex options (from 3dmerge), which will let you pick the sub-bricks on which you wish to get the clustering report.
  • 3dTcat now has two new options for removing linear trends from the datasets it catenates.
  • 3dmaskave has a new option -slices to let you restrict the operation to particular slices in the dataset.
  • 3dpc now has a -mask option, to restrict the principal components analysis to voxels of your choice.
  • 3dcalc will interpret the x, y, and z expression symbols as the voxel (x,y,z) coordinates, if no dataset usurps these symbolic names. Similarly, the i, j, and k symbols can be used in an expression to indicate the voxel 3D index.

Changes - 11 Sep 1999 = Version 2.24

  • The Notes facility in the AFNI package has been extended. A new plugin was written to allow you to view and edit Notes interactively (see 3dNotes from 26 Aug).
  • Also, a special read-only History Note was added - each AFNI program that creates a dataset puts a copy of the command line used into the History Note - plugins that create a dataset do something similar. The hope is that datasets will be more self-documenting - it will be easier to find out how a dataset was created from the dataset itself. The History Note can be viewed from the Notes plugin, but cannot be edited by the user.
  • The Notes (user-generated and History) are also displayed by the program 3dinfo and by the Info buttons on the Define Datamode->Misc menu.
  • Two new optional calculations were added to the FIM+ submenu in AFNI graph windows. These are the % From Ave and Average values - for details, see the answer to Q41 in the FAQ list.

Minor Changes - 30 Aug 1999

  • You can now set a limit on the % Change computed by the FIM or FIM+ control - the motivation and method are described in file README.environment.
  • The venerable count program (one of the first I wrote here at MCW, these many years gone by) has a new option to allow floating point output.

New Members of the AFNI Family - 26 Aug 1999

  • Tom Ross ( and Katie Heimerl of MCW have contributed several new programs to the distribution:
    • 3dFourier allows for Fourier filtering (lowpass and highpass) of 3D+time datasets. There is also a corresponding plugin for interactive use.
    • 3dNotes lets you add notes to a dataset header file, and retrieve them for reading later. (When is the plugin version coming for this, Tom?)
    • 3dROIstats lets you get statistics about each of a whole collection of ROIs defined by a mask dataset. Each separate value stored in the mask dataset defines a distinct ROI.
  • In other news, the AFNI splash screen debuts officially with this release. (See the FAQ list or README.environment for information on how to control this feature, if you don't like it.)
  • Program 3dmaskave has a new option -indump, which will dump a list of voxel index coordinates. Correspondingly, the AFNI image window popup now has a "Jump to (ijk)" button, which lets you jump the crosshair focus position to any given triple of array index coordinates.
  • The plugins by Ziad Saad have been fixed - there was a problem with their use of malloc and the new malloc management routines implemented in version 2.22. These plugins are labeled 3D Dump98, 4D Dump, Hilbert Delay98, and 3D+t Extract on the Plugins menu.
Collectively, this new distribution is called version 2.23. The source code is available at this moment, and binary distributions will be out shortly.

Reordering Plugin - 02 Aug 1999

The reordering plugin (plug_reorder.c) by Jay Kummer of MCW is now included in the AFNI source code and binary distributions. I (Bob Cox) have not tested this plugin personally; any questions should be directed to Jay (

Float Scanning, and a Solaris Bug Fix - 31 Jul 1999

  • Tanya Kisler of U Pittsburgh had a problem with a float-valued dataset that could not be processed properly with 3dmerge. It turned out that some illegal floating point bit patterns (i.e., NaN) had crept into the .BRIK file. The new program float_scan can scan for and fix such errors. Also, if you define the Unix environment variable AFNI_FLOATSCAN, the AFNI brick input routine will scan each floating point brick for errors when it is read in, and will replace illegal values with zeros. Since all the programs use the same I/O functions, enabling this feature will provide some protection against bogus floating point datasets. (See file README.environment for a complete list of Unix environment variables used by AFNI.)

    There is no analogous protection possible for byte- or short-valued bricks, since any bit pattern is a legal integer. Some bit patterns are not legal floats, which is why this problem can arise in the first place.

  • Sandra Kinderman of UCSD found that some keypresses in the graph windows didn't work in the Solaris version of AFNI. Now that I have access to a Solaris 2.6 machine, I  was able to fix this problem (hint: it involves the use of XComposeStatus).

Bug Fix - 19 Jul 1999

David Dubowitz of Caltech discovered that 3dcalc didn't work properly with 3D+time datasets stored as bytes. This bug has been fixed.

More Smallish Additions - 18 Jul 1999

  • The volume rendering plugin now has the ability to recall its previous settings. Settings can be saved to a file and restored later, and can also be restored when you scroll back through the accumulated images. The intention is to make it easy to render different datasets in the same fashion. The Help button has more information, under the heading Scripts.

  • Doug Ward has modified 3dDeconvolve to have a -nodata option, which lets the user evaluate the effectiveness of a particular experimental design (i.e., stimulus pattern), without actually analyzing any data.

    3dDeconvolve also has a new -glt option to allow the user to specify a general linear test, (e.g., a matrix contrast in regression parameters). This lets the user conduct a (within-run) test for differences in response to different stimuli.

    The documentation file has been updated accordingly.

  • New program RSFgen can be used to generate random temporal stimulus patterns. In conjunction with 3dDeconvolve -nodata, this can be used to find good patterns for event-related FMRI experiments.

  • Program 3dNLfim now has an option that will write out the signal fit (or signal+baseline fit) to a 3d+time dataset.

  • Yesterday marks the inauguration of the (OLD) AFNI Message Board, a place where AFNI users can exchange ideas, tips, etc.

One Small Addition, Etc. - 07 Jul 1999

  • A new program 3dTsmooth, is available to do some simple time series smoothing of 3D+time AFNI datasets. See the output of 3dTsmooth -help for more details.

    N.B.: Smoothing does not increase the detectability of a time series pattern (except visually). The decrease in noise variance is compensated for by a decrease in the number of degrees of freedom in the statistical estimate of the pattern's parameters. It is better to perform regression (linear: 3dDeconvolve or FIM; nonlinear: 3dNLfim) directly on the unsmoothed time series data. If you just want to look at smoothed time series data, you can do this in an AFNI graphing window by using the Median or OSFilt 1D transformations selected from the Opt->Tran 1D menu.

  • AFNI now checks plugins to see if they are compiled at a time before the AFNI main program itself. If so, a warning message is printed out. When AFNI is updated, user written plugins should be recompiled, since some internal data structures may be different. The warning is intended to remind you of this fact.

  • The volume rendering plugin didn't work correctly when switching between datasets, or when viewing a dataset that was being actively changed by the drawing plugin. These bugs have been fixed.

Two Bug Fixes and Two Additions - 08 Jun 1999

  • A bug was found (by Mike Beauchamp of the NIMH) in program 3dmerge. The program would always do the -1zscore transformation on any statistics sub-bricks that were output. This happened because the if() statement that controlled the calculation was mysteriously commented out by the Dark Side of the Force. This error has been repaired.

  • Program 3drotate failed to create a new ID code for the rotated dataset. This could produce confusing results, since when an AFNI run has 2 datasets using the same ID code, then the parenting relationships in coordinate transformations (e.g., to the +acpc and +tlrc views) could be done mistakenly. This error has been repaired.

  • Doug Ward of MCW has written the program 3dIntracranial, which tries to segment a T1-weighted dataset and remove the non-brain tissue. This has only been tried on images from our 1.5 Tesla scanner, using our custom-built local gradient/RF coil combination. Documentation can be found in the manual, which is in the new doc.tgz file, and can also be found on the AFNI main page.

  • The .afnirc file has been extended to allow setting of the AFNI-relevant Unix environment variables. This provides a convenient place to keep such setup information. See the new edition of the file README.environment, which can be found on the AFNI main page or in the AFNI distribution files.

Bug Fix - 01 Jun 1999

  • A bug was found in the "% Change" calculation in the interactive FIM calculation. The average baseline level did not take into account the last "ort" function used. For the default calculation, the last ort is a linear trend. For voxels that have a small baseline and a large linear slope, the error in the % Change might be significant. In datasets that I have examined, this only occurs just outside the edge of the brain, where the effects of motion are large and the signal intensity is small. For voxels inside the brain, the typical % Change is altered by a factor of at most 0.05; for example, a true 1% change might end up as 0.95% or 1.05%.

  • In a related story, a new feature was added to the interactive FIM calculation: the ability to select a polynomial detrending (or "ort") function. The default is still a linear function (polynomial of order 1), but the new polort control can now be set from 0 (baseline=constant) to 3 (baseline=cubic polynomial in time).

Small Changes - 27 Apr 1999

  • New program 3daxialize can be used to re-write a dataset so that its slices are stored in axial order within each sub-brick. The main motivation for this program is to create datasets that can be used with the rendering plugin.
  • Program imupsam is available for upsampling 2D images to a smaller voxel size, using high-order interpolation.
  • A button Set All was added to the Lock menu in AFNI, to make it easier to lock all controller windows together.
  • A bug in 3dinfo was fixed, where the dimensions of the dataset along each axis might be misreported.
  • A bug in the AFNI initialization from the .Xdefaults file was fixed.
  • The "3D:" image reading code was modified to allow for possible footers at the end of each slice. See the FAQ for more information.
  • AFNI was tested briefly with the latest version of LessTif, and seems to work OK.

Small Changes - 01 Apr 1999 [not a joke]

  • The rendering and drawing plugins have been modified so that they can be used together; it is now possible to draw in a dataset (in a 2D image window) and see the 3D rendering updated immediately.
  • Some small-but-annoying bugs in the rendering plugin were fixed.
  • 3dcalc has had an output scaling problem fixed, so that each sub-brick will get its own scaling factor. See the output of 3dcalc -help.
  • The new program adwarp (by Doug Ward) provides a batch capability like the interactive AFNI Write buttons: the ability to resample a dataset in Talairach coordinates based on an "anatomical parent" transformation. See the output of adwarp -help for details.
  • The SOLARIS_DIRENT_PATCH, described in file machdep.h, will hopefully let AFNI work on Solaris 2.6 systems.
  • Memory allocation is now handled by internal routines that provide some increased ability for debugging. If these cause trouble, they can be disabled -- see README.environment for the details.
These changes, and those described below, collectively comprise what is now known as version 2.21e.

Bug Fix - 02 Mar 1999

Tom Ross of MCW has discovered a problem with the 3D registration software in AFNI. This affects the results of Fourier interpolation (the default mode) in both 3dvolreg and the 3D registration plugin. The effect is that the registered images are slightly blurred. This bug does not affect the polynomial interpolation methods (-heptic, etc.). If you are using a version of AFNI downloaded before today, you should re-acquire the software if you are using, or plan to use, or think you might consider planning to use, 3D registration.

Smaller news items:

  • Some new functions were added to the repertoire of 3dcalc; see the output of 3dcalc -help for information.
  • 3dRegAna has a new feature that allows the input of a very long command line. This is documented in the FAQ list.
  • Some changes and fixes were made to the volume rendering plugin.

New Modules - Lincoln's Birthday, 1999

  • Program 3dfractionize can be used to resample a high-resolution mask dataset to a low resolution grid.
  • Program 1dplot can be used to graph (to the screen, and thence to a PostScript file) AFNI/FIM format timeseries (*.1D) files. One application is graphing the "-dfile" output from 3dvolreg.
  • The first version of a 3D volume rendering plugin is available. It's fun, but crude, and subject to change at any second. Some sample images are here (over 3 MB).
In addition, 3dcalc has had a few small changes -- see the output of "3dcalc -help" for details.

Bug Fix - 02 February 1999

Doug Ward of MCW found a problem with the "See Function" button - if it is pressed in when there is no functional dataset to see, then you switch to a view or session where there is a functional dataset, it would not be seen. This could be fixed by turning the button off then back on. The necessary line of code in AFNI has been fixed.

Wiremesh surface graphs have been added to the image display "Disp" control panel, just below the "RowGraphs" button. This will plot the image intensity as the height of a 2D graph (i.e., I(x,y) vs. x and y).

Bug Fix - 20 January 1999

Tom Ross of MCW pointed out that the program cdf did the "-p2t" conversion incorrectly for the F statistic. This has been fixed (a 1 line braino in the code). To check if your copy of cdf is correct, try
   cdf -p2t fift .1 8 8
The output should be about 2.59, but in the incorrect version it is about 0.386.

Changes - 15 January 1999

  • The program 3dpc is now available to compute principal components from a number of input data bricks (thanks to some help from MCW graduate student Vinai Roopchansingh).
  • A new command-line method for specifying subsets of data bricks from a dataset has been implemented. This allows some programs to operate on user-selected inputs. The details can be found in the output of "3dcalc -help". Programs that can use this option are: 3dcalc, 3dpc, 3dinfo, 3drotate, 3dvolreg, and from3d.

Changes - 03 January 1999

  • The "Disp" control panel on the image viewing window has a new chooser button, labeled "RowGraphs". This is for plotting rows from the underlay (grayscale) as x-y line graphs. Use "BHelp" on the RowGraphs button for a little more information.
  • The "Xhairs" chooser (in the main AFNI control panel) now allows you to have crosshairs displayed only along certain axes (for example, "LR+AP" means that crosshairs parallel the the Left-Right and Anterior-Posterior axes will be shown, but not those parallel to the Inferior-Superior axis).
  • The new environment variable "AFNI_ALWAYS_LOCK" will set all AFNI controller windows to be locked together at startup. (See README.environment for information about Unix environment variables that can affect the way AFNI works.)
  • The graph windows can now have a horizontal dashed gridline drawn at the level y=0 (if the data spans a negative-to-positive range). This is controlled by the "h" key, or from the "Opt->Grid" submenu.

Changes - 22 December 1998

The 3D registration plugin and the command line program 3dvolreg did not produce the same "dfile" for output -- the values were the same, but the assignment of angles to axes was incorrect in the plugin. This was brought to my attention by Eli Merriam of UPMC. The plugin has been fixed, and should be re-compiled or re-downloaded.

Changes - 17 December 1998

  • Doug Ward has speedup up the linear regression functions in 3dDeconvolve and 3dRegAna.
  • FFT based calculations are speeded up by about 20% on some CPUs, thanks to using an unrolled N=32 FFT function as the basic unit. This affects the 3D blurring and 3D rotation operations in particular.
  • Some scaling bugs were fixed in 3dmerge and elsewhere, which arose when using datasets with internal scaling factors.

Additions to the AFNI package - 24 November 1998

  • 3D (volumetric) registration is now available in program 3dvolreg. This executes 2-6 times faster than AIR 3.08 and produces nearly identical estimates of the movement parameters. See file README.registration and the output of "3dvolreg -help" for more details.
  • The new program 3drotate can be used to deal with datasets that are acquired oblique to the anatomical scans. The preferred modus operandi would be to rotate the anatomical scans to be aligned with the functional scans.
  • New program 3dTcat lets you catenate 3D+time datasets together to make really big files. Burn up those 18 gig drives!
  • Program 3dmerge has a new option "-1dindex" which lets you specify which sub-brick of the input dataset(s) is to be operated upon.
  • Setting the Unix environment variable "AFNI_LEFT_IS_LEFT" will make AFNI display axial and coronal images with the subject's left on the left of the screen.
  • The dataset "Lock" feature now works on time indexes as well as on spatial coordinates.

Additions to the AFNI package - 18 September 1998

  • The new program cdf will compute the p-value given the threshold, or the threshold given the p-value, for several canonical probability distributions. This program is an extension of the older program p2t.
  • AFNI now accepts the command line option "-install", which will make the program install its own colormap. You can use this to get around the problem of not having enough color cells available (on 8 bit displays) due to colormap hogging by Netscape, CDE, etc.
  • When you read in a new color palette file (*.pal), the last palette table read in will become the active palette. Previously, you had to then pick the new palette off the palette chooser menu after reading it in, which confused some people [no names will be mentioned, just initials: SMR].
  • 3dmerge has a new option "-1zscore", which is designed to convert a statistic sub-brick from an arbitrary distribution (e.g., t-test, F-test) into an N(0,1) variable (also called a z-score). This option is desiged to be used in conjunction with the "-doall" option, so that it applies to all sub-bricks of the input dataset. Sub-bricks that are not statistics will not be affected by "-1zscore".
  • 3dmaskave has new options that allow the specification of voxels that are reported on to also include a range of allowable values, and to restrict the output to a single sub-brick of the input.
At present, the only documentation for these changes is this Web page and the output of the "-help" option for the affected programs.

Additions to the AFNI package - 14 September 1998

  • A new batch program 3dDeconvolve is available to do multiple linear regression and linear deconvolution of a 3D+time dataset.
  • The Deconvolution plugin is an interactive version of this that allows quick exploration of these linear time series fitting techniques in an AFNI graph window.
  • To3d now has a command line option "-2swap" and an interactive button that let you byte-swap the image data.
The deconvolution/linear regression modules were written by Doug Ward (, and are documented in the PostScript file

Small changes to AFNI - 22 August 1998

  • The "Plot" button in the timeseries chooser (activated from the "FIM" menu) has finally been implemented.
  • AFNI now works with X11 TrueColor visuals (8-24 bit planes). [However, the older program FD2 still requires PseudoColor.]

Small changes to AFNI - 12 August 1998

This non-release of AFNI adds the following:
  • Ability to plot points+lines together in a graph window.
  • Modified 3dmaskave and plug_maskave to allow the use of a sub-brick from a bucket dataset as the mask.
  • plug_maskave now allows the creation of an ROI averaged time series, which can be used as the FIM reference (for example).
  • Added nonlinear fit model "model_convgamma", that models the data time series as a gamma variate impulse response convolved with a user-input reference time series. The nonlinear parameters of the gamma variate are fit separately for each voxel.
  • Nonlinear fit programs 3dNLfim and plug_nlfit have a new option to allow the time step of the model function to be set to the time step of the input dataset (the default is to set delta-t=1.0, regardless of true TR).
The source code is available in the usual places, for the usual suspects.

Release of AFNI 2.20b - 14 July 1998

This release of AFNI fixes some bugs that have been uncovered since the last release (2.20a - 30 April 1998). A few new capabilities have been added as well.

If you are outside of the MCW/MU community, you should download the new files, even if you just got AFNI recently. The final bug fixes below were only made late at night on July 14, 1998, and the files set up for distribution on July 15, 1998.

Recent Bug Fixes

  • Program 3dcalc now computes the logical functions "OR", "AND", and "MOFN" correctly.
  • The Palette selection popup menu under the "Define Function" Inten label now works even if there is no .afnirc file.
  • The Dataset Type menu on the "Dataset Copy" plugin now works correctly for anatomical types as well as functional types.
  • The "Dataset Rename" plugin now works correctly with compressed datasets.

Recent "Improvements" (since April 1998)

  • Added erosion+dilation operations to the clustering options of 3dmerge. In some cases, a cluster is generated that comprises 2 or more large blobs connected by small "necks". Erosion can cut the necks off, and re-dilation will preserve the main blobs.
  • The new "-1clust_order" option allows the values in a cluster to be replaced by an index indicating which cluster the voxel is in -- 1=largest, 2=next largest, etc. This is intended to facilitate the creation of VOI masks from functional data.
  • Program AFNI now allows the .afnirc file to be skipped.
  • Program 3dnoise now allows the noise level to be set from the command line, rather than computed from the data.
  • Program 3dcalc had a number of changes, besides the bug fix described above. They are (see "3dcalc -help" for details):
    • Operations are now allowed on bucket and other multi-brick datasets that are NOT 3D+time.
    • Memory management was improved to allow operations on larger collections of data. (Buying more memory is still a good plan.)
    • A *.1D file can be input in place of a dataset. In this case, the value at each spatial voxel at time index n will be the same, and will be the n-th value from the time series file.
    • The "-verbose" option will print out the progress of the calculations. This can be informative when running 3dcalc on large multi-brick datasets.
  • Program 3drefit option "-nowarp" allows the removal of all warping (coordinate transformation) information from a dataset. If a dataset is created by transformation from another (as in the +orig to +tlrc case), the coordinate warp is stored in the transformed dataset header file. In some cases it is desirable to remove this information -- for example, to prevent the use of "Warp on Demand" within AFNI, which will re-transform the data from the original source, even if the transformed data were subsequently edited (thresholed and clustered, say).

Less Recent "Improvements" (since January 1998)

  • Compressed dataset .BRIK files: see README.compression.
  • Storing the byte order of datasets in the .HEAD file: see README.environment.
  • Volume of interest (VOI) selection and statistics: see README.roi.
  • Minor tweaks to graphing:
    • Autoscaling of graphs using the "a" key or from the "Scale" submenu.
    • Gaps between graph boxes from the "Colors, Etc" submenu.
    • Choice of an arbitrary time series for the horizontal axis from the "X-axis" submenu.
  • Addition of the "Percent Change" calculation to the interactive FIM menu.
  • Added the "Purge Memory" and "Info" buttons to the "Misc" menu in afni (under the "Define Datamode" control panel).
Created by Alex Clark
Last modified 2005-03-24 16:28

Powered by Plone

This site conforms to the following standards: