Maverick/MultipleVolumesToVolume

From KitwarePublic
< Maverick
Revision as of 09:50, 7 October 2008 by Aylward (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Maverick: MultipleVolumesToVolume

Overview

Use this program to combine multiple volumes into a single volume.

This is useful for:

  • Combining multiple slices from the visible man into a single volume
  • Creating a single volume that contains different models such as the visible man and the pig

Background

In data used and produced by Maverick, it is important to realize that the data exists within space. For example, an image is not a matrix of pixels, but instead it is a collection of values recorded in space. As you step from one recorded value to the next, that new value comes from a different position in space. The matrix of values is laid out as a grid in space that has an origin, a spacing between grid points, and an orientation. The origin describes the location of the first measurement value in space. The orientation is a matrix that describes the directions in which the x, y, and z-axis extend from the origin. The spacing describes the distance magnitude between the measures along each oriented axis.

Given that Maverick data exists in space, it is possible to create an image that contains multiple objects, by loading those multiple objects into space, and then computing a regular sampling of that space and recording the results of that sampling as an image. This is what this program does.

Operation

MultipleVolumesToVolume <listOfVolumes> <xOrigin,yOrigin,zOrigin>
                        <xDimSize,yDimSize,zDimSize> <xSpacing,ySpacing,zSpacing> 
                        <orientationMatrix> <output.mha>

All of the above should be provided on a single command line.

listOfVolumes: is a text file that has one image filename or transform filename per line. If an image filename is given on a line, then that image is loaded into space using the current transform. If a transform is given, it is applied to all subsequent images in the file, until a new transform is specified. A transform of None can be used to reset to an Identity (no-op) transform.

_Origin: is a comma-separated list that specifies the three coordinates that position the first voxel of the image (as stored on disk) in space. Correctly maintaining this information allows two subjects to stand next to mone another in a scene.

_DimSize: specifies the number of pixels along each dimension. That is, it specifies the size of the image grid.

_Spacing: specifies the magnitude of the physical distance between each sample on each axis.

orientationMatrix: is a list of 9 values that forms a 3x3 matrix. First three values specify the vector in space, that extends from the origin, and that represents the direction for the x-axis of the image in space. Next three values give the direction for the y-axis. The final three give the direction for the z-axis. Typically an identify matrix is used (1,0,0,0,1,0,0,0,1). But if the data is feet-first instead of head-first in the file, then the z-axis direction should be inverted to make it head-first in space: (1,0,0,0,1,0,0,0,-1). If the data was acquired sagittaly (from ear to ear instead of nose to back - along the x-axis), then those directions should be swapped (0,1,0,1,0,0,0,0,1). And do forth.

output.mha: is the filename to be created. At this time it is important to create a .mha file, since the current version of Maverick has limited support for .mhd and other formats.

Usage

To reconstruct the visible man

An example file is:

c_vm1279.fre.txt.mhd
c_vm1282.fre.txt.mhd
c_vm1285.fre.txt.mhd
c_vm1288.fre.txt.mhd
c_vm1291.fre.txt.mhd
c_vm1294.fre.txt.mhd
Transform = kneeTransformFile.tfm
c_vm1297.fre.txt.mhd
c_vm1300.fre.txt.mhd
c_vm1303.fre.txt.mhd
c_vm1306.fre.txt.mhd
c_vm1309.fre.txt.mhd
c_vm1312.fre.txt.mhd
c_vm1315.fre.txt.mhd
c_vm1318.fre.txt.mhd
c_vm1321.fre.txt.mhd
c_vm1324.fre.txt.mhd
c_vm1327.fre.txt.mhd
Transform = None
c_vm1330.fre.txt.mhd
c_vm1333.fre.txt.mhd
c_vm1336.fre.txt.mhd
c_vm1339.fre.txt.mhd
c_vm1342.fre.txt.mhd
c_vm1345.fre.txt.mhd
c_vm1348.fre.txt.mhd
c_vm1351.fre.txt.mhd

Something similar to the file given above can be used to reconstruct the visible man. The challenge with the visible man data is that they moved the man during the scanning process. So after the first several hundred slices, it become necessary to reposition the remaining data. The above text file is not actually correct for doing that repositioning. We will provide the proper file in the future.

To reconstruct the visible man's head

Using the first 300 files of the visible man, however, it is possible to reconstruct his head without the distortion (pointy-ness) that is evident when other reconstruction methods are used. Simply create a list of the files c_vm1012.txt.mhd through c_vm1605.fre.txt.mhd - let's say that list is stored in the file headFiles.txt The command-line argument to correctly reconstruct the head will then be:

MultipleVolumesToVolume headFiles 256,300,390 512,512,100 1.5,1.5,1.5 -1,0,0,0,-1,0,0,0,-1 head.mha

The resulting head.mha file will contain a very well shaped head.