18 #ifndef itkImageIORegion_h
19 #define itkImageIORegion_h
78 unsigned int GetImageDimension()
const;
83 unsigned int GetRegionDimension()
const;
86 virtual RegionType GetRegionType() const ITK_OVERRIDE;
106 void operator=(const
Self & region);
118 void SetSize(const
SizeType & size);
137 bool operator==(const
Self & region) const;
140 bool operator!=(const
Self & region) const;
143 bool IsInside(const
IndexType & index) const;
146 bool IsInside(const
Self & region) const;
157 virtual
void PrintSelf(std::ostream & os,
Indent indent) const ITK_OVERRIDE;
160 unsigned int m_ImageDimension;
167 extern ITKCommon_EXPORT std::ostream & operator<<(std::ostream & os, const
ImageIORegion & region);
175 template<
unsigned int VDimension >
185 static void Convert(
const ImageRegionType & inImageRegion,
186 ImageIORegionType & outIORegion,
187 const ImageIndexType & largestRegionIndex)
201 const unsigned int imageDimension = VDimension;
203 const unsigned int minDimension = std::min( ioDimension, imageDimension );
205 const ImageSizeType & size = inImageRegion.
GetSize();
206 const ImageIndexType & index = inImageRegion.
GetIndex();
208 for(
unsigned int i = 0; i < minDimension; ++i )
210 outIORegion.
SetSize(i, size[i]);
211 outIORegion.
SetIndex(i, index[i] - largestRegionIndex[i]);
217 for(
unsigned int k = minDimension; k < ioDimension; ++k )
224 static void Convert(
const ImageIORegionType & inIORegion,
225 ImageRegionType & outImageRegion,
226 const ImageIndexType & largestRegionIndex)
229 ImageIndexType index;
246 const unsigned int imageDimension = VDimension;
248 const unsigned int minDimension = std::min( ioDimension, imageDimension );
250 for(
unsigned int i = 0; i < minDimension; ++i )
252 size[i] = inIORegion.
GetSize(i);
253 index[i] = inIORegion.
GetIndex(i) + largestRegionIndex[i];
void SetSize(const SizeType &size)
static void Convert(const ImageIORegionType &inIORegion, ImageRegionType &outImageRegion, const ImageIndexType &largestRegionIndex)
::itk::IndexValueType IndexValueType
const IndexType & GetIndex() const
::itk::SizeValueType SizeValueType
An ImageIORegion represents a structured region of data.
const IndexType & GetIndex() const
signed long OffsetValueType
signed long IndexValueType
unsigned long SizeValueType
static void Convert(const ImageRegionType &inImageRegion, ImageIORegionType &outIORegion, const ImageIndexType &largestRegionIndex)
Helper class for converting ImageRegions into ImageIORegions and back.
ImageRegion< VDimension > ImageRegionType
unsigned int GetImageDimension() const
void SetIndex(const IndexType &index)
void Fill(IndexValueType value)
const SizeType & GetSize() const
ImageRegionType::IndexType ImageIndexType
Superclass::RegionType RegionType
A region represents some portion or piece of data.
ImageIORegion ImageIORegionType
void SetSize(const SizeType &size)
const SizeType & GetSize() const
::itk::OffsetValueType OffsetValueType
Control indentation during Print() invocation.
std::vector< SizeValueType > SizeType
std::vector< IndexValueType > IndexType
ImageRegionType::SizeType ImageSizeType
void SetIndex(const IndexType &index)
void Fill(SizeValueType value)