MPRPath

MLModule
genre Resample
author MeVis Medical Solutions AG
package MeVisLab/Standard
dll MLResample1
definition MLResample1.def
see also MPR, PathToKeyFrame, SoView2DMarkerEditor
inherits from MPRLight
keywords multi, planar, reformat, slice, keyframes

Purpose

The module MPRPath extracts a curved multi-planar reformatted image defined by a path of key frames.

It generates the MPR image at a given key frame, the complete image stack along the path, and a cross-section along the path at a given angle (0-360°).

It is derived from the MPR module, and hence shares most parameters.

Usage

The module requires a KeyFrameList at its input.

This is typically generated by the PathToKeyFrame module, e.g. from a list of markers genrated with a SoView2DMarkerEditor (see the example network) or by a skeletonization algorithm.

Any ML module can generate an ml.KeyFrameList or ml.XMarkerList itself and export it as an ml.Base Field.

The coordinate system used in the input lists is the world coordinate system.

Details

Each key frame in the KeyFrameList provided at the input of this module specifies the position of a single output MPR slice in world coordinates and its orientation.

The orientation is defined by a path tangent vector t orthogonal to the MPR slice and an up-vector u describing the “vertical” direction. The world coordinate vectors wx, wy, wz of an output MPR slice are given by:

(wx, wy, wz) = (u x t, u, t),

where u x t denotes the cross-product.

Optionally it is also possible to align the MPR slice along the path. The MPR slice is then centred at the position of the current key frame, alingned along the orientation of the path at the current key frame and rotated by Path Angle. Thus the world coordinate vectors defining the orientation are then defined by:

(wx, wy, wz) = (t, u, t x u)

and a rotation around t by Path Angle.

The curved MPR output image at output2 is a 2D image in which each voxel column corresponds to a key frame of the input KeyFrameList. If Path Angle is 0, the voxels in each column are resampled along a line in the negative X-direction of the corresponding MPR slice.

Hence, the column vector c is computed from the key frame’s tangent and up-vector by:

c = - u x t.

If Path Angle is > 0, the column vector is rotate counter-clockwise by this angle (viewing in path direction).

The world coordinates of the CPR in output2 cannot be described via a matrix anymore, therefore it is possible to transform an inputMarkerList into an outputMarkerList, taking into account the individual world coordinate systems of each CPR image column. In order to do so, every marker is associated with the keyframe whose CPR column is closest to the marker, maximizing the likelihood that it is visualized. (Currently, every marker is output exactly once, even if multiple CPR columns intersect with its world position.)

Images

Definition of Path with Markers:

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

Curved Cross-Section along Path:

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

3D Inventor Scene Output:

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

Reorientation of MPR by Aligning to Path:

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

Windows

Default Panel

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

Input Fields

input0

name: input0, type: Image

Input image

see also MPRLight.input0

frames

name: frames, type: KeyFrameList(MLBase)

KeyFrameList, usually directly connected from PathToKeyFrame

For accessing this object via scripting see the Scripting Reference: MLKeyFrameListWrapper.

inputMarkerList

name: inputMarkerList, type: XMarkerList(MLBase)

XMarkerList to be transformed into the rectilinear CPR coordinate system

For accessing this object via scripting see the Scripting Reference: MLXMarkerListWrapper.

Output Fields

output0

name: output0, type: Image

The output MPR slice at the position specified by the Current Key Frame parameter.

see also MPRLight.output0

output1

name: output1, type: Image

The complete stack of output MPR slices for all key frames.

output2

name: output2, type: Image

The curved MPR image with columns resampled orthogonal to the input path.

outputSlice

name: outputSlice, type: SoNode

An Open Inventor scene representing the path and the current MPR slice in 3D.

outputMarkerList

name: outputMarkerList, type: XMarkerList(MLBase)

Transformed version of inputMarkerList that can be overlaid on output2 (see Details).

For accessing this object via scripting see the Scripting Reference: MLXMarkerListWrapper.

Parameter Fields

Field Index

