overlaying function on anatomy


[ Follow Ups ] [ Post Followup ] [ AFNI Message Board ] [ Search ]

Posted by Bob Cox on March 18, 2002 at 16:01:24:

This posting is in response to a message emailed to me by Rodgrigo Vivanco. I prefer to reply to AFNI inquiries here, so that all may look upon them and despair.

I was wondering if you could help me by giving me some pointers as to where
I could find information on the following topic. I was interested in writing
an applet where I could overlay 3D functional map (say 16 slices, 128x128)
over 3D anatomical images (say 32 slices, 256x256). I was trying to find in
the AFNI documentation (and lloked a bit in the source code) how one would
go about doing the mathematical transformations/mappings of a functional map
voxel onto an anatomical voxel if one knows the real space geometry (slice
orientation, slice thickness and other scanner properties of the functional
and anatomical images).

Any kind of lead, journal article, image processing/computer graphics book
that you know of which deals with this type of problem would be greatly
appreciated. Trying to learn how to do this by inspecting someone else's
code is not the best way to go about it.

Thanks, Rodrigo Vivanco

The way functional overlay at one orientation/resolution onto anatomy at
another orientation/resolution is done in AFNI is based on coordinates. Each dataset volume has a 3D coordinate system attached, giving for each axis (x,y,z) an orientation code, a grid spacing, and an origin. Each dataset grid thus has its own coordinate system. Then there are a bunch of functions to transform between the various coordinate systems; these systems are


ind = voxel index (0,1,2...)
mm = spatial coordinates in the dataset orientation
dicom = spatial coordinates in DICOM order coordinates

Finally, there are functions that will take a slice out of a dataset in a predetermined orientation (say a sagittal slice, which in DICOM coordinates is at a fixed value of the x coordinate) no matter what the dataset orientation actually is (for a sagittally stored dataset, a sagittal slice is at a fixed value of the z coordinate).

This is all fairly complicated in AFNI, which has to deal with datasets stored in 48 different orientations. In retrospect, I wish that I had decided to store all datasets in a fixed orientation, and flip the images around only once, at input. Then the overlay issue would just come down to interpolating from one grid spacing to another instead of doing that at the same time that the flipping around is done. When I first wrote AFNI (1994), for some reason it seemed important to preserve the original images in the datasets as much as possible; 7.5 years later, I can't recall why.

I don't know of any article or book you can go to that will discuss these issues. This kind of mundane twiddling around is usually not deemed worthy of algorithmic discussion. Thus, each person re-invents it for himself.

bob cox


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ AFNI Message Board ] [ Search ]