ITK  6.0.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Attributes | Private Attributes | List of all members
itk::ConstantBoundaryCondition< TInputImage, TOutputImage > Class Template Reference

#include <itkConstantBoundaryCondition.h>

Detailed Description

template<typename TInputImage, typename TOutputImage = TInputImage>
class itk::ConstantBoundaryCondition< TInputImage, TOutputImage >

This boundary condition returns a constant value for out-of-bounds image pixels.

For example, invoking this function object with a constant value of zero (the default) on each out-of-bounds element of a 7x5 iterator that masks a region at an image corner (iterator is centered on the 2):

          * * * * * * *
          * * * * * * *
          * * 1 2 3 4 5  (where * denotes pixels that lie
          * * 3 3 5 5 6          outside of the image boundary)
          * * 4 4 6 7 8

would produce the following neighborhood of values:

          0 0 0 0 0 0 0
          0 0 0 0 0 0 0
          0 0 1 2 3 4 5
          0 0 3 3 5 5 6
          0 0 4 4 6 7 8
Note
If you are using an image with Array as the pixel type, you will need to set the constant explicitly with an array of the appropriate length. This is also true if your image type is a VectorImage.
See also
ImageBoundaryCondition
ITK Sphinx Examples:
Examples
SphinxExamples/src/Core/Common/MakeOutOfBoundsPixelsReturnConstValue/Code.cxx.

Definition at line 68 of file itkConstantBoundaryCondition.h.

+ Inheritance diagram for itk::ConstantBoundaryCondition< TInputImage, TOutputImage >:
+ Collaboration diagram for itk::ConstantBoundaryCondition< TInputImage, TOutputImage >:

Public Types

using IndexType = Index< ImageDimension >
 
using NeighborhoodAccessorFunctorType = typename TInputImage::NeighborhoodAccessorFunctorType
 
using NeighborhoodType = Neighborhood< PixelPointerType, ImageDimension >
 
using OffsetType = Offset< ImageDimension >
 
using OutputPixelType = typename TOutputImage::PixelType
 
using PixelPointerType = typename TInputImage::InternalPixelType *
 
using PixelType = typename TInputImage::PixelType
 
using RegionType = ImageRegion< ImageDimension >
 
using Self = ConstantBoundaryCondition
 
using SizeType = Size< ImageDimension >
 
using Superclass = ImageBoundaryCondition< TInputImage, TOutputImage >
 
- Public Types inherited from itk::ImageBoundaryCondition< TInputImage, TOutputImage >
using IndexType = Index< ImageDimension >
 
using InputImageType = TInputImage
 
using NeighborhoodAccessorFunctorType = typename TInputImage::NeighborhoodAccessorFunctorType
 
using NeighborhoodType = Neighborhood< PixelPointerType, ImageDimension >
 
using OffsetType = Offset< ImageDimension >
 
using OutputImageType = TOutputImage
 
using OutputPixelType = typename TOutputImage::PixelType
 
using PixelPointerType = typename TInputImage::InternalPixelType *
 
using PixelType = typename TInputImage::PixelType
 
using RegionType = ImageRegion< ImageDimension >
 
using Self = ImageBoundaryCondition
 
using SizeType = Size< ImageDimension >
 

Public Member Functions

 ConstantBoundaryCondition ()=default
 
const OutputPixelTypeGetConstant () const
 
RegionType GetInputRequestedRegion (const RegionType &inputLargestPossibleRegion, const RegionType &outputRequestedRegion) const override
 
const char * GetNameOfClass () const override
 
OutputPixelType GetPixel (const IndexType &index, const TInputImage *image) const override
 
template<typename TPixel >
void Initialize (const VariableLengthVector< TPixel > *)
 
OutputPixelType operator() (const OffsetType &, const OffsetType &, const NeighborhoodType *) const override
 
OutputPixelType operator() (const OffsetType &, const OffsetType &, const NeighborhoodType *, const NeighborhoodAccessorFunctorType &) const override
 
void Print (std::ostream &os, Indent i=0) const override
 
bool RequiresCompleteNeighborhood () override
 
void SetConstant (const OutputPixelType &c)
 
- Public Member Functions inherited from itk::ImageBoundaryCondition< TInputImage, TOutputImage >
virtual RegionType GetInputRequestedRegion (const RegionType &inputLargestPossibleRegion, [[maybe_unused]] const RegionType &) const
 
 ImageBoundaryCondition ()=default
 
virtual ~ImageBoundaryCondition ()=default
 

