Skip to content


Personal tools
You are here: Home » SSCC » SSCC Web Log » AFNI and SUMA new features - April 2005

AFNI and SUMA new features - April 2005 AFNI and SUMA new features - April 2005

Document Actions
Submitted by rwcox. on 2005-04-26 12:13.

April 2005:

  • Add 'Pleg(m,x)' (Legendre polynomial) function to 3dcalc. Also 'stdev(...)' and 'sem(...)' functions for standard deviation and standard error of the mean, each function taking an arbitrary list of arguments.
  • AFNI programs can now read NIfTI-1 '.nii' (or '.nii.gz') files directly. The goal is to make interoperation with other software packages (e.g., FSL, SPM) simpler on the pitiful users.
  • Add '.nii' file output to THD_writedset() function, with the result that most AFNI programs will now write NIfTI-1.1 formatted files if the output -prefix ends in '.nii' (or in '.nii.gz').
    • This specifically includes to3d (converting image files to AFNI or NIfTI-1.1 datasets).
    • Program 3dcopy can be used to convert NIfTI-1.1 datasets to AFNI format, if so desired.
    • Program 3dAFNItoNIFTI can be used to convert AFNI format datasets to NIfTI-1.1 format.
    • NIfTI-1.1 and AFNI datasets do not completely overlap in their conceptual space. As a result, not all meta-data is preservable when writing a .nii file from AFNI. And not all NIfTI-1.1 files can be read into AFNI (for example, AFNI doesn't support 64-bit float datasets, or vector-valued time series -- 5 dimensional NIfTI-1.1 files).
  • Add -automask option to 3dDeconvolve; however, using a precomputed mask (via -mask) is more efficient.
  • Add function mri_write_jpg() function; now, if an output 2D image filename ends in '.jpg', a JPEG file will be written (via program cjpeg) rather than a PPM file. Applies in particular to program imupsam (for interpolating an image to a finer matrix).
    • Also modified mri_write() functions to output to stdout if the filename is "-"; in this way, a program like imupsam can write to a pipe.
  • Modified plug_tag.c to allow tags to be applied to "functional" datasets, as well as "anatomicals". A few other plugins were also fixed up in this regard.
  • Enable the gamma 'g' arrows in an image viewer to adjust the gamma factor for RGB images; previously, the user couldn't do much to modify the way RGB images (from RGB datasets, or in the volume renderer) were displayed.
    • Also, if AFNI_STROKE_THRESHOLD is enabled, click-and-drag adjustment of the gamma factor will work (much as click-and-drag works for the grayscale adjustment; see README.environment).
    • The 'Norm' button will reset the color gamma factor to 1.0, when you really screw it up and can't see anything any more!
    • Most people don't know it, but the 'Sharpen' button on the 'Disp' control panel will sharpen the underlay images, both grayscale and RGB.
  • 3dDeconvolve's -nodata option will now work with the -stim_times option. For more details, go to and scroll to the bottom.
  • The "transforms" options on the Disp image viewer control panel will now directly affect the viewing of RGB underlay datasets.
    • And the 'g' (gamma) control arrows can be used to change the appearance of such colored datasets.
    • These controls do not affect the overlay image. However, you can 'transform' the overlay image from the hidden right-click popup available under the 'Inten' label on the 'Define Overlay' control panel.
    • The diffusion directionality image below was created from an RGB dataset, which was filtered via the 'Median21' and 'Sharpen' controls to produce the pleasing watercolor-ish effect. Followed by a 'Save:agif' to make the animated GIF.

In the comments below, Daniel Glen mentions his new 3dDWItoDT program for diffusion tensor calculations. Here is an image produced by colorizing the principal eigenvector of the D matrix:

3dDWItoDT Diffusion Tensor calculations

Posted by dglen at 2005-04-26 15:25
New iterative non-linear algorithm implemented in 3dDWItoDT to calculate diffusion tensors from diffusion weighted images. New options are included for calculating eigenvalues and eigenvectors, graphing, reweighting, linear versus non-linear methods.


Posted by dglen at 2005-04-26 15:34
Presentation on new algorithm posted on

nifti_tool : new options

Posted by rickr at 2005-04-28 18:13
Added options for 'copy brick list' and 'copy collapsed dimensions', for creating new datasets based on the data from others. These correspond to options -cbl and -ccd.

Added options for 'display time series' and 'display collapsed image' (using options -disp_ts and -disp_ci), for the output of ASCII data values to the terminal window.

Added the -add_comment_ext option, for adding a comment extension to a nifti dataset. Such an extension is text-only.

Added option -keep_hist, to store the given nifti_tool command as a comment extension in any new dataset.

Added the -strip option, to clear the descrip field and remove all extensions from the dataset(s). This is meant to make the dataset more anonymous.


Posted by rickr at 2005-04-28 18:15
When a user wishes to get extra information about the internal processing of NIfTI datasets that are being read or written by AFNI programs, the AFNI_NIFTI_DEBUG environment variable can be used to provide different levels of extra output. Setting this environment variable to 0 makes processing very quiet (except for errors), 2 is nice for some details, and up to 4 can be quite verbose.

This can be set in the ~/.afnirc file, in the 'Edit Environment' menu of afni, or in the shell.


Posted by dglen at 2005-04-29 13:04
Added new trivial program to find maximum and/or minimum of a dataset. The same data can be 'grep'ed and 'awk'ed out of 3dinfo or 3dattribute, but this is simpler and could potentially be used in a script or as input to 3dcalc more easily with the `, backward quote operator. The program takes options of -quick, -slow, -min, -max. The slow and quick options tell whether to search the voxels or just read the dataset, respectively. The slow option only works for short, int and float datasets. If you put both slow and quick, it will show you both ways. If you put min and max, you get both. If you only put one or the other, you get whichever you picked. If you don't put any options at all, you get the max the quick way.


3dMax -quick -min -max "DT+orig[18]"
3dcalc -prefix RGB3EVA255scaled -a 'DT+orig.[9..11]' -c 'DT+orig.[18]' -expr 'c*255*ABS(a)/'`3dMax "DT+orig.[18]"`
« August 2021 »
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

Powered by Plone

This site conforms to the following standards: