11.48. ITK MHA File Reader

This filter reads the image data from an MHA file.

The transformation matrix from the MHA file can be optionally read and saved as a data array and/or applied to the created image geometry.

Group (Subgroup)

ITKImageProcessing (ITKImageProcessing)

Description

Reads MHA images and the transformation matrix using ITK. Some select headers from the MHA file are read. If those headers are not available then the default values are used.

  • Number of Dimensions

  • Center of Rotation (0,0,0 is the default)

  • Offset (used as the origin for the created Image Geometry; 0,0,0 is the default)

  • Transformation Matrix

This is a variant of the Read Image (ITK) filter that also handles the transformation matrix embedded in the MHA file.

Use of the Transformation Matrix Notes

There is an option to use the transpose of the Transformation Matrix. This can be useful if the stored transformation matrix is not the correct active transformation. If the determinant of the transformation matrix is NOT 1.0 (or really close) AND the user has selected to transpose the matrix a preflight error will be thrown. Using the transpose of the transformation matrix only works if the transformation matrix purely represents a rotation: Other affine transforms are NOT allowed such as shear, scale and translation.

Technical Discussion

For a pure rotation matrix (no translation, scaling, or shear) the transpose is equal to the inverse, because rotation matrices are orthogonal (their rows and columns are orthonormal). This is why transposing is only valid when the transformation represents a pure rotation.

Interpolation Type

The Interpolation Type parameter controls the interpolation method used when resampling the image data:

  • Nearest Neighbor [0]: Uses the value of the nearest voxel when resampling. Preserves original values but may produce blocky results.

  • Linear Interpolation [1]: Computes a weighted average of surrounding voxels when resampling. Produces smoother results but may introduce new values.

Input Parameter(s)

Parameter Name

Parameter Type

Parameter Notes

Description

Input MHA File

FileSystemPath

The input .mha file that will be read.

Apply Image Transformation To Geometry

Bool

When true, the transformation matrix found in the image’s header metadata will be applied to the created image geometry.

Interpolation Type

Choices

The type of interpolation algorithm that is used. 0=NearestNeighbor, 1=Linear

Optional Transformation Matrix Parameters

Parameter Name

Parameter Type

Parameter Notes

Description

Transpose Stored Transformation Matrix

Bool

When true, the transformation matrix found in the image’s header metadata will be transposed before use.

Save Image Transformation As Array

Bool

When true, the transformation matrix found in the image’s header metadata will be saved as a data array in the created image geometry.

Transformation Matrix

ArrayCreation

The path to the transformation matrix data array

Output Image Data Objects

Parameter Name

Parameter Type

Parameter Notes

Description

Created Image Geometry

DataGroupCreation

The path to the created Image Geometry

Output Cell Attribute Matrix

Parameter Name

Parameter Type

Parameter Notes

Description

Created Cell Attribute Matrix

DataObjectName

The name of the created cell attribute matrix

Output Cell Data

Parameter Name

Parameter Type

Parameter Notes

Description

Created Cell Data

DataObjectName

The name of the created image data array. Will be stored in the created Cell Attribute Matrix

Example Pipelines

None.

DREAM3D-NX Help

If you need help, need to file a bug report or want to request a new feature, please head over to the DREAM3DNX-Issues GitHub site where the community of DREAM3D-NX users can help answer your questions.