13 #ifndef mitkArithmeticOperation_h
14 #define mitkArithmeticOperation_h
52 static Image::Pointer
Add(Image::Pointer & imageA, Image::Pointer & imageB,
bool outputAsDouble =
true);
62 static Image::Pointer
Subtract(Image::Pointer & imageA, Image::Pointer & imageB,
bool outputAsDouble =
true);
72 static Image::Pointer
Multiply(Image::Pointer & imageA, Image::Pointer & imageB,
bool outputAsDouble =
true);
82 static Image::Pointer
Divide(Image::Pointer & imageA, Image::Pointer & imageB,
bool outputAsDouble =
true);
99 static Image::Pointer
Add(Image::Pointer & imageA,
double value,
bool outputAsDouble =
true);
108 static Image::Pointer
Subtract(Image::Pointer & imageA,
double value,
bool outputAsDouble =
true);
117 static Image::Pointer
Multiply(Image::Pointer & imageA,
double value,
bool outputAsDouble =
true);
126 static Image::Pointer
Divide(Image::Pointer & imageA,
double value,
bool outputAsDouble =
true);
143 static Image::Pointer
Add(
double value, Image::Pointer & imageB,
bool outputAsDouble =
true);
152 static Image::Pointer
Subtract(
double value, Image::Pointer & imageB,
bool outputAsDouble =
true);
161 static Image::Pointer
Multiply(
double value, Image::Pointer & imageB,
bool outputAsDouble =
true);
170 static Image::Pointer
Divide(
double value, Image::Pointer & imageB,
bool outputAsDouble =
true);
185 static Image::Pointer
Tan(Image::Pointer & imageA,
bool outputAsDouble =
true);
193 static Image::Pointer
Atan(Image::Pointer & imageA,
bool outputAsDouble =
true);
201 static Image::Pointer
Cos(Image::Pointer & imageA,
bool outputAsDouble =
true);
209 static Image::Pointer
Acos(Image::Pointer & imageA,
bool outputAsDouble =
true);
217 static Image::Pointer
Sin(Image::Pointer & imageA,
bool outputAsDouble =
true);
225 static Image::Pointer
Asin(Image::Pointer & imageA,
bool outputAsDouble =
true);
233 static Image::Pointer
Square(Image::Pointer & imageA,
bool outputAsDouble =
true);
241 static Image::Pointer
Sqrt(Image::Pointer & imageA,
bool outputAsDouble =
true);
249 static Image::Pointer
Abs(Image::Pointer & imageA,
bool outputAsDouble =
true);
257 static Image::Pointer
Exp(Image::Pointer & imageA,
bool outputAsDouble =
true);
265 static Image::Pointer
ExpNeg(Image::Pointer & imageA,
bool outputAsDouble =
true);
273 static Image::Pointer
Log10(Image::Pointer & imageA,
bool outputAsDouble =
true);
340 template <
typename TPixel1,
unsigned int VImageDimension1,
typename TPixel2,
unsigned int VImageDimension2>
341 void ExecuteTwoImageFilter(itk::Image<TPixel1, VImageDimension1>* imageA, itk::Image<TPixel2, VImageDimension2>* imageB);
353 template<
typename DefaultFunctorType,
typename DoubleFunctorType,
typename Image1Type,
typename Image2Type,
typename DoubleImageType>
361 bool m_GenerateDoubleOutput =
false;
#define MITKBASICIMAGEPROCESSING_EXPORT
Provides static methods for voxel-wise arithmetic operations on images.
static Image::Pointer Multiply(Image::Pointer &imageA, Image::Pointer &imageB, bool outputAsDouble=true)
Voxel-wise multiplication of two images: result = imageA * imageB.
static Image::Pointer Abs(Image::Pointer &imageA, bool outputAsDouble=true)
Compute the absolute value of each voxel: result = |imageA|.
static Image::Pointer Add(Image::Pointer &imageA, double value, bool outputAsDouble=true)
Add a scalar value to each voxel: result = imageA + value.
static Image::Pointer Cos(Image::Pointer &imageA, bool outputAsDouble=true)
Compute the cosine of each voxel: result = cos(imageA).
static Image::Pointer Subtract(double value, Image::Pointer &imageB, bool outputAsDouble=true)
Subtract each voxel from a scalar: result = value - imageB.
static Image::Pointer Divide(double value, Image::Pointer &imageB, bool outputAsDouble=true)
Divide a scalar by each voxel: result = value / imageB.
static Image::Pointer Acos(Image::Pointer &imageA, bool outputAsDouble=true)
Compute the arccosine of each voxel: result = acos(imageA).
static Image::Pointer Asin(Image::Pointer &imageA, bool outputAsDouble=true)
Compute the arcsine of each voxel: result = asin(imageA).
static Image::Pointer Tan(Image::Pointer &imageA, bool outputAsDouble=true)
Compute the tangent of each voxel: result = tan(imageA).
static Image::Pointer Sin(Image::Pointer &imageA, bool outputAsDouble=true)
Compute the sine of each voxel: result = sin(imageA).
static Image::Pointer Add(Image::Pointer &imageA, Image::Pointer &imageB, bool outputAsDouble=true)
Voxel-wise addition of two images: result = imageA + imageB.
static Image::Pointer Add(double value, Image::Pointer &imageB, bool outputAsDouble=true)
Add a scalar value to each voxel (commutative): result = value + imageB.
static Image::Pointer ExpNeg(Image::Pointer &imageA, bool outputAsDouble=true)
Compute the negative exponential of each voxel: result = exp(-imageA).
static Image::Pointer Divide(Image::Pointer &imageA, Image::Pointer &imageB, bool outputAsDouble=true)
Voxel-wise division of two images: result = imageA / imageB.
static Image::Pointer Log10(Image::Pointer &imageA, bool outputAsDouble=true)
Compute the base-10 logarithm of each voxel: result = log10(imageA).
static Image::Pointer Multiply(Image::Pointer &imageA, double value, bool outputAsDouble=true)
Multiply each voxel by a scalar value: result = imageA * value.
static Image::Pointer Subtract(Image::Pointer &imageA, double value, bool outputAsDouble=true)
Subtract a scalar value from each voxel: result = imageA - value.
static Image::Pointer Sqrt(Image::Pointer &imageA, bool outputAsDouble=true)
Compute the square root of each voxel: result = sqrt(imageA).
static Image::Pointer Subtract(Image::Pointer &imageA, Image::Pointer &imageB, bool outputAsDouble=true)
Voxel-wise subtraction of two images: result = imageA - imageB.
static Image::Pointer Exp(Image::Pointer &imageA, bool outputAsDouble=true)
Compute the exponential of each voxel: result = exp(imageA).
static Image::Pointer Atan(Image::Pointer &imageA, bool outputAsDouble=true)
Compute the arctangent of each voxel: result = atan(imageA).
static Image::Pointer Multiply(double value, Image::Pointer &imageB, bool outputAsDouble=true)
Multiply a scalar by each voxel (commutative): result = value * imageB.
static Image::Pointer Divide(Image::Pointer &imageA, double value, bool outputAsDouble=true)
Divide each voxel by a scalar value: result = imageA / value.
static Image::Pointer Square(Image::Pointer &imageA, bool outputAsDouble=true)
Compute the square of each voxel: result = imageA^2.
Internal helper class for executing two-image arithmetic operations with ITK filters.
void ExecuteTwoImageFilter(itk::Image< TPixel1, VImageDimension1 > *imageA, itk::Image< TPixel2, VImageDimension2 > *imageB)
Internal templated method that executes the two-image filter with matched pixel types.
OperationsEnum m_Algorithm
The algorithm/operation to execute.
OperationsEnum
Enumeration of all supported arithmetic operations.
@ Add2
Two-image addition.
@ Sub2
Two-image subtraction.
@ PowValue
Raise image to scalar power (or scalar to image power)
@ ExpNeg
Negative exponential (e^{-x})
@ DivValue
Divide image by scalar value (or scalar by image)
@ SubValue
Subtract scalar value from image (or image from scalar)
@ Mult
Two-image multiplication.
@ AddValue
Add scalar value to image.
@ MultValue
Multiply image by scalar value.
void CallExecuteTwoImageFilter(mitk::Image::Pointer imageA, mitk::Image::Pointer imageB)
Execute a two-image filter operation using ITK access macros.
void ExecuteTwoImageFilterWithFunctor(Image1Type *imageA, Image2Type *imageB)
Internal templated method that applies a functor-based binary filter to two images.
mitk::Image::Pointer m_ResultImage
The result image produced by the most recent filter execution.
Find image slices visible on a given plane.