18#ifndef itkImageIORegion_h
19#define itkImageIORegion_h
185 unsigned int m_ImageDimension{ 2 };
192extern ITKCommon_EXPORT std::ostream &
201template <
unsigned int VDimension>
228 const unsigned int imageDimension = VDimension;
230 const unsigned int minDimension = std::min(ioDimension, imageDimension);
235 for (
unsigned int i = 0; i < minDimension; ++i)
237 outIORegion.
SetSize(i, size[i]);
238 outIORegion.
SetIndex(i, index[i] - largestRegionIndex[i]);
244 for (
unsigned int k = minDimension; k < ioDimension; ++k)
274 const unsigned int imageDimension = VDimension;
276 const unsigned int minDimension = std::min(ioDimension, imageDimension);
278 for (
unsigned int i = 0; i < minDimension; ++i)
280 size[i] = inIORegion.
GetSize(i);
281 index[i] = inIORegion.
GetIndex(i) + largestRegionIndex[i];
Helper class for converting ImageRegions into ImageIORegions and back.
static void Convert(const ImageRegionType &inImageRegion, ImageIORegionType &outIORegion, const ImageIndexType &largestRegionIndex)
static void Convert(const ImageIORegionType &inIORegion, ImageRegionType &outImageRegion, const ImageIndexType &largestRegionIndex)
typename ImageRegionType::IndexType ImageIndexType
typename ImageRegionType::SizeType ImageSizeType
An ImageIORegion represents a structured region of data.
ImageIORegion(const Self &)=default
SizeValueType GetSize(unsigned long i) const
RegionType GetRegionType() const override
bool IsInside(const IndexType &index) const
unsigned int GetRegionDimension() const
~ImageIORegion() override
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Self)
void SetIndex(const IndexType &index)
void SetSize(const unsigned long i, SizeValueType size)
Self & operator=(const Self ®ion)
const IndexType & GetIndex() const
unsigned int GetImageDimension() const
ImageIORegion(unsigned int dimension)
IndexValueType GetIndex(unsigned long i) const
SizeValueType GetNumberOfPixels() const
void PrintSelf(std::ostream &os, Indent indent) const override
const SizeType & GetSize() const
Self & operator=(Self &&)=default
void SetSize(const SizeType &size)
bool IsInside(const Self ®ion) const
std::vector< SizeValueType > SizeType
IndexType & GetModifiableIndex()
ImageIORegion(Self &&)=default
itk::SizeValueType SizeValueType
itk::IndexValueType IndexValueType
void SetIndex(const unsigned long i, IndexValueType idx)
bool operator==(const Self ®ion) const
itk::OffsetValueType OffsetValueType
SizeType & GetModifiableSize()
std::vector< IndexValueType > IndexType
void SetSize(const SizeType &size)
const IndexType & GetIndex() const
void SetIndex(const IndexType &index)
const SizeType & GetSize() const
Index< VImageDimension > IndexType
Size< VImageDimension > SizeType
Control indentation during Print() invocation.
A region represents some portion or piece of data.
ImageBaseType::IndexType IndexType
ImageBaseType::SizeType SizeType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
unsigned long SizeValueType