Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
vtkOrientedImageDataResample Class Reference

Utility functions for resampling oriented image data. More...

#include <Libs/vtkSegmentationCore/vtkOrientedImageDataResample.h>

Inheritance diagram for vtkOrientedImageDataResample:
Inheritance graph
[legend]
Collaboration diagram for vtkOrientedImageDataResample:
Collaboration graph
[legend]

Public Types

enum  { OPERATION_MINIMUM, OPERATION_MAXIMUM, OPERATION_MASKING }
 
typedef vtkObject Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 

Static Public Member Functions

static bool ApplyImageMask (vtkOrientedImageData *input, vtkOrientedImageData *mask, double fillValue, bool notMask=false)
 
static bool AreEqualWithTolerance (double a, double b)
 Compare two floating point numbers within tolerance. More...
 
static bool CalculateEffectiveExtent (vtkOrientedImageData *image, int effectiveExtent[6], double threshold=0.0)
 Calculate effective extent of an image: the IJK extent where non-zero voxels are located. More...
 
static void CastImageForValue (vtkOrientedImageData *image, double value)
 
static bool CopyImage (vtkOrientedImageData *imageToCopy, vtkOrientedImageData *outputImage, const int extent[6]=nullptr)
 Copy image with clipping to the specified extent. More...
 
static bool DoesTransformMatrixContainShear (vtkMatrix4x4 *matrix)
 Determine if a transform matrix contains shear. More...
 
static bool DoExtentsMatch (vtkOrientedImageData *image1, vtkOrientedImageData *image2)
 Determine if extents of two oriented image data objects match. More...
 
static bool DoGeometriesMatch (vtkOrientedImageData *image1, vtkOrientedImageData *image2)
 
static bool DoGeometriesMatchIgnoreOrigin (vtkOrientedImageData *image1, vtkOrientedImageData *image2)
 
static void FillImage (vtkImageData *image, double fillValue, const int extent[6]=nullptr)
 
static void GetLabelValuesInMask (std::vector< int > &labelValues, vtkOrientedImageData *binaryLabelmap, vtkOrientedImageData *mask, const int extent[6]=nullptr, int maskThreshold=0)
 
static bool GetTransformBetweenOrientedImages (vtkOrientedImageData *image1, vtkOrientedImageData *image2, vtkTransform *image1ToImage2Transform)
 Calculate transform between two oriented image data. More...
 
static bool IsEqual (vtkMatrix4x4 *lhs, vtkMatrix4x4 *rhs)
 
static bool IsLabelInMask (vtkOrientedImageData *binaryLabelmap, vtkOrientedImageData *mask, int extent[6]=nullptr, int maskThreshold=0)
 
static bool IsTransformLinear (vtkAbstractTransform *transform, vtkTransform *linearTransform)
 
static int IsTypeOf (const char *type)
 
static bool MergeImage (vtkOrientedImageData *inputImage, vtkOrientedImageData *imageToAppend, vtkOrientedImageData *outputImage, int operation, const int extent[6]=nullptr, double maskThreshold=0, double fillValue=1, bool *outputModified=nullptr)
 
static bool ModifyImage (vtkOrientedImageData *inputImage, vtkOrientedImageData *modifierImage, int operation, const int extent[6]=nullptr, double maskThreshold=0, double fillValue=1)
 
static vtkOrientedImageDataResampleNew ()
 
static bool PadImageToContainImage (vtkOrientedImageData *inputImage, vtkOrientedImageData *containedImage, vtkOrientedImageData *outputImage, const int extent[6])
 Pad an image to entirely contain another image using custom extent to contain. More...
 
static bool PadImageToContainImage (vtkOrientedImageData *inputImage, vtkOrientedImageData *containedImage, vtkOrientedImageData *outputImage)
 Pad an image to entirely contain another image. More...
 
static void PrintImageInformation (vtkImageData *imageData, ostream &os, vtkIndent indent)
 Prints image information. Does not print lots of irrelevant information that default PrintSelf would print. More...
 
static bool ResampleOrientedImageToReferenceGeometry (vtkOrientedImageData *inputImage, vtkMatrix4x4 *referenceGeometryMatrix, vtkOrientedImageData *outputImage, bool linearInterpolation=false)
 
static bool ResampleOrientedImageToReferenceOrientedImage (vtkOrientedImageData *inputImage, vtkOrientedImageData *referenceImage, vtkOrientedImageData *outputImage, bool linearInterpolation=false, bool padImage=false, vtkAbstractTransform *inputImageTransform=nullptr, double backgroundValue=0)
 
