List of my modules...
Module: Keep tube
Description:
Extracts pixels contained in a tube defined by an inner and outer radius, sets other pixels to a given constant. The module was made for cylindrical objects, where typically outside this outer radius there is irrelevant data (see first example).
Left : original image; Right : image after extraction of a tube of outer radius close to half the width of the image and zero inner radius.
Left : view of the input image, a bounding box and orthoslice, with the tube info displayed by the module. The two cylinders show the inner and outer radii, the centerball manipulator rotates and translates the tube. Right : extracted pixel illustrated with a physics colormap and drawn with the Draw_Cubes module.
Notes
- Any translation or component of the translation parallel to the cylinder axis will affect the display, moving the cropped cylinder along, but will not affect the output image, the algorithm supposes the cylinder is infinite in length.
- Because of the two-way syncing between the ports and viewer, the Direction port might automatically get updated to a normalised vector.
Connections:
Data
[required]
The input image, of type HxUniformScalarField3.
Ports:
Translation

Cylinder axis translation from the image center, in pixels.
Rotation radius

Cylinder axis direction. If 0-vector input, nothing happens.
Inside radius

Inner radius of the tube to extract.
Outside radius

Outer radius.
Options

If mask is set, will assign a constant interior value (set in the Values port) to all pixels in the tube.
Values

Constant value given to the output pixels outside the tube, and if the mask option is set, constant value for the output pixels inside the tube.
Extract a tube

Push the first button to generate the output. Push the second button to reset the tube position and orientation (not the radii) to their default value.
Commands:
Additional options can be accessed when typing in the console Keep_Tube COMMAND_NAME.
getPosition
Returns the 3D position of one point of the tube axis, in the coordinate system of the image, and relative to the center of the bounding box, i.e. when getPosition is called just after initialisation, the command will return 0 0 0.
setPosition
Sets one point of the tube axis (the centerpoint of the rendered object in the viewer). The syntax is Keep_Tube setPosition X Y Z.
getDirection
Returns the direction of the tube axis. Initial direction is 0 0 1.
setDirection
Sets the direction of the tube axis. The vector need not be normalised, the module does that for you.
setComplexity
Sets the level of detail of the Open Inventor cylinder object displayed, i.e. the number of triangles used for the mesh (for precise positioning, this may be necessary). The syntax is Keep_Tube setComplexity c. The value ranges from 0 (very ugly) to 1 (fine).
verbose
Displays timing information after the computation. Retype to hide info.
create
Runs the computation. Returns the name of the output, so it can be used in a script, such as set RESULT [Keep_Tube create].