ITK  5.4.0
Insight Toolkit
Classes | Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | List of all members
itk::Functor::JoinFunctor< TPixel1, TPixel2 > Class Template Reference

#include <itkJoinImageFilter.h>

Detailed Description

template<typename TPixel1, typename TPixel2>
class itk::Functor::JoinFunctor< TPixel1, TPixel2 >

Join the components of two pixel types into a single pixel type.

JoinFunctor combines the components of two pixel types into a single pixel type. The components of one pixel are appended to the components of the other pixel. The output pixel type is an itk::Vector. The ValueType of the vector is the smallest scalar type that can represent the dynamic range of the both the input pixel value types. Hence, joining a char and unsigned char results in a short since that is the smallest datatype with a large enough dynamic range. To define a consistent behavior across different architectures, the join of an int and an unsigned int is float. On a 64 bit architecture, this join could be represented in a long. But on 32 bit architectures, the only safe join value type is a float. For this and similar ambiguous cases, the join value type is promoted to a float.

Definition at line 48 of file itkJoinImageFilter.h.

Classes

struct  CopierDispatch
 
struct  CopierDispatchBase
 

Public Types

using JoinType = Vector< JoinValueType, Self::JoinDimension >
 
using JoinValueType = typename JoinTraits< ValueType1, ValueType2 >::ValueType
 
using Self = JoinFunctor
 
using ValueType1 = typename PixelTraits< TPixel1 >::ValueType
 
using ValueType2 = typename PixelTraits< TPixel2 >::ValueType
 

Public Member Functions

 ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION (JoinFunctor)
 
JoinType operator() (const TPixel1 &A, const TPixel2 &B) const
 
bool operator== (const JoinFunctor &) const
 

Static Public Attributes

static constexpr unsigned int Dimension1 = PixelTraits<TPixel1>::Dimension
 
static constexpr unsigned int Dimension2 = PixelTraits<TPixel2>::Dimension
 
static constexpr unsigned int JoinDimension = Dimension1 + Dimension2
 

Private Member Functions

void FirstCopier (CopierDispatch< 1 >, JoinType &out, unsigned int idx, const TPixel1 &A) const
 
void FirstCopier (JoinType &out, unsigned int idx, const TPixel1 &A) const
 
void SecondCopier (JoinType &out, unsigned int idx, const TPixel2 &B) const
 
void FirstCopier (CopierDispatchBase, JoinType &out, unsigned int idx, const TPixel1 &A) const
 
void SecondCopier (CopierDispatchBase, JoinType &out, unsigned int idx, const TPixel2 &B) const
 
void SecondCopier (CopierDispatch< 1 >, JoinType &out, unsigned int idx, const TPixel2 &B) const
 

Member Typedef Documentation

◆ JoinType

template<typename TPixel1 , typename TPixel2 >
using itk::Functor::JoinFunctor< TPixel1, TPixel2 >::JoinType = Vector<JoinValueType, Self::JoinDimension>

A vector of the join dimension.

Definition at line 66 of file itkJoinImageFilter.h.

◆ JoinValueType

template<typename TPixel1 , typename TPixel2 >
using itk::Functor::JoinFunctor< TPixel1, TPixel2 >::JoinValueType = typename JoinTraits<ValueType1, ValueType2>::ValueType

Definition at line 58 of file itkJoinImageFilter.h.

◆ Self

template<typename TPixel1 , typename TPixel2 >
using itk::Functor::JoinFunctor< TPixel1, TPixel2 >::Self = JoinFunctor

Standard type alias

Definition at line 53 of file itkJoinImageFilter.h.

◆ ValueType1

template<typename TPixel1 , typename TPixel2 >
using itk::Functor::JoinFunctor< TPixel1, TPixel2 >::ValueType1 = typename PixelTraits<TPixel1>::ValueType

Typedefs for the output join type.

Definition at line 56 of file itkJoinImageFilter.h.

◆ ValueType2

template<typename TPixel1 , typename TPixel2 >
using itk::Functor::JoinFunctor< TPixel1, TPixel2 >::ValueType2 = typename PixelTraits<TPixel2>::ValueType

Definition at line 57 of file itkJoinImageFilter.h.

Member Function Documentation

◆ FirstCopier() [1/3]

template<typename TPixel1 , typename TPixel2 >
void itk::Functor::JoinFunctor< TPixel1, TPixel2 >::FirstCopier ( CopierDispatch< 1 >  ,
JoinType out,
unsigned int  idx,
const TPixel1 &  A 
) const
inlineprivate

Copier function specific to a scalar first pixel.

Definition at line 132 of file itkJoinImageFilter.h.

