Image To Volume

The Image to Volume package takes a series of 2D image files that represent layers or slices of a 3D volume and builds them into 3D field data that can be visualized using the normal tools for visualizing 3D fields.

New high-level visualization macros:


MODS.Read_Img2Vol

The MODS.Read_Img2Vol user macro reads in a series of image file slices, builds these slices into a 3D volume and then outputs this data as a 3D uniform field. The format of the input image files can be explicitly specified or can be automatically detected. The format of the output data can also be specified. The macro can output node data that for each node contains either a 4-byte vector containing the full-color ARGB image data, a single byte containing a single channel of the image data or a single float containing the luminance of the pixel.

The macro selects which files should be read by looking for a series of filenames that are identical accept for a changing index number. All files read by the build3d macro must contain an index number. The macro cannot read an arbitrary sequence of numbers. The names of the files to read are specified by 3 parameters, a filename head, a filename tail and a minimum index length. The filename head is the portion of the filename that appears before the index. The filename tail is the portion of the filename that appears after the index. The minimum length specifies the shortest possible length of the index number. If the
index number is shorter than this the remainder of the index is padded with zero characters. Hence if you had filenames of the form pic001.tif then the 3 parameters would have the values:

Filename Head pic
Filename Tail .tif
Minimum Length 3

To help the user adjust these properties the user interface displays an example of how they will be used to create a real filename. After the filename parameters have been specified the user must also specify which indexed files should be read. This is done be specifying a starting index and an ending index. The sequence of filenames generated proceeds from the start index to the end index. The sequence includes the image file with the ending index number.

The Read_Img2Vol macro will ensure that all the specified image files exist, are of the same format and are the same size. If they are not the macro will stop with an error message.

It should be noted that this macro outputs a uniform field and hence it assumes that all the input slices are evenly spaced. If this not the case then the adjust_slice_spacing macro can be used to convert the uniform field into a rectilinear field with specified positions for each slice.

The Read_Img2Vol macro can be useful in a wide variety of situations. For instance in microscopy a series of images can be taken at different depths. Read_Img2Vol can take these separate images and build them into a 3D volume that can be visualized as a whole.

(more...)


MODS.adjust_slice_spacing

When gathering data it is quite common to find situations where data is evenly spaced in two dimensions but is irregularly spaced in the third dimension. One example of this is medical imaging where several techniques involve taking a number of cross-sectional images of a body. Each of these individual cross-sectional images can be high resolution. However setting up the imaging equipment to acquire each image is a time consuming and expensive process. Therefore relatively few images and taken and they are distributed so that they are concentrated around the region of interest.

Data volumes built from these irregularly spaced images are called rectilinear fields within AVS/Express. Rectilinear fields can have irregularly spaced axes in all three dimensions. To create a rectilinear field the spacing for each axis has to be specified. This can be difficult and time-consuming. The adjust_slice_spacing user macro aims to solve this problem by automating the creation of a rectilinear field.

The adjust_slice_spacing macro takes a 3D uniform field and a floating point array as input. The floating point array specifies the position that each slice on the specified axis should take. The macro creates the necessary spacing data for each axis and outputs a complete rectilinear field. The axis that should be irregularly spacing can be specified. By default the spacing of the Z axis is adjusted.

(more...)


New low-level visualization modules.

DV.DVread_img2vol

The DV.DVread_img2vol low-level module reads in a series of image file slices, builds these slices into a 3D volume and then outputs this data as a 3D uniform field. The format of the input image files can be explicitly specified or can be automatically detected. The format of the output data can also be specified. The module can output node data that for each node contains either a 4-byte vector containing the full-color ARGB image data, a single byte containing a single channel of the image data or a single float containing the luminance of the pixel.

The series of image files to read is specified by a C style formatting string, a starting index and an ending index. Internally these parameters are used to generate filenames that are read in by the image libraries contained within AVS/Express. The sequence of filenames generated proceeds from the start index to the end index. The sequence includes the image file with the ending index number. The module ensures that all the specified image files exist, are of the same format and are the same size. If they are not the module stops with an error. The read image data is translated as necessary and stored into a single slice of the output 3D volume.

It should be noted that this module outputs a uniform field and hence it assumes that all the input slices are evenly spaced. If this not the case then the adjust_slice_spacing macro can be used to convert the uniform field into a rectilinear field with specified positions for each slice.

This module can be useful in a wide variety of situations. For instance in microscopy a series of images can be taken at different depths. The DVread_img2vol module can take these separate images and build them into a 3D volume that can be visualized as a whole.

(more...)


DV.DVadjust_slice_spacing

Exactly the same as MODS.adjust_slice_spacing, except for the outputs. There is no renderable output object and the main output is a mesh instead of a full field.

(more...)