Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::NonStaticArithmeticOperation Class Reference

Internal helper class for executing two-image arithmetic operations with ITK filters. More...

#include <mitkArithmeticOperation.h>

Public Types

enum  OperationsEnum {
  Add2 , Sub2 , Mult , Div ,
  AddValue , SubValue , MultValue , DivValue ,
  PowValue , Tan , ATan , Cos ,
  ACos , Sin , ASin , Square ,
  Sqrt , Abs , Exp , ExpNeg ,
  Log10
}
 Enumeration of all supported arithmetic operations. More...
 

Public Member Functions

void CallExecuteTwoImageFilter (mitk::Image::Pointer imageA, mitk::Image::Pointer imageB)
 Execute a two-image filter operation using ITK access macros. More...
 
template<typename TPixel1 , unsigned int VImageDimension1, typename TPixel2 , unsigned int VImageDimension2>
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. More...
 
template<typename DefaultFunctorType , typename DoubleFunctorType , typename Image1Type , typename Image2Type , typename DoubleImageType >
void ExecuteTwoImageFilterWithFunctor (Image1Type *imageA, Image2Type *imageB)
 Internal templated method that applies a functor-based binary filter to two images. More...
 

Public Attributes

mitk::Image::Pointer m_ResultImage
 The result image produced by the most recent filter execution. More...
 
OperationsEnum m_Algorithm
 The algorithm/operation to execute. More...
 
bool m_GenerateDoubleOutput
 If true, produce output with double pixel type instead of the input pixel type. More...
 

Detailed Description

Internal helper class for executing two-image arithmetic operations with ITK filters.

This class provides the non-static infrastructure needed to dispatch two-image arithmetic operations through the ITK image access macros. It handles dimension-matching, pixel-type casting, and functor-based binary filter execution.

Note
This class is intended for internal use by ArithmeticOperation. Use the static methods of ArithmeticOperation instead.
See also
ArithmeticOperation

Definition at line 289 of file mitkArithmeticOperation.h.

Member Enumeration Documentation

◆ OperationsEnum

Enumeration of all supported arithmetic operations.

Enumerator
Add2 

Two-image addition.

Sub2 

Two-image subtraction.

Mult 

Two-image multiplication.

Div 

Two-image division.

AddValue 

Add scalar value to image.

SubValue 

Subtract scalar value from image (or image from scalar)

MultValue 

Multiply image by scalar value.

DivValue 

Divide image by scalar value (or scalar by image)

PowValue 

Raise image to scalar power (or scalar to image power)

Tan 

Tangent.

ATan 

Arctangent.

Cos 

Cosine.

ACos 

Arccosine.

Sin 

Sine.

ASin 

Arcsine.

Square 

Square (x^2)

Sqrt 

Square root.

Abs 

Absolute value.

Exp 

Exponential (e^x)

ExpNeg 

Negative exponential (e^{-x})

Log10 

Base-10 logarithm.

Definition at line 294 of file mitkArithmeticOperation.h.

Member Function Documentation

◆ CallExecuteTwoImageFilter()

void mitk::NonStaticArithmeticOperation::CallExecuteTwoImageFilter ( mitk::Image::Pointer  imageA,
mitk::Image::Pointer  imageB 
)

Execute a two-image filter operation using ITK access macros.

Dispatches to the appropriate ITK access macro based on the image dimensionality (1D through 4D).

Parameters
[in]imageAThe first input image.
[in]imageBThe second input image (must have same dimensionality as imageA).
Exceptions
mitk::Exceptionif the images have different dimensionalities or unsupported dimension.

◆ ExecuteTwoImageFilter()

template<typename TPixel1 , unsigned int VImageDimension1, typename TPixel2 , unsigned int VImageDimension2>
void mitk::NonStaticArithmeticOperation::ExecuteTwoImageFilter ( itk::Image< TPixel1, VImageDimension1 > *  imageA,
itk::Image< TPixel2, VImageDimension2 > *  imageB 
)

Internal templated method that executes the two-image filter with matched pixel types.

Template Parameters
TPixel1Pixel type of the first image.
VImageDimension1Dimensionality of the first image.
TPixel2Pixel type of the second image.
VImageDimension2Dimensionality of the second image.
Parameters
[in]imageAPointer to the first ITK image.
[in]imageBPointer to the second ITK image.

◆ ExecuteTwoImageFilterWithFunctor()

template<typename DefaultFunctorType , typename DoubleFunctorType , typename Image1Type , typename Image2Type , typename DoubleImageType >
void mitk::NonStaticArithmeticOperation::ExecuteTwoImageFilterWithFunctor ( Image1Type *  imageA,
Image2Type *  imageB 
)

Internal templated method that applies a functor-based binary filter to two images.

Template Parameters
DefaultFunctorTypeThe functor type producing same-type output as the first input.
DoubleFunctorTypeThe functor type producing double output.
Image1TypeITK image type of the first input.
Image2TypeITK image type of the second input.
DoubleImageTypeITK image type for double output.
Parameters
[in]imageAPointer to the first ITK image.
[in]imageBPointer to the second ITK image.

Member Data Documentation

◆ m_Algorithm

OperationsEnum mitk::NonStaticArithmeticOperation::m_Algorithm

The algorithm/operation to execute.

Definition at line 359 of file mitkArithmeticOperation.h.

◆ m_GenerateDoubleOutput

bool mitk::NonStaticArithmeticOperation::m_GenerateDoubleOutput

If true, produce output with double pixel type instead of the input pixel type.

Definition at line 361 of file mitkArithmeticOperation.h.

◆ m_ResultImage

mitk::Image::Pointer mitk::NonStaticArithmeticOperation::m_ResultImage

The result image produced by the most recent filter execution.

Definition at line 357 of file mitkArithmeticOperation.h.


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