Activate clip plane: Bool Enable rendering of MPR slice: Bool outputSizeX: Integer
Align output slice along path: Bool enableCurrentSlice: Bool outputSizeY: Integer
Alpha: Float enablePlaneEdit: Bool pageSizeX: Integer
Aspect Ratio: Double Field Of View: Double pageSizeY: Integer
autoCenter: Bool fieldOfViewX: Double Path Angle: Double
axial: Trigger fieldOfViewY: Double Plane (plane): Plane
axialOnInput: Trigger Fill Value: Double Plane (curvedMprPlane): Plane
Blend Mode: Enum Flip Clip Plane: Bool representInputSlice: Trigger
Border Color: Color Image Color: Color Rotation: Rotation
Border Handling: Enum inputSliceNo: Integer sagittal: Trigger
centeredTranslation: Vector3 Interactive manipulator: Bool sagittalOnInput: Trigger
Clip Plane Offset: Float Interpolation: Enum Size (slabSize): Double
coronal: Trigger Markers correspond to frames: Bool Size (curvedMprSlabSize): Double
coronalOnInput: Trigger maxKeyFrame: Integer snapCurrentSliceToIntegerIfOrthogonal: Bool
Current Key Frame: Integer Memory Access: Enum Time Projection: Enum
currentSlice: Double Mode (slabMode): Enum Time Span: Integer
currentSliceMax: Integer Mode (curvedMprSlabMode): Enum Time Start: Integer
currentSliceMin: Integer numberOfSlices: Integer Translation: Vector3
currentSliceRounded: Integer On (showUpVectors): Bool Up-Vector Color: Color
Depth Projection: Enum On (borderOn): Bool upVector: Vector3
disableDirectVoxelCopy: Bool On (drawImageOn): Bool Use Key Frame Distance For Slice Thickness: Bool
Draw axes: Bool Output Size: Integer Use Z buffer: Bool
Enable: Bool outputSizeMode: Enum useUpVector: Bool

Visible Fields

Rotation

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

Show the rotation at the current key frame.

Translation

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

Shows the translation at the current key frame.

Plane (plane)

name: plane, type: Plane, default: 0 0 1 0

Shows the plane at the current key frame.

Fill Value

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

Sets a value used for regions outside of the input image.

Field Of View

name: fieldOfView, type: Double, default: 100

Sets the extent of the MPR slice in the world coordinate system (in mm).

Output Size

name: outputSize, type: Integer, default: 256, minimum: 1

Sets the size of the output MPR slice in (X,Y) pixels. This value is also used as the height of the curved MPR image (output2) in pixels.

Aspect Ratio

name: aspectRatio, type: Double, default: 1

Allows to specify the aspect ratio of the output0 and output1.

Mode (slabMode)

name: slabMode, type: Enum, default: SizeInSlicesForward

Defines how the slab size is calculated.

Values:

Title Name
Mm SizeInMm
Mm Forward SizeInMmForward
Slices SizeInSlices
Slices Forward SizeInSlicesForward
Slices Negative First SizeInSlicesNegativeFirst

Size (slabSize)

name: slabSize, type: Double, default: 1, minimum: 0.01, deprecated name: outputDepth

Interpolation

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

Defines the interpolation scheme.

Values:

Title Name Deprecated Name Description
Nearest Neighbor NearestNeighbor Nearest Neigbour No interpolation, picks the nearest input image voxel.
Trilinear Trilinear Trilinear(skip border),TrilinearSkipBorder Trilinear filtering. The 8-voxel-neighborhood is used for linear interpolation.

Border Handling

name: borderHandling, type: Enum, default: UseFillValue

See MPR for details.

Memory Access

name: memoryAccess, type: Enum, default: Global, deprecated name: pagedInputImage

Defines the type of memory access.

Falls back to VirtualVolume if no sufficient memory space is available.

Values:

Title Name Deprecated Name Description
Global Global FALSE,Paged,TRUE

Slower than Global, except for small MPR’s in large input images.

The output MPR is split into tiles that are processed individually. For each tile, the module requests the corresponding 3D region of the input image.