Static Public Attributes

static constexpr unsigned int ImageDimension = Superclass::ImageDimension
 
- Static Public Attributes inherited from itk::ImageBoundaryCondition< TInputImage, TOutputImage >
static constexpr unsigned int ImageDimension = TInputImage::ImageDimension
 

Private Attributes

OutputPixelType m_Constant {}
 

Member Typedef Documentation

◆ IndexType

template<typename TInputImage, typename TOutputImage = TInputImage>
using itk::ImageBoundaryCondition< TInputImage, TOutputImage >::IndexType = Index<ImageDimension>

Definition at line 68 of file itkImageBoundaryCondition.h.

◆ NeighborhoodAccessorFunctorType

template<typename TInputImage, typename TOutputImage = TInputImage>
using itk::ImageBoundaryCondition< TInputImage, TOutputImage >::NeighborhoodAccessorFunctorType = typename TInputImage::NeighborhoodAccessorFunctorType

Functor used to access pixels from a neighborhood of pixel pointers

Definition at line 77 of file itkImageBoundaryCondition.h.

◆ NeighborhoodType

template<typename TInputImage, typename TOutputImage = TInputImage>
using itk::ImageBoundaryCondition< TInputImage, TOutputImage >::NeighborhoodType = Neighborhood<PixelPointerType, ImageDimension>

Type of the data container passed to this function object.

Definition at line 74 of file itkImageBoundaryCondition.h.

◆ OffsetType

template<typename TInputImage, typename TOutputImage = TInputImage>
using itk::ImageBoundaryCondition< TInputImage, TOutputImage >::OffsetType = Offset<ImageDimension>

Definition at line 70 of file itkImageBoundaryCondition.h.

◆ OutputPixelType

template<typename TInputImage, typename TOutputImage = TInputImage>
using itk::ImageBoundaryCondition< TInputImage, TOutputImage >::OutputPixelType = typename TOutputImage::PixelType

Definition at line 67 of file itkImageBoundaryCondition.h.

◆ PixelPointerType

template<typename TInputImage, typename TOutputImage = TInputImage>
using itk::ImageBoundaryCondition< TInputImage, TOutputImage >::PixelPointerType = typename TInputImage::InternalPixelType *

Definition at line 66 of file itkImageBoundaryCondition.h.

◆ PixelType

template<typename TInputImage, typename TOutputImage = TInputImage>
using itk::ImageBoundaryCondition< TInputImage, TOutputImage >::PixelType = typename TInputImage::PixelType

Definition at line 65 of file itkImageBoundaryCondition.h.

◆ RegionType

template<typename TInputImage, typename TOutputImage = TInputImage>
using itk::ImageBoundaryCondition< TInputImage, TOutputImage >::RegionType = ImageRegion<ImageDimension>

Definition at line 71 of file itkImageBoundaryCondition.h.

◆ Self

template<typename TInputImage, typename TOutputImage = TInputImage>
using itk::ConstantBoundaryCondition< TInputImage, TOutputImage >::Self = ConstantBoundaryCondition

Self & superclass type alias

Definition at line 72 of file itkConstantBoundaryCondition.h.

◆ SizeType

template<typename TInputImage, typename TOutputImage = TInputImage>
using itk::ImageBoundaryCondition< TInputImage, TOutputImage >::SizeType = Size<ImageDimension>

Definition at line 69 of file itkImageBoundaryCondition.h.

◆ Superclass

template<typename TInputImage, typename TOutputImage = TInputImage>
using itk::ConstantBoundaryCondition< TInputImage, TOutputImage >::Superclass = ImageBoundaryCondition<TInputImage, TOutputImage>

Definition at line 73 of file itkConstantBoundaryCondition.h.

Constructor & Destructor Documentation

◆ ConstantBoundaryCondition()

template<typename TInputImage, typename TOutputImage = TInputImage>
itk::ConstantBoundaryCondition< TInputImage, TOutputImage >::ConstantBoundaryCondition ( )
default

Default constructor.

Member Function Documentation

◆ GetConstant()

template<typename TInputImage, typename TOutputImage = TInputImage>
const OutputPixelType& itk::ConstantBoundaryCondition< TInputImage, TOutputImage >::GetConstant ( ) const

Get the value of the constant.

◆ GetInputRequestedRegion()

template<typename TInputImage, typename TOutputImage = TInputImage>
RegionType itk::ConstantBoundaryCondition< TInputImage, TOutputImage >::GetInputRequestedRegion ( const RegionType inputLargestPossibleRegion,
const RegionType outputRequestedRegion 
) const
override

