List of my modules...

Module: Draw_Cubes

Description:

Draws little cubes for the pixels of the object. The object is defined by a threshold value and a comparison function.


The left image shows the pixels of a binarised 3D image as a set of points, while on the right the same data is shown with a set of cubes generated from this module.

There are two options for drawing only a part of the image: a mask (defined by another image of the same size) or an ROI (region of interest). They can be used at the same time.


The left image shows this module applied to Avizo/data/tutorials/motor.am, also showing an ROI box and a mask with the region it delimits as a transparent surface. The right image shows the result when both are used.
NOTES:

Connections:

Image

[required]
The input image, a HxUniformScalarField3, is connected here.

ROI

[optional]
The region of interest, a HxSelectROI.

Mask

[optional]
The mask, a HxUniformScalarField3, which must have the same dimensions (width, height, depth) as the input image.

Ports:

Threshold


Value that defines whether a cube is drawn or not.

Comparison


Defines how the threshold is used to define the pixels to draw: should the pixel value be lower, lower or equal, greater, etc. than the threshold ?

Mask_Threshold


If a mask is connected, this is the value to compare with the mask pixel intensity.

Mask_Comparison


If a mask is connected, defines how the mask threshold is used to define the pixels to count: should the pixel value be lower, lower or equal, greater, etc. than the mask threshold ?

Draw_style


Wire frames, surfaces or both for the cubes ?

Line_width


For wire frames or outlined, the size of the lines.

Color


Color of the faces of the cubes. If a colormap is given, cubes are colored according to their intensities.

Line_Color


Color of the edges of the cubes.

Do


Push the first button to draw the cubes. Push the second button to create an object of the cubes in the object pool (as an Open Inventor object, HxIvData).

Commands:

Additional options can be accessed when typing in the console Draw_Cubes COMMAND_NAME. Typing the command again reverts back to original settings.

verbose

Displays timing information and number of pixels selected by the threshold and faces drawn.

toggleWarning

By default, if the number of faces to display is above a "very large" value (I set it empirically at 5 million), then the module will display a warning message, and you have to click on the Yes button to proceed. This command will remove the warning, which is useful when automating.

This is what the warning window looks like. Actual number of faces may vary...

expertMode

Shows the ports that define the polygone offset parameters. See section Advanced.

Advanced:

When drawing the lines over the faces, we have something called coplanar primitives, i.e. objects in the 3D space that overlap, which means that sometimes the lines will be in front (respective to the camera position) and sometimes the faces are in front (known as z-buffer stitching). In order to always see the outlines, a depth offset must be set for the faces, so that they're always placed behind the lines. This is called polygon offset, and is defined by two parameters, factor and units. The value of the offset is factor* z + r * units, where z is a measurement of the change in depth relative to the screen area of the polygon (commonly called the depth slope), and r is the smallest value that is guaranteed to produce a resolvable offset for a given OpenGL implementation.
These values can be modified by typing Draw_Cubes expertMode.

PO_Factor


PO_Units