21#ifndef __vtkOrientedImageDataResample_h
22#define __vtkOrientedImageDataResample_h
25#include "vtkSegmentationCoreConfigure.h"
38class vtkAbstractTransform;
62 vtkMatrix4x4* referenceGeometryMatrix,
64 bool linearInterpolation =
false);
78 bool linearInterpolation =
false,
79 bool padImage =
false,
80 vtkAbstractTransform* inputImageTransform =
nullptr,
81 double backgroundValue = 0);
92 vtkAbstractTransform* transform,
93 bool geometryOnly =
false,
94 bool alwaysResample =
false,
95 bool linearInterpolation =
false,
96 double backgroundColor[4] =
nullptr);
105 const int extent[6] =
nullptr,
106 double maskThreshold = 0,
107 double fillValue = 1,
108 bool* outputModified =
nullptr);
117 const int extent[6] =
nullptr,
118 double maskThreshold = 0,
119 double fillValue = 1);
129 static void FillImage(vtkImageData* image,
double fillValue,
const int extent[6] =
nullptr);
148 static void TransformExtent(
const int inputExtent[6], vtkAbstractTransform* inputToOutputTransform,
int outputExtent[6]);
152 static void TransformBounds(
const double inputBounds[6], vtkAbstractTransform* inputToOutputTransform,
double outputBounds[6]);
160 static bool IsEqual(vtkMatrix4x4* lhs, vtkMatrix4x4* rhs);
201 const int extent[6] =
nullptr,
202 int maskThreshold = 0);
static bool CopyImage(vtkOrientedImageData *imageToCopy, vtkOrientedImageData *outputImage, const int extent[6]=nullptr)
Copy image with clipping to the specified extent.
static bool ResampleOrientedImageToReferenceOrientedImage(vtkOrientedImageData *inputImage, vtkOrientedImageData *referenceImage, vtkOrientedImageData *outputImage, bool linearInterpolation=false, bool padImage=false, vtkAbstractTransform *inputImageTransform=nullptr, double backgroundValue=0)
static void CastImageForValue(vtkImageData *image, double value)
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 void TransformOrientedImage(vtkOrientedImageData *image, vtkAbstractTransform *transform, bool geometryOnly=false, bool alwaysResample=false, bool linearInterpolation=false, double backgroundColor[4]=nullptr)
static bool CastSegmentationToSmallestIntegerType(vtkImageData *image, double scalarRange[2])
static bool CastSegmentationToSmallestIntegerType(vtkImageData *image)
static bool IsEqual(vtkMatrix4x4 *lhs, vtkMatrix4x4 *rhs)
static bool DoGeometriesMatchIgnoreOrigin(vtkOrientedImageData *image1, vtkOrientedImageData *image2)
static void PrintImageInformation(vtkImageData *imageData, ostream &os, vtkIndent indent)
Prints image information. Does not print lots of irrelevant information that default PrintSelf would ...
@ TYPE_CONVERSION_TRUNCATION_NEEDED
@ TYPE_CONVERSION_CLAMPING_NEEDED
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.
static bool ResampleOrientedImageToReferenceGeometry(vtkOrientedImageData *inputImage, vtkMatrix4x4 *referenceGeometryMatrix, vtkOrientedImageData *outputImage, bool linearInterpolation=false)
~vtkOrientedImageDataResample() override
static bool ApplyImageMask(vtkOrientedImageData *input, vtkOrientedImageData *mask, double fillValue, bool notMask=false)
static bool DoesTransformMatrixContainShear(vtkMatrix4x4 *matrix)
Determine if a transform matrix contains shear.
static void GetLabelValuesInMask(std::vector< int > &labelValues, vtkOrientedImageData *binaryLabelmap, vtkOrientedImageData *mask, const int extent[6]=nullptr, int maskThreshold=0)
static int GetSmallestIntegerTypeForSegmentationScalarRange(double scalarRange[2])
static bool ModifyImage(vtkOrientedImageData *inputImage, vtkOrientedImageData *modifierImage, int operation, const int extent[6]=nullptr, double maskThreshold=0, double fillValue=1)
static void FillImage(vtkImageData *image, double fillValue, const int extent[6]=nullptr)
static bool DoExtentsMatch(vtkOrientedImageData *image1, vtkOrientedImageData *image2)
Determine if extents of two oriented image data objects match.
static void TransformExtent(const int inputExtent[6], vtkAbstractTransform *inputToOutputTransform, int outputExtent[6])
static int IsImageScalarTypeValid(vtkImageData *image)
vtkOrientedImageDataResample()
static bool AreEqualWithTolerance(double a, double b)
Compare two floating point numbers within tolerance.
static bool PadImageToContainImage(vtkOrientedImageData *inputImage, vtkOrientedImageData *containedImage, vtkOrientedImageData *outputImage)
Pad an image to entirely contain another image.
static vtkOrientedImageDataResample * New()
static bool IsTransformLinear(vtkAbstractTransform *transform, vtkTransform *linearTransform)
static bool GetTransformBetweenOrientedImages(vtkOrientedImageData *image1, vtkOrientedImageData *image2, vtkTransform *image1ToImage2Transform)
Calculate transform between two oriented image data.
static bool DoGeometriesMatch(vtkOrientedImageData *image1, vtkOrientedImageData *image2)
static void TransformBounds(const double inputBounds[6], vtkAbstractTransform *inputToOutputTransform, double outputBounds[6])
static void TransformOrientedImageDataBounds(vtkOrientedImageData *image, vtkAbstractTransform *transform, double transformedBounds[6])
Transform bounds of oriented image data using a linear or non-linear transform.
static bool IsLabelInMask(vtkOrientedImageData *binaryLabelmap, vtkOrientedImageData *mask, int extent[6]=nullptr, int maskThreshold=0)
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.
Image data containing orientation information.