If not enough memory is available, the module falls back to VirtualVolume 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.

Enable

name: enableSlabProjection, type: Bool, default: FALSE

Enables the projection of the slab to a single slice. This applies to the output0 and to the curved MPR output2.

Depth Projection

name: depthSlabRenderMode, type: Enum, default: Maximum

Selects the projection mode for the slab depth.

Values:

Title Name
Minimum Minimum
Maximum Maximum
Average Average
Keep Dimension KeepDimension

Time Projection

name: timeSlabRenderMode, type: Enum, default: Maximum

Selects the temporal projection mode.

Values:

Title Name
Minimum Minimum
Maximum Maximum
Average Average
Keep Dimension KeepDimension

Time Start

name: timeSlabStart, type: Integer, default: 0

Selects the temporal start position.

Time Span

name: timeSlabSize, type: Integer, default: 1

Sets the number of time points that are projected.

Current Key Frame

name: currentKeyFrame, type: Integer, default: 0, minimum: 0, maximum: :field:`maxKeyFrame`

Sets the index of the current key frame.

Path Angle

name: pathAngle, type: Double, default: 0, minimum: 0, maximum: 360

Sets the angle (in degrees) about wich the column vectors of the curved MPR image (output2) are rotated.

If Align output slice along path is activated, the MPR slice at output0 and the Inventor scene output are also rotated.

Plane (curvedMprPlane)

name: curvedMprPlane, type: Plane, persistent: no

Shows the plane spanned by the current key frame’s tangent and the corresponding column vector of the curved MPR image.

The section of this plane and the current MPR slice yields the line along which the voxel column in the curved MPR image are resampled.

Align output slice along path

name: alignAlongPath, type: Bool, default: FALSE

If checked, the MPR slice at output0 as well as the Inventor scene output are rotated to lie in the defined path of key frames.

Size (curvedMprSlabSize)

name: curvedMprSlabSize, type: Double, default: 1, minimum: 0.01, deprecated name: thicknessOfCurvedMPR

Sets the number of slices of the curved MPR.

If the value is greater than 1, the module provides a stack of curved MPR slices at output2 instead of a single curved MPR slice.

Markers correspond to frames

name: markersOnFrames, type: Bool, default: TRUE

Use faster transformation algorithm that only works if there is a 1:1 correspondence between the inputMarkerList and the frames (which is a common use case e.g. if connecting the resampled path from PathToKeyFrame)

Mode (curvedMprSlabMode)

name: curvedMprSlabMode, type: Enum, default: SizeInSlices

Specifies how the slab size of the curved MPR is defined.

Values:

Title Name
Mm SizeInMm
Mm Forward SizeInMmForward
Slices SizeInSlices
Slices Forward SizeInSlicesForward
Slices Negative First SizeInSlicesNegativeFirst

Use Key Frame Distance For Slice Thickness

name: useKeyFrameDistanceForSliceThickness, type: Bool, default: TRUE

If enabled, the slice thickness (z voxel size) of output0 is calculated from the distance between the current key frame and next/previous frames. If disabled, the voxel size is calculated as in the MPR module.

On (showUpVectors)

name: showUpVectors, type: Bool, default: FALSE

If checked, up-vectors are drawn for each MPR.

Enable rendering of MPR slice

name: showFrame, type: Bool, default: TRUE

If checked, the MPR slice data is drawn.

Up-Vector Color

name: upVectorColor, type: Color, default: 1 1 1

Sets the color of the up-vector.

Image Color

name: imageColor, type: Color, default: 1 1 1, deprecated name: baseColor

Sets the color of the MPR slices.

Border Color

name: borderColor, type: Color, default: 1 1 1

Sets the color of the border.

On (borderOn)

name: borderOn, type: Bool, default: TRUE

If checked, a border around the MPR slice is drawn.

On (drawImageOn)

name: drawImageOn, type: Bool, default: TRUE

Enables drawing of the MPR image in Inventor.

Interactive manipulator

