 |
ITK
5.4.0
Insight Toolkit
|
Go to the documentation of this file.
28 #ifndef itkImageRegion_h
29 #define itkImageRegion_h
41 template <
unsigned int VImageDimension>
68 template <
unsigned int VImageDimension>
80 static constexpr
unsigned int ImageDimension = VImageDimension;
84 static constexpr
unsigned int SliceDimension = ImageDimension - (ImageDimension > 1);
90 return ImageDimension;
112 return Superclass::RegionEnum::ITK_STRUCTURED_REGION;
149 operator=(
const Self &) noexcept =
default;
222 GetUpperIndex()
const;
230 ComputeOffsetTable(OffsetTableType offsetTable)
const;
236 return (m_Index == region.m_Index) && (m_Size == region.m_Size);
239 ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(
Self);
245 for (
unsigned int i = 0; i < ImageDimension; ++i)
247 if (index[i] < m_Index[i] || index[i] >= m_Index[i] + static_cast<IndexValueType>(m_Size[i]))
260 template <
typename TCoordRepType>
264 constexpr TCoordRepType half = 0.5;
265 for (
unsigned int i = 0; i < ImageDimension; ++i)
268 if (!(index[i] >= m_Index[i] - half && index[i] <= (m_Index[i] + static_cast<IndexValueType>(m_Size[i])) - half))
284 const auto otherIndex = otherRegion.m_Index;
285 const auto otherSize = otherRegion.m_Size;
288 for (
unsigned int i = 0; i < ImageDimension; ++i)
290 if (otherIndex[i] < m_Index[i] || otherSize[i] == 0 ||
291 otherIndex[i] + static_cast<IndexValueType>(otherSize[i]) >
292 m_Index[i] + static_cast<IndexValueType>(m_Size[i]))
303 GetNumberOfPixels()
const;
312 PadByRadius(
const IndexValueArrayType radius);
315 PadByRadius(
const SizeType & radius);
325 ShrinkByRadius(
const IndexValueArrayType radius);
328 ShrinkByRadius(
const SizeType & radius);
335 Crop(
const Self & region);
341 Slice(
const unsigned int dim)
const;
349 PrintSelf(std::ostream & os,
Indent indent)
const override;
359 template <
unsigned int VImageDimension>
364 #ifndef ITK_MANUAL_INSTANTIATION
365 # include "itkImageRegion.hxx"
IndexType & GetModifiableIndex()
typename IndexType::OffsetType OffsetType
typename IndexType::IndexValueType IndexValueType
OffsetValueType[ImageDimension+1] OffsetTableType
bool IsInside(const Self &otherRegion) const
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
IndexValueType[ImageDimension] IndexValueArrayType
Base class for templated image classes.
void SetSize(unsigned int i, SizeValueType sze)
const IndexType & GetIndex() const
An image region represents a structured region of data.
ImageBaseType::SizeType SizeType
const SizeType & GetSize() const
class ITK_TEMPLATE_EXPORT ImageBase
Control indentation during Print() invocation.
void SetIndex(unsigned int i, IndexValueType sze)
ImageBaseType::IndexType IndexType
bool operator==(const Self ®ion) const noexcept
SizeValueType GetSize(unsigned int i) const
bool IsInside(const IndexType &index) const
bool IsInside(const ContinuousIndex< TCoordRepType, VImageDimension > &index) const
A region represents some portion or piece of data.
static unsigned int GetImageDimension()
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
A templated class holding a point in n-Dimensional image space.
Superclass::RegionEnum GetRegionType() const override
void SetIndex(const IndexType &index)
IndexValueType GetIndex(unsigned int i) const
typename OffsetType::OffsetValueType OffsetValueType
typename SizeType::SizeValueType SizeValueType
void SetSize(const SizeType &size)
SizeType & GetModifiableSize()
unsigned long SizeValueType
ImageRegion(const SizeType &size) noexcept