Determines the necessary input region for the output region. For this boundary condition, only the intersection of the largest possible image region and the output requested region is needed.

Parameters
inputLargestPossibleRegionLargest possible region of the input image.
outputRequestedRegionThe output requested region.
Returns
The necessary input region required to determine the pixel values in the outputRequestedRegion.

◆ GetNameOfClass()

template<typename TInputImage, typename TOutputImage = TInputImage>
const char* itk::ConstantBoundaryCondition< TInputImage, TOutputImage >::GetNameOfClass ( ) const
overridevirtual

◆ GetPixel()

template<typename TInputImage, typename TOutputImage = TInputImage>
OutputPixelType itk::ConstantBoundaryCondition< TInputImage, TOutputImage >::GetPixel ( const IndexType index,
const TInputImage *  image 
) const
overridevirtual

Returns a value for a given pixel at an index. If the index is inside the bounds of the input image, then the pixel value is obtained from the input image. Otherwise, the constant value is returned.

Parameters
indexThe index of the desired pixel.
imageThe image from which pixel values should be determined.

Implements itk::ImageBoundaryCondition< TInputImage, TOutputImage >.

◆ Initialize()

template<typename TInputImage, typename TOutputImage = TInputImage>
template<typename TPixel >
void itk::ConstantBoundaryCondition< TInputImage, TOutputImage >::Initialize ( const VariableLengthVector< TPixel > *  )

Special version of initialize for images with pixel type VariableLengthVector.

◆ operator()() [1/2]

template<typename TInputImage, typename TOutputImage = TInputImage>
OutputPixelType itk::ConstantBoundaryCondition< TInputImage, TOutputImage >::operator() ( const OffsetType ,
const OffsetType ,
const NeighborhoodType  
) const
overridevirtual

Computes and returns appropriate out-of-bounds values from neighborhood iterator data.

Implements itk::ImageBoundaryCondition< TInputImage, TOutputImage >.

◆ operator()() [2/2]

template<typename TInputImage, typename TOutputImage = TInputImage>
OutputPixelType itk::ConstantBoundaryCondition< TInputImage, TOutputImage >::operator() ( const OffsetType ,
const OffsetType ,
const NeighborhoodType ,
const NeighborhoodAccessorFunctorType  
) const
overridevirtual

Computes and returns the appropriate pixel value from neighborhood iterator data, using the functor.

Implements itk::ImageBoundaryCondition< TInputImage, TOutputImage >.

◆ Print()

template<typename TInputImage, typename TOutputImage = TInputImage>
void itk::ConstantBoundaryCondition< TInputImage, TOutputImage >::Print ( std::ostream &  os,
Indent  i = 0 
) const
overridevirtual

Utility for printing the boundary condition.

Reimplemented from itk::ImageBoundaryCondition< TInputImage, TOutputImage >.

◆ RequiresCompleteNeighborhood()

template<typename TInputImage, typename TOutputImage = TInputImage>
bool itk::ConstantBoundaryCondition< TInputImage, TOutputImage >::RequiresCompleteNeighborhood ( )
inlineoverridevirtual

Tell if the boundary condition can index to any location within the associated iterator's neighborhood or if it has some limited subset (such as none) that it relies upon.

Reimplemented from itk::ImageBoundaryCondition< TInputImage, TOutputImage >.

Definition at line 131 of file itkConstantBoundaryCondition.h.

◆ SetConstant()

template<typename TInputImage, typename TOutputImage = TInputImage>
void itk::ConstantBoundaryCondition< TInputImage, TOutputImage >::SetConstant ( const OutputPixelType c)

Set the value of the constant.

Referenced by itk::BoxAccumulateFunction(), and itk::BoxSquareAccumulateFunction().

Member Data Documentation

◆ ImageDimension

template<typename TInputImage, typename TOutputImage = TInputImage>
constexpr unsigned int itk::ConstantBoundaryCondition< TInputImage, TOutputImage >::ImageDimension = Superclass::ImageDimension
staticconstexpr

Save the image dimension.

Definition at line 91 of file itkConstantBoundaryCondition.h.

◆ m_Constant

template<typename TInputImage, typename TOutputImage = TInputImage>
OutputPixelType itk::ConstantBoundaryCondition< TInputImage, TOutputImage >::m_Constant {}
private

Definition at line 160 of file itkConstantBoundaryCondition.h.


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