Skip to content

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

Sections
Personal tools
You are here: Home » FAQs » How can I use the volume renderer to deal with arbitrary datasets?

How can I use the volume renderer to deal with arbitrary datasets?

Document Actions
Up to table of contents

Q47. How can I use the volume renderer to deal with arbitrary datasets?
The design of the rendering plugin was motivated by several factors:
  • Lack of time to deal with the complexity of non-identical grids and coordinates in the overlay and underlay bricks.
  • The fact that this was the first time I ever used volume rendering.
  • The belief that people were most likely to use this on Talairach datasets, which are usually identical in conformation.
As a result, the two input datasets are required to be stored on identical grids, with cubical voxels, and with axial slice orientation (as is output in the +tlrc and +acpc coordinate systems).

It is possible to force a dataset into this mold, but it is a little clumsy. There are 3 steps:

  1. Use the 3ddup program to make a "warp-on-demand" (.HEAD file only) copy of a dataset; for example:
     3ddup -prefix aaa anat+orig
     3ddup -prefix fff r1:time@1+orig
    
    makes the datasets aaa+orig and fff+orig, which are copies of the anatomical and functional datasets.
  2. Run AFNI, open up the Datamode control panel, and turn on "Warp Anat on Demand" and "Warp Func on Demand". Set the "Resam mode" for Anat and Func, and maybe set the Resam voxel size, too (default here is 1 mm). Then use the "Write Anat" and "Write Func" buttons to write out the aaa and fff datasets (if necessary, you'll have to use Switch so that these are the current datasets). This will give them .BRIK files. (Do NOT use "Write Many" to write them out in one operation!) Exit AFNI now.
  3. Unless these datasets are axial (that is, 3dinfo shows that they are stored in "-orient RAI"), you next must create axial slice versions of these dataset. This is done with the 3daxialize program, as in
    
      3daxialize -prefix aaa_ax aaa+orig
      3daxialize -prefix fff_ax fff+orig
    
    You can now delete aaa+orig.* and fff+orig.*, since the axialized datasets contain the same data, just reordered into axial slices.
You can now restart AFNI, and the renderer should be able to deal with the new datasets aaa_ax+orig and fff_ax+orig.

Some people want to know how to resample one dataset so that it is forced to be on the same grid and volume as another. This can be done using the Write function of AFNI, as well. The trick is to know that the output grid and volume for the Function dataset are defined by the current Anatomy dataset. For example, suppose you have an angiography dataset you want to visualize on the same 3D grid/volume as another anatomical dataset. The first step is to use 3ddup as above on the angio dataset, but to also make it be a functional type, as in the command below:

  3ddup -fim -prefix angio_dup angio+orig
Then you can start AFNI, set the Anatomy to be the master dataset whose 3D grid/volume you want to use, and set the Function to be angio_dup; you may also want to alter the Func resample mode. Then do Write Func. Quit AFNI, and do the 3daxialize thing on angio_dup+orig, and then change the result back to be an anatomical dataset:
  3daxialize -prefix angio_ax angio_dup+orig
  3drefit -spgr angio_ax+orig
  rm -f angio_dup+orig.*       [this is optional, of course]
You will now be able to view the new dataset angio_ax as an anatomical underlay, either in the normal image viewing windows or in the rendering plugin, and it will cover the same volume as the anatomy master dataset you chose when you wrote to disk.

[Answer last changed 21 Oct 1999]

This FAQ applies to: Any version.

Created by Robert Cox
Last modified 2005-07-31 23:38
 

Powered by Plone

This site conforms to the following standards: