28#ifndef itkImageRegion_h
29#define itkImageRegion_h
42#ifdef ITK_LEGACY_REMOVE
43# define itkRegionOverrideMacro
45# define itkRegionOverrideMacro override
52template <
unsigned int VImageDimension>
79template <
unsigned int VImageDimension>
81#ifndef ITK_LEGACY_REMOVE
90#ifndef ITK_LEGACY_REMOVE
109 static constexpr unsigned int
134 return Region::RegionEnum::ITK_STRUCTURED_REGION;
264 return (
m_Index == region.m_Index) && (
m_Size == region.m_Size);
288 template <
typename TCoordinate>
292 constexpr TCoordinate half = 0.5;
312 const auto & otherIndex = otherRegion.
m_Index;
313 const auto & otherSize = otherRegion.
m_Size;
318 if (otherIndex[i] <
m_Index[i] || otherSize[i] == 0 ||
369 Slice(
const unsigned int dim)
const;
373 template <
size_t VTupleIndex>
377 if constexpr (VTupleIndex == 0)
383 static_assert(VTupleIndex == 1);
390 template <
size_t VTupleIndex>
391 [[nodiscard]]
const auto &
394 if constexpr (VTupleIndex == 0)
400 static_assert(VTupleIndex == 1);
424template <
unsigned int VImageDimension>
428template <
unsigned int VImageDimension>
436#if defined(__clang__) && defined(__apple_build_version__) && (__clang_major__ <= 10)
437# pragma clang diagnostic push
440# pragma clang diagnostic ignored "-Wmismatched-tags"
454template <
unsigned int VImageDimension>
455struct tuple_size<
itk::ImageRegion<VImageDimension>> : integral_constant<size_t, 2>
459template <
size_t VTupleIndex,
unsigned int VImageDimension>
460struct tuple_element<VTupleIndex,
itk::ImageRegion<VImageDimension>>
461 : conditional<VTupleIndex == 0, itk::Index<VImageDimension>, itk::Size<VImageDimension>>
463 static_assert(VTupleIndex < tuple_size_v<itk::ImageRegion<VImageDimension>>);
468#if defined(__clang__) && defined(__apple_build_version__) && (__clang_major__ <= 10)
469# pragma clang diagnostic pop
473#undef itkRegionOverrideMacro
475#ifndef ITK_MANUAL_INSTANTIATION
476# include "itkImageRegion.hxx"
A templated class holding a point in n-Dimensional image space.
Base class for templated image classes.
An image region represents a structured region of data.
typename IndexType::OffsetType OffsetType
IndexValueType GetIndex(unsigned int i) const
bool ShrinkByRadius(const SizeType &radius)
static constexpr unsigned int ImageDimension
static constexpr unsigned int SliceDimension
bool operator==(const Self ®ion) const noexcept
bool ShrinkByRadius(OffsetValueType radius)
void SetIndex(unsigned int i, IndexValueType sze)
SizeValueType GetSize(unsigned int i) const
ImageRegion< Self::SliceDimension > SliceRegion
SizeValueType GetNumberOfPixels() const
void ComputeOffsetTable(OffsetTableType offsetTable) const
Self & operator=(const Self &) noexcept=default
typename IndexType::IndexValueType IndexValueType
const char * GetNameOfClass() const itkRegionOverrideMacro
SliceRegion Slice(const unsigned int dim) const
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Self)
ImageRegion() noexcept=default
void SetUpperIndex(const IndexType &idx)
bool IsInside(const ContinuousIndex< TCoordinate, VImageDimension > &index) const
void PrintSelf(std::ostream &os, Indent indent) const itkRegionOverrideMacro
void SetSize(const SizeType &size)
Region::RegionEnum GetRegionType() const itkRegionOverrideMacro
const IndexType & GetIndex() const
void SetIndex(const IndexType &index)
OffsetValueType[ImageDimension+1] OffsetTableType
IndexType & GetModifiableIndex()
void SetSize(unsigned int i, SizeValueType sze)
bool ShrinkByRadius(const IndexValueArrayType radius)
void Print(std::ostream &os, Indent indent=0) const itkRegionOverrideMacro
IndexValueType[ImageDimension] IndexValueArrayType
void PadByRadius(OffsetValueType radius)
SizeType & GetModifiableSize()
typename OffsetType::OffsetValueType OffsetValueType
const SizeType & GetSize() const
static constexpr unsigned int GetImageDimension()
void PadByRadius(const IndexValueArrayType radius)
Index< VImageDimension > IndexType
IndexType GetUpperIndex() const
typename SizeType::SizeValueType SizeValueType
void PadByRadius(const SizeType &radius)
bool Crop(const Self ®ion)
bool IsInside(const Self &otherRegion) const
Size< VImageDimension > SizeType
bool IsInside(const IndexType &index) const
ImageRegion(const SizeType &size) noexcept
Control indentation during Print() invocation.
A region represents some portion or piece of data.
ObjectEnums::RegionEnum RegionEnum
BinaryGeneratorImageFilter< TInputImage1, TInputImage2, TOutputImage > Superclass
#define itkRegionOverrideMacro
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
ImageRegion(const Index< VImageDimension > &, const Size< VImageDimension > &) -> ImageRegion< VImageDimension >
class ITK_TEMPLATE_EXPORT ImageBase
Represent a n-dimensional index in a n-dimensional image.
itk::IndexValueType IndexValueType
Offset< VDimension > OffsetType
Represent a n-dimensional size (bounds) of a n-dimensional image.
itk::SizeValueType SizeValueType