name: manipulatorOn, type: Bool, default: TRUE

If checked, an interactive manipulator is available.

If allows for translating, scaling and rotating the MPR slice in the Open Inventor scene.

Activate clip plane

name: clipPlaneOn, type: Bool, default: FALSE

If checked, the clip plane at the MPR is activated.

Flip Clip Plane

name: flipClipPlane, type: Bool, default: FALSE

If checked, the clip plane at the MPR clips the other half-plane.

Clip Plane Offset

name: clipPlaneOffset, type: Float, default: 0

Sets an offset for the clip plane (distance to the MPR).

Draw axes

name: axesOn, type: Bool, default: FALSE, deprecated name: drawVectors

If checked, axes are drawn at the MPR.

Alpha

name: alphaFactor, type: Float, default: 1, minimum: 0, maximum: 1

Defines the alpha factor of the MPR slice in Inventor.

Use Z buffer

name: zBuffer, type: Bool, default: TRUE

If checked, the z-buffer test is active.

Blend Mode

name: blendMode, type: Enum, default: BLEND_REPLACE

Defines the used blend mode.

Values:

Title Name
Replace BLEND_REPLACE
Screen BLEND_SCREEN
Add BLEND_ADD
Minimum BLEND_MINIMUM
Maximum BLEND_MAXIMUM
Reverse Subtract BLEND_REVERSE_SUBTRACT
Subtract BLEND_SUBTRACT
Blend BLEND_BLEND
Premultiplied Blend BLEND_PREMULTIPLIED_BLEND

Hidden Fields

enablePlaneEdit

name: enablePlaneEdit, type: Bool, default: FALSE

autoCenter

name: autoCenter, type: Bool, default: FALSE

centeredTranslation

name: centeredTranslation, type: Vector3, persistent: no

outputSizeMode

name: outputSizeMode, type: Enum, default: AspectRatio

Values:

Title Name
Aspect Ratio AspectRatio
Independent Independent
Automatic Automatic

fieldOfViewX

name: fieldOfViewX, type: Double, default: 100

fieldOfViewY

name: fieldOfViewY, type: Double, default: 100

outputSizeX

name: outputSizeX, type: Integer, default: 256

outputSizeY

name: outputSizeY, type: Integer, default: 256

pageSizeX

name: pageSizeX, type: Integer, default: 128

pageSizeY

name: pageSizeY, type: Integer, default: 128

useUpVector

name: useUpVector, type: Bool, default: FALSE, deprecated name: forceUpright

If checked, the MPR slice’s Y-axis are forced to be close to the world Y-axis (or Z-axis if the MPR slice normal is parallel to the Y-axis).

upVector

name: upVector, type: Vector3, default: 0 1 0

disableDirectVoxelCopy

name: disableDirectVoxelCopy, type: Bool, default: FALSE

inputSliceNo

name: inputSliceNo, type: Integer, default: 0

representInputSlice

name: representInputSlice, type: Trigger

axial

name: axial, type: Trigger

sagittal

name: sagittal, type: Trigger

coronal

name: coronal, type: Trigger

axialOnInput

name: axialOnInput, type: Trigger

sagittalOnInput

name: sagittalOnInput, type: Trigger

coronalOnInput

name: coronalOnInput, type: Trigger

enableCurrentSlice

name: enableCurrentSlice, type: Bool, default: FALSE

currentSlice

name: currentSlice, type: Double, default: 0, minimum: :field:`currentSliceMin`, maximum: :field:`currentSliceMax`

currentSliceRounded

name: currentSliceRounded, type: Integer, default: 0

numberOfSlices

name: numberOfSlices, type: Integer, default: 0

currentSliceMin

name: currentSliceMin, type: Integer, default: 0

currentSliceMax

name: currentSliceMax, type: Integer, default: 0

snapCurrentSliceToIntegerIfOrthogonal

name: snapCurrentSliceToIntegerIfOrthogonal, type: Bool, default: TRUE

maxKeyFrame

name: maxKeyFrame, type: Integer, default: 0