Purpose

The module Reformat reformats an image to a reference image and produces reformated overlays.

Usage

Using Reformat for reformating an image to a reference image

This module is used to reformat the dataset given as input0 to the local coordinate system of a reference image input1. The output image output0 has the same image properties as input0, but contains the reformated image data of image0. An additional matrix is used to rotate/scale/translate the input image.

Using Reformat for overlay images

This module can also generate overlay images for any given view of a SoView2D / SoOrthoView2D. This works by connecting output1 to an SoView2DOverlay module and connecting the SoView2DOverlay back to the overlay input.

By doing this, the SoView2DOverlay tells the Reformat about the redraw and output1 is reformated to the image currently drawn in SoView2D / SoOrthoView2D.

../../../Modules/ML/MLResample1/mhelp/Images/reformat1.jpg

Interaction

Reformat also has an interactive mode for manipulation of the overlay image, which can be used for interactive adjustment of the additional matrix.

For using this, you have to select a mouse button in the SoView2DOverlay panel. The image is translated by pressing this mouse button and rotated around the Z axis of the current view when holding the SHIFT key.

On the second tab of the module's window, the mouse buttons, keys and modifier keys can be defined for an interactive translation and/or rotation.

Tips

This module is optimized using 16.16 fixed point arithmetic for datatypes with 16 and 8bit!

It also works for other datatypes but uses a much slower double precision method, which currently only supports trilinear interpolation.

Windows

Default Panel

../../../Modules/ML/MLResample1/mhelp/Images/Screenshots/Reformat._default.png

Input Fields

input0

name: input0, type: Image

Input image to be reformatted.

input1

name: input1, type: Image

Reference image.

inOverlay

name: inOverlay, type: SoNode, deprecated name: overlay

Input for the output of a SoView2DOverlay module for interactive use.

Output Fields

output0

name: output0, type: Image

Reformatted image.

output1

name: output1, type: Image

Special output for SoView2DOverlay.

Parameter Fields

Field Index

Additional Matrix: Matrix Reset: Trigger
Auto center: Bool Rotation: Rotation
Center: Vector3 Scale: Vector3
Compose matrix: Bool Translation: Vector3
Fill Value: Double useInventorComposition: Bool
Interactive: Bool  
Interpolation: Enum  
Memory Access: Enum  

Visible Fields

Additional Matrix

name: matrix, type: Matrix, default: 1 0 0 0, 0 1 0 0, 0 0 1 0, 0 0 0 1

Matrix representation of transformation components.

This parameter can also be modified manually or via field connection.

Compose matrix

name: composeMatrix, type: Bool, default: TRUE

Activates (interactive or manual) manipulation of matrix components.

For the interactive mode, the option Interactive needs to be checked.

Scale

name: scale, type: Vector3, default: 1 1 1

Sets a scale factor vector that is applied to the input image.

Rotation

name: rotation, type: Rotation, default: 0 0 1 0

Sets a rotation that is applied to the input image.

Translation

name: translation, type: Vector3, default: 0 0 0

Sets a translation that is applied to the input image.

Center

name: center, type: Vector3, default: 0 0 0

Sets the center for the Rotation.

Fill Value

name: fillValue, type: Double, default: 0, deprecated name: fillvalue

Sets the value used for regions outside of the input image. The value is automatically clamped to the value range of the voxel data type of the first input image.

Interactive

name: interactive, type: Bool, default: TRUE

If checked, the module accepts interactive manipulation (with a SoView2DOverlay module).

Auto center

name: autoCenter, type: Bool, default: TRUE

If checked, the center of rotation is always the center of the image.

Interpolation

name: interpolation, type: Enum, default: Trilinear, deprecated name: Mode

Defines the interpolation for resampling.

Values:

Title Name Description
Nearest Neighbor NearestNeighbor

No interpolation, picks the nearest input image voxel.

Fastest mode.

Trilinear Trilinear

Trilinear filtering. The 8-voxel-neighborhood is used for linear interpolation.

Slowest mode.

Trilinear Skip Border TrilinearSkipBorder

Same as Trilinear, but all output voxels that depend on a voxel outside of the input image are filled with Fill Value.

Faster than Trilinear.

Reset

name: resetMatrix, type: Trigger

if pressed, the fields Scale, Translation, Center, and Rotation are reset to their default values.

Memory Access

name: memoryAccess, type: Enum, default: Global

Defines how the module accesses the input image.

Values:

Title Name Description
Global Global

Fastest, but highest memory cosumption and initialization time. The input image is accessed as a global image (via the ML memory image). This consumes a lot of memory for large datasets.

If not enough memory is available, the module falls back to the Virtual Volume memory access.

Virtual Volume VirtualVolume Slowest, but works on huge datasets. All pages of the input image are requested via the virtual volume mechanism, thus only small portions of the input image are needed at the same time.

Hidden Fields

useInventorComposition

name: useInventorComposition, type: Bool, default: FALSE