static vtkOrientedImageDataResampleSafeDownCast (vtkObject *o)
 
static void TransformBounds (const double inputBounds[6], vtkAbstractTransform *inputToOutputTransform, double outputBounds[6])
 
static void TransformExtent (const int inputExtent[6], vtkAbstractTransform *inputToOutputTransform, int outputExtent[6])
 
static void TransformOrientedImage (vtkOrientedImageData *image, vtkAbstractTransform *transform, bool geometryOnly=false, bool alwaysResample=false, bool linearInterpolation=false, double backgroundColor[4]=nullptr)
 
static void TransformOrientedImageDataBounds (vtkOrientedImageData *image, vtkAbstractTransform *transform, double transformedBounds[6])
 Transform bounds of oriented image data using a linear or non-linear transform. More...
 

Protected Member Functions

 vtkOrientedImageDataResample ()
 
 ~vtkOrientedImageDataResample () override
 

Detailed Description

Utility functions for resampling oriented image data.

Definition at line 42 of file vtkOrientedImageDataResample.h.

Member Typedef Documentation

◆ Superclass

Definition at line 46 of file vtkOrientedImageDataResample.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
OPERATION_MINIMUM 
OPERATION_MAXIMUM 
OPERATION_MASKING 

Definition at line 48 of file vtkOrientedImageDataResample.h.

Constructor & Destructor Documentation

◆ vtkOrientedImageDataResample()

vtkOrientedImageDataResample::vtkOrientedImageDataResample ( )
protected

◆ ~vtkOrientedImageDataResample()

vtkOrientedImageDataResample::~vtkOrientedImageDataResample ( )
overrideprotected

Member Function Documentation

◆ ApplyImageMask()

static bool vtkOrientedImageDataResample::ApplyImageMask ( vtkOrientedImageData input,
vtkOrientedImageData mask,
double  fillValue,
bool  notMask = false 
)
static

Apply mask image on an input image

Parameters
inputInput image to apply the mask on
maskMask to apply
notMaskIf on, the mask is passed through a boolean not before it is used to mask the image. The effect is to pass the input pixels where the mask is zero, and replace the pixels where the mask is non zero

◆ AreEqualWithTolerance()

static bool vtkOrientedImageDataResample::AreEqualWithTolerance ( double  a,
double  b 
)
inlinestatic

Compare two floating point numbers within tolerance.

Definition at line 140 of file vtkOrientedImageDataResample.h.

◆ CalculateEffectiveExtent()

static bool vtkOrientedImageDataResample::CalculateEffectiveExtent ( vtkOrientedImageData image,
int  effectiveExtent[6],
double  threshold = 0.0 
)
static

Calculate effective extent of an image: the IJK extent where non-zero voxels are located.

◆ CastImageForValue()

static void vtkOrientedImageDataResample::CastImageForValue ( vtkOrientedImageData image,
double  value 
)
static

Cast the data type of the image to be able to contain the specified value

Parameters
imageImage to convert
valueValue that should be representable by the image data type

◆ CopyImage()

static bool vtkOrientedImageDataResample::CopyImage ( vtkOrientedImageData imageToCopy,
vtkOrientedImageData outputImage,
const int  extent[6] = nullptr 
)
static

Copy image with clipping to the specified extent.

◆ DoesTransformMatrixContainShear()

static bool vtkOrientedImageDataResample::DoesTransformMatrixContainShear ( vtkMatrix4x4 *  matrix)
static

Determine if a transform matrix contains shear.

◆ DoExtentsMatch()

static bool vtkOrientedImageDataResample::DoExtentsMatch ( vtkOrientedImageData image1,
vtkOrientedImageData image2 
)
static

Determine if extents of two oriented image data objects match.

◆ DoGeometriesMatch()

static bool vtkOrientedImageDataResample::DoGeometriesMatch ( vtkOrientedImageData image1,
vtkOrientedImageData image2 
)
static

Determine if geometries of two oriented image data objects match. Origin, spacing and direction are considered, extent is not.

◆ DoGeometriesMatchIgnoreOrigin()

static bool vtkOrientedImageDataResample::DoGeometriesMatchIgnoreOrigin ( vtkOrientedImageData image1,
vtkOrientedImageData image2 
)
static

Determine if geometries of two oriented image data objects match. Only considers spacing and orientation, origin and extent may be different!

◆ FillImage()

