28 #ifndef itkImageRegion_h
29 #define itkImageRegion_h
35 #include "vnl/vnl_math.h"
41 template<
unsigned int VImageDimension >
68 template<
unsigned int VImageDimension >
186 bool same = (
m_Index == region.m_Index );
187 same = same && (
m_Size == region.m_Size );
196 bool same = (
m_Index == region.m_Index );
197 same = same && (
m_Size == region.m_Size );
212 if ( index[i] >= (
m_Index[i] + static_cast< IndexValueType >(
m_Size[i] ) ) )
225 template<
typename TCoordRepType >
231 if ( Math::RoundHalfIntegerUp< IndexValueType >(index[i]) < static_cast< IndexValueType >(
m_Index[i] ) )
236 const TCoordRepType bound =
static_cast< TCoordRepType
>(
246 if ( ! (index[i] <= bound) )
261 IndexType beginCorner = region.GetIndex();
268 const SizeType & size = region.GetSize();
271 endCorner[i] = beginCorner[i] +
static_cast< OffsetValueType >( size[i] ) - 1;
319 virtual void PrintSelf(std::ostream & os,
Indent indent)
const ITK_OVERRIDE;
329 template<
unsigned int VImageDimension >
330 std::ostream & operator<<(std::ostream & os, const ImageRegion< VImageDimension > & region);
333 #ifndef ITK_MANUAL_INSTANTIATION
334 #include "itkImageRegion.hxx"
void SetSize(const SizeType &size)
void SetUpperIndex(const IndexType &idx)
void ComputeOffsetTable(OffsetTableType offsetTable) const
IndexValueType GetIndex(unsigned int i) const
const IndexType & GetIndex() const
Represent the offset between two n-dimensional indexes in a n-dimensional image.
Size< itkGetStaticConstMacro(ImageDimension) > SizeType
itk::SizeValueType SizeValueType
bool ShrinkByRadius(OffsetValueType radius)
signed long OffsetValueType
bool IsInside(const IndexType &index) const
Index< itkGetStaticConstMacro(ImageDimension) > IndexType
void PadByRadius(OffsetValueType radius)
An image region represents a structured region of data.
bool operator==(const Self ®ion) const
static unsigned int GetImageDimension()
OffsetType::OffsetValueType OffsetValueType
static const unsigned int ImageDimension
virtual void PrintSelf(std::ostream &os, Indent indent) const override
unsigned long SizeValueType
SizeValueType GetSize(unsigned int i) const
virtual Superclass::RegionType GetRegionType() const override
IndexValueType IndexValueArrayType[ImageDimension]
ImageRegion< itkGetStaticConstMacro(SliceDimension) > SliceRegion
bool Crop(const Self ®ion)
ImageRegion(const SizeType &size)
::itk::IndexValueType IndexValueType
IndexType & GetModifiableIndex()
SizeType & GetModifiableSize()
void Fill(IndexValueType value)
IndexType::IndexValueType IndexValueType
void SetSize(unsigned int i, SizeValueType sze)
const SizeType & GetSize() const
A region represents some portion or piece of data.
SizeType::SizeValueType SizeValueType
IndexType::OffsetType OffsetType
void operator=(const Self ®ion)
bool operator!=(const Self ®ion) const
bool IsInside(const Self ®ion) const
Base class for templated image classes.
ImageRegion(const Self ®ion)
A templated class holding a point in n-Dimensional image space.
SliceRegion Slice(const unsigned int dim) const
Control indentation during Print() invocation.
IndexType GetUpperIndex() const
static const unsigned int SliceDimension
void SetIndex(unsigned int i, IndexValueType sze)
OffsetValueType OffsetTableType[ImageDimension+1]
SizeValueType GetNumberOfPixels() const
itk::OffsetValueType OffsetValueType
void SetIndex(const IndexType &index)
ImageRegion(const IndexType &index, const SizeType &size)
bool IsInside(const ContinuousIndex< TCoordRepType, VImageDimension > &index) const