◆ FirstCopier() [2/3]

template<typename TPixel1 , typename TPixel2 >
void itk::Functor::JoinFunctor< TPixel1, TPixel2 >::FirstCopier ( CopierDispatchBase  ,
JoinType out,
unsigned int  idx,
const TPixel1 &  A 
) const
inlineprivate

Copier function specific to a vector type first pixel.

Definition at line 122 of file itkJoinImageFilter.h.

References itk::Functor::JoinFunctor< TPixel1, TPixel2 >::Dimension1.

◆ FirstCopier() [3/3]

template<typename TPixel1 , typename TPixel2 >
void itk::Functor::JoinFunctor< TPixel1, TPixel2 >::FirstCopier ( JoinType out,
unsigned int  idx,
const TPixel1 &  A 
) const
inlineprivate

Copier function to copy the first pixel to the output pixel casting as necessary. The contents of the source pixel are placed in the output pixel at position idx. This method simply delegates to one of two overloaded implementations based on the dimension (or number of components) of the first pixel. FirstCopier() and SecondCopier() are defined as distinct functions (as opposed to being a single Copier() function overloaded on the last parameter type or pixel type) to avoid "already declared/defined" errors for the case where TPixel1 and TPixel2 are the same types.

Definition at line 115 of file itkJoinImageFilter.h.

Referenced by itk::Functor::JoinFunctor< TPixel1, TPixel2 >::operator()().

◆ ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION()

template<typename TPixel1 , typename TPixel2 >
itk::Functor::JoinFunctor< TPixel1, TPixel2 >::ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION ( JoinFunctor< TPixel1, TPixel2 >  )

◆ operator()()

template<typename TPixel1 , typename TPixel2 >
JoinType itk::Functor::JoinFunctor< TPixel1, TPixel2 >::operator() ( const TPixel1 &  A,
const TPixel2 &  B 
) const
inline

◆ operator==()

template<typename TPixel1 , typename TPixel2 >
bool itk::Functor::JoinFunctor< TPixel1, TPixel2 >::operator== ( const JoinFunctor< TPixel1, TPixel2 > &  ) const
inline

Definition at line 69 of file itkJoinImageFilter.h.

◆ SecondCopier() [1/3]

template<typename TPixel1 , typename TPixel2 >
void itk::Functor::JoinFunctor< TPixel1, TPixel2 >::SecondCopier ( CopierDispatch< 1 >  ,
JoinType out,
unsigned int  idx,
const TPixel2 &  B 
) const
inlineprivate

Copier function specific to a scalar second pixel.

Definition at line 160 of file itkJoinImageFilter.h.

◆ SecondCopier() [2/3]

template<typename TPixel1 , typename TPixel2 >
void itk::Functor::JoinFunctor< TPixel1, TPixel2 >::SecondCopier ( CopierDispatchBase  ,
JoinType out,
unsigned int  idx,
const TPixel2 &  B 
) const
inlineprivate

Copier function specific to a vector type second pixel.

Definition at line 150 of file itkJoinImageFilter.h.

References itk::Functor::JoinFunctor< TPixel1, TPixel2 >::Dimension2.

◆ SecondCopier() [3/3]

template<typename TPixel1 , typename TPixel2 >
void itk::Functor::JoinFunctor< TPixel1, TPixel2 >::SecondCopier ( JoinType out,
unsigned int  idx,
const TPixel2 &  B 
) const
inlineprivate

Copier function to copy the second pixel to the output pixel casting as necessary. The contents of the source pixel are placed in the output pixel at position idx. This method simply delegates to one of two overloaded implementations based on the dimension (or number of components) of the second pixel.

Definition at line 143 of file itkJoinImageFilter.h.

Referenced by itk::Functor::JoinFunctor< TPixel1, TPixel2 >::operator()().

Member Data Documentation

◆ Dimension1

template<typename TPixel1 , typename TPixel2 >
constexpr unsigned int itk::Functor::JoinFunctor< TPixel1, TPixel2 >::Dimension1 = PixelTraits<TPixel1>::Dimension
staticconstexpr

◆ Dimension2

template<typename TPixel1 , typename TPixel2 >
constexpr unsigned int itk::Functor::JoinFunctor< TPixel1, TPixel2 >::Dimension2 = PixelTraits<TPixel2>::Dimension
staticconstexpr

◆ JoinDimension

template<typename TPixel1 , typename TPixel2 >
constexpr unsigned int itk::Functor::JoinFunctor< TPixel1, TPixel2 >::JoinDimension = Dimension1 + Dimension2
staticconstexpr

Definition at line 63 of file itkJoinImageFilter.h.


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