Purpose

The module WorldVoxelConvert converts between voxel and world coordinates with respect to the image that is connected to the module’s image input field.

All coordinate fields are interconnected, changes in one field are immediately reflected in the other fields.

Usage

A point position can be specified in either voxel or world coordinates.

The WorldVoxelConvert module converts the coordinates specified in one of these coordinate systems into the other system, using the transformation matrix of the input image. For each of the two coordinate triples, the operator panel shows a vector field (Vector x, y, z) and single float fields (Single x, y, z). This way the coordinate fields can be conveniently connected to other fields in your network, vector fields as well as scalar fields.

Details

The Keep Constant field indicates which coordinate triple is viewed as “master”, i.e. which values are kept when the image or its coordinate system changes.

For example, if the voxel position is set to (0,0,0), the world coordinates reflect the physical position of the first image voxel in the patient’s coordinate system. If the input image changes while Keep Constant is set to Voxel, the voxel position remains at (0,0,0), whereas the world position is changed according to the new image’s world coordinate system. On the other hand, if Keep Constant is set to World at the moment the input image changes, the world position remains unchanged and the voxel coordinates indicate the voxel corresponding to this world position with respect to the new image’s coordinate system.

The checkbox Integer voxel coordinates in the Voxel Position section indicates whether voxel coordinates are viewed as integers or as continuous coordinates. In the first case, an integer voxel coordinate vector corresponds to the center of a voxel, whereas in the second case integer voxel coordinate vectors correspond to the voxel corners.

Windows

Default Panel

../../../Modules/ML/MLCoordUtils1/mhelp/Images/Screenshots/WorldVoxelConvert._default.png

Input Fields

input0

name: input0, type: Image

Reference image with a world-to-voxel matrix.

Parameter Fields

Field Index

Integer voxel coordinates: Bool Y (voxelY): Double
Keep Constant: Enum Y (worldY): Double
Single: X (voxelX): Double Z (voxelZ): Double
Single: X (worldX): Double Z (worldZ): Double
Vector (voxelPos): Vector3  
Vector (worldPos): Vector3  
voxelMode: Bool  
worldMode: Bool  

Visible Fields

Single: X (voxelX)

name: voxelX, type: Double, default: 0

Sets / shows the scalar x value in voxel coordinates.

Y (voxelY)

name: voxelY, type: Double, default: 0

Sets / shows the scalar y value in voxel coordinates.

Z (voxelZ)

name: voxelZ, type: Double, default: 0

Sets / shows the scalar z value in voxel coordinates.

Single: X (worldX)

name: worldX, type: Double, default: 0

Sets / shows the scalar x value in world coordinates.

Y (worldY)

name: worldY, type: Double, default: 0

Sets / shows the scalar y value in world coordinates.

Z (worldZ)

name: worldZ, type: Double, default: 0

Sets / shows the scalar z value in world coordinates.

Vector (voxelPos)

name: voxelPos, type: Vector3, default: 0 0 0

Sets / shows the vector in voxel coordinates.

Vector (worldPos)

name: worldPos, type: Vector3, default: 0 0 0

Sets / shows the vector in world coordinates.

Integer voxel coordinates

name: intVoxelCoords, type: Bool, default: FALSE

If checked, the voxel coordinates are treated as integer numbers (referring to voxel centers).

Keep Constant

name: keepConstant, type: Enum, default: Voxel

Defines the coordinate system in which a position should be kept constant.

Values:

Title Name
Voxel Voxel
World World

Hidden Fields

voxelMode

name: voxelMode, type: Bool, default: TRUE

worldMode

name: worldMode, type: Bool, default: FALSE