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)
256 auto size = MakeFilled<ImageSizeType>(1);
271 const unsigned int imageDimension = VDimension;
273 const unsigned int minDimension = std::min(ioDimension, imageDimension);
275 for (
unsigned int i = 0; i < minDimension; ++i)
277 size[i] = inIORegion.
GetSize(i);
278 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
IndexValueType GetIndex(unsigned int i) const
RegionType GetRegionType() const override
bool IsInside(const IndexType &index) const
unsigned int GetRegionDimension() const
bool IsInside(const Self &otherRegion) const
~ImageIORegion() override
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Self)
void SetIndex(const IndexType &index)
Self & operator=(const Self ®ion)
const IndexType & GetIndex() const
unsigned int GetImageDimension() const
SizeValueType GetSize(unsigned int i) const
ImageIORegion(unsigned int dimension)
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)
void SetIndex(const unsigned int i, IndexValueType idx)
std::vector< SizeValueType > SizeType
IndexType & GetModifiableIndex()
ImageIORegion(Self &&)=default
itk::SizeValueType SizeValueType
itk::IndexValueType IndexValueType
bool operator==(const Self ®ion) const
itk::OffsetValueType OffsetValueType
SizeType & GetModifiableSize()
void SetSize(const unsigned int i, SizeValueType size)
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