static void vtkOrientedImageDataResample::FillImage ( vtkImageData *  image,
double  fillValue,
const int  extent[6] = nullptr 
)
static

Fills an image with the specified value

Parameters
extentThe whole extent is filled if extent is not specified

◆ GetClassName()

virtual const char* vtkOrientedImageDataResample::GetClassName ( )
virtual

◆ GetLabelValuesInMask()

static void vtkOrientedImageDataResample::GetLabelValuesInMask ( std::vector< int > &  labelValues,
vtkOrientedImageData binaryLabelmap,
vtkOrientedImageData mask,
const int  extent[6] = nullptr,
int  maskThreshold = 0 
)
static

Get the values contained in the labelmap under the mask

Parameters
binaryLabelmapInput image to get values from
maskMask image to get values under
extentCan be set to restrict the examined extent to a smaller region. If nullptr, the extent will be the overlapping extent between the label and mask.
labelValuesThe values found in the binary labelmap underneath the mask
maskThresholdThreshold value for the mask. Values above this threshold are considered to be under the mask

◆ GetTransformBetweenOrientedImages()

static bool vtkOrientedImageDataResample::GetTransformBetweenOrientedImages ( vtkOrientedImageData image1,
vtkOrientedImageData image2,
vtkTransform *  image1ToImage2Transform 
)
static

Calculate transform between two oriented image data.

◆ IsA()

virtual int vtkOrientedImageDataResample::IsA ( const char *  type)
virtual

◆ IsEqual()

static bool vtkOrientedImageDataResample::IsEqual ( vtkMatrix4x4 *  lhs,
vtkMatrix4x4 *  rhs 
)
static

Compare the values (with tolerance) between two 4x4 matrices

Parameters
lhsLeft-hand side matrix to compare
rhsRight-hand side matrix to compare

◆ IsLabelInMask()

static bool vtkOrientedImageDataResample::IsLabelInMask ( vtkOrientedImageData binaryLabelmap,
vtkOrientedImageData mask,
int  extent[6] = nullptr,
int  maskThreshold = 0 
)
static

Determine if there is a non-zero value in the labelmap under the mask

Parameters
binaryLabelmapInput image to get values from
maskMask image to get values under
extentCan be set to restrict the examined extent to a smaller region. If nullptr, the extent will be the overlapping extent between the label and mask.
maskThresholdThreshold value for the mask. Values above this threshold are considered to be under the mask

◆ IsTransformLinear()

static bool vtkOrientedImageDataResample::IsTransformLinear ( vtkAbstractTransform *  transform,
vtkTransform *  linearTransform 
)
static

Determine if a transform is linear and return it if it is. A simple downcast is not enough, as the transform may be a general transform, which can be linear if the concatenation it contains consist of all linear transforms.

Parameters
transformInput transform to assess
linearTransformOutput transform in case transform is linear
Returns
True if input is linear, false otherwise.

◆ IsTypeOf()

static int vtkOrientedImageDataResample::IsTypeOf ( const char *  type)
static

◆ MergeImage()

static bool vtkOrientedImageDataResample::MergeImage ( vtkOrientedImageData inputImage,
vtkOrientedImageData imageToAppend,
vtkOrientedImageData outputImage,
int  operation,
const int  extent[6] = nullptr,
double  maskThreshold = 0,
double  fillValue = 1,
bool *  outputModified = nullptr 
)
static

Combines the inputImage and imageToAppend into a new image by max/min operation. The extent will be the union of the two images. Extent can be specified to restrict imageToAppend's extent to a smaller region. inputImage and imageToAppend must have the same geometry, but they may have different extents.

◆ ModifyImage()

static bool vtkOrientedImageDataResample::ModifyImage ( vtkOrientedImageData inputImage,
vtkOrientedImageData modifierImage,
int  operation,
const int  extent[6] = nullptr,
double  maskThreshold = 0,
double  fillValue = 1 
)
static

Modifies inputImage in-place by combining with modifierImage using max/min operation. The extent will remain unchanged. Extent can be specified to restrict modifierImage's extent to a smaller region. inputImage and modifierImage must have the same geometry (origin, spacing, directions) and scalar type, but they may have different extents.

◆ New()

static vtkOrientedImageDataResample* vtkOrientedImageDataResample::New ( )
static

◆ PadImageToContainImage() [1/2]

static bool vtkOrientedImageDataResample::PadImageToContainImage ( vtkOrientedImageData inputImage,
vtkOrientedImageData containedImage,
vtkOrientedImageData outputImage,
const int  extent[6] 
)
static

Pad an image to entirely contain another image using custom extent to contain.

◆ PadImageToContainImage() [2/2]

static bool vtkOrientedImageDataResample::PadImageToContainImage ( vtkOrientedImageData inputImage,
vtkOrientedImageData containedImage,
vtkOrientedImageData outputImage 
)
static

Pad an image to entirely contain another image.

◆ PrintImageInformation()

static void vtkOrientedImageDataResample::PrintImageInformation ( vtkImageData *  imageData,
ostream &  os,
vtkIndent  indent 
)
static

Prints image information. Does not print lots of irrelevant information that default PrintSelf would print.

◆ ResampleOrientedImageToReferenceGeometry()

static bool vtkOrientedImageDataResample::ResampleOrientedImageToReferenceGeometry ( vtkOrientedImageData inputImage,
vtkMatrix4x4 *  referenceGeometryMatrix,
vtkOrientedImageData outputImage,
bool  linearInterpolation = false 
)
static

Resample an oriented image data to match the geometry of a reference geometry matrix. Origin and dimensions are determined from the contents of the input image.

Parameters
inputImageOriented image to resample
referenceGeometryMatrixMatrix containing the desired geometry
outputImageOutput image
linearInterpolationTrue if linear interpolation is requested (fractional labelmap), or false for nearest neighbor (binary labelmap). Default is false.
Returns
Success flag

◆ ResampleOrientedImageToReferenceOrientedImage()

static bool vtkOrientedImageDataResample::ResampleOrientedImageToReferenceOrientedImage ( vtkOrientedImageData inputImage,
vtkOrientedImageData referenceImage,
vtkOrientedImageData outputImage,
bool  linearInterpolation = false,
bool  padImage = false,
vtkAbstractTransform *  inputImageTransform = nullptr,
double  backgroundValue = 0 
)
static

Resample an oriented image data to match the geometry of a reference oriented image data

Parameters
inputImageOriented image to resample
referenceImageOriented image containing the desired geometry
outputImageOutput image
linearInterpolationTrue if linear interpolation is requested (fractional labelmap), or false for nearest neighbor (binary labelmap). Default is false.
padImageIf enabled then it is made sure that the input image's extent fits into the resampled reference image, so if part of the extent is transformed to be outside the reference extent, then it is padded. Disabled by default.
inputImageTransformIf specified then inputImage will be transformed with inputImageTransform before resampled into referenceImage.
Returns
Success flag

◆ SafeDownCast()

static vtkOrientedImageDataResample* vtkOrientedImageDataResample::SafeDownCast ( vtkObject *  o)
static

◆ TransformBounds()

static void vtkOrientedImageDataResample::TransformBounds ( const double  inputBounds[6],
vtkAbstractTransform *  inputToOutputTransform,
double  outputBounds[6] 
)
static

Transform input bounds to determine output bounds. Use all bounding box corners, may miss part of the extent in case of non-linear transforms are used.

◆ TransformExtent()

static void vtkOrientedImageDataResample::TransformExtent ( const int  inputExtent[6],
vtkAbstractTransform *  inputToOutputTransform,
int  outputExtent[6] 
)
static

Transform input extent to determine output extent of an image. Use all bounding box corners, may miss part of the extent in case of non-linear transforms are used.

◆ TransformOrientedImage()

static void vtkOrientedImageDataResample::TransformOrientedImage ( vtkOrientedImageData image,
vtkAbstractTransform *  transform,
bool  geometryOnly = false,
bool  alwaysResample = false,
bool  linearInterpolation = false,
double  backgroundColor[4] = nullptr 
)
static

Transform an oriented image data using a transform that can be linear or non-linear. Linear: simply multiply the geometry matrix with the applied matrix, extent stays the same Non-linear: calculate new extents and change only the extents when applying deformable transform

Parameters
imageOriented image to transform
transformInput transform
geometryOnlyOnly the geometry of the image is changed according to the transform if this flag is turned on. This flag only has an effect if the transform is non-linear, in which case only the extent is changed. Off by default
alwaysResampleIf on, then image data will be resampled even if the applied transform is linear

◆ TransformOrientedImageDataBounds()

static void vtkOrientedImageDataResample::TransformOrientedImageDataBounds ( vtkOrientedImageData image,
vtkAbstractTransform *  transform,
double  transformedBounds[6] 
)
static

Transform bounds of oriented image data using a linear or non-linear transform.


The documentation for this class was generated from the following file: