Skip to content

AFNI and NIfTI Server for NIMH/NIH/PHS/DHHS/USA/Earth

Sections
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.

Parallelllllll-ism
 - 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."
Selectivity
 - 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
      'fred.1D{0..$(2)}'
    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
      'elvis.1D[3,5]{$..0}'
    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 rwcox@nih.gov 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 > gort.ps
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 **
      instead.
    • [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.

Aside
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.

DICOM Input
 - 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.

Credit:
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.


ANALYZE This!
 - 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 ftp://ftp.bic.mni.mcgill.ca/pub/minc/. 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 use