![]() |
ITK
5.4.0
Insight Toolkit
|
#include <itkSize.h>
Represent a n-dimensional size (bounds) of a n-dimensional image.
Size is a templated class to represent multi-dimensional array bounds, i.e. (I,J,K,...). Size is templated over the dimension of the bounds. ITK assumes the first element of a size (bounds) is the fastest moving index.
For efficiency, Size does not define a default constructor, a copy constructor, or an operator=. We rely on the compiler to provide efficient bitwise copies.
Size is an "aggregate" class. Its data is public (m_InternalArray) allowing for fast and convenient instantiations/assignments.
The following syntax for assigning an aggregate type like this is allowed/suggested:
Size<3> var{{ 256, 256, 20 }}; // Also prevent narrowing conversions Size<3> var = {{ 256, 256, 20 }};
The doubled braces {{ and }} are required to prevent ‘gcc -Wall’ (and perhaps other compilers) from complaining about a partly bracketed initializer.
As an aggregate type that is intended to provide highest performance characteristics, this class is not appropriate to inherit from, so setting this struct as final.
Public Types | |
using | const_iterator = const value_type * |
using | const_reference = const value_type & |
using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
using | difference_type = ptrdiff_t |
using | iterator = value_type * |
using | reference = value_type & |
using | reverse_iterator = std::reverse_iterator< iterator > |
using | Self = Size |
using | size_type = unsigned int |
using | SizeType = Size< VDimension > |
using | SizeValueType = itk::SizeValueType |
using | value_type = itk::SizeValueType |
Public Member Functions | |
void | assign (const value_type &newValue) |
reference | at (size_type pos) |
const_reference | at (size_type pos) const |
reference | back () |
const_reference | back () const |
constexpr iterator | begin () |
constexpr const_iterator | begin () const |
constexpr SizeValueType | CalculateProductOfElements () const |
constexpr const_iterator | cbegin () const |
constexpr const_iterator | cend () const |
SizeValueType * | data () |
const SizeValueType * | data () const |
constexpr bool | empty () const |
constexpr iterator | end () |
constexpr const_iterator | end () const |
void | Fill (SizeValueType value) |
reference | front () |
const_reference | front () const |
SizeValueType | GetElement (unsigned long element) const |
const SizeValueType * | GetSize () const |
constexpr size_type | max_size () const |
const Self | operator* (const Self &vec) const |
const Self | operator+ (const Self &vec) const |
const Self | operator- (const Self &vec) const |
constexpr reference | operator[] (size_type pos) |
constexpr const_reference | operator[] (size_type pos) const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
void | SetElement (unsigned long element, SizeValueType val) |
void | SetSize (const SizeValueType val[VDimension]) |
constexpr size_type | size () const |
void | swap (Size &other) |
const Self & | operator+= (const Self &vec) |
const Self & | operator-= (const Self &vec) |
const Self & | operator*= (const Self &vec) |
Static Public Member Functions | |
static constexpr Self | Filled (const SizeValueType value) |
static constexpr unsigned int | GetSizeDimension () |
Public Attributes | |
SizeValueType | m_InternalArray [VDimension] |
Static Public Attributes | |
static constexpr unsigned int | Dimension = VDimension |
Private Member Functions | |
void | ExceptionThrowingBoundsCheck (size_type pos) const |
using itk::Size< VDimension >::const_iterator = const value_type * |
using itk::Size< VDimension >::const_reference = const value_type & |
using itk::Size< VDimension >::const_reverse_iterator = std::reverse_iterator<const_iterator> |
using itk::Size< VDimension >::difference_type = ptrdiff_t |
using itk::Size< VDimension >::iterator = value_type * |
using itk::Size< VDimension >::reference = value_type & |
using itk::Size< VDimension >::size_type = unsigned int |
using itk::Size< VDimension >::SizeValueType = itk::SizeValueType |
using itk::Size< VDimension >::value_type = itk::SizeValueType |
|
inline |
|
inline |
|
inline |
|
inlineconstexpr |
Definition at line 288 of file itkSize.h.
Referenced by itk::RectangularImageNeighborhoodShape< VImageDimension >::FillOffsets(), itk::operator<(), and itk::operator==().
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inline |
|
inline |
|
inlineconstexpr |
|
inlineconstexpr |
Definition at line 306 of file itkSize.h.
Referenced by itk::RectangularImageNeighborhoodShape< VImageDimension >::FillOffsets(), itk::operator<(), and itk::operator==().
|
inlineconstexpr |
|
inline |
Set one value for the index in all dimensions. Useful for initializing an offset to zero.
Definition at line 213 of file itkSize.h.
Referenced by itk::BinaryCrossStructuringElement< TPixel, VDimension, TAllocator >::BinaryCrossStructuringElement(), itk::BoxAccumulateFunction(), itk::BoxSquareAccumulateFunction(), and itk::CornerOffsets().
|
inlinestaticconstexpr |
|
inline |
|
inline |
Gets the value of one of the elements. This method is mainly intended to facilitate the access to elements from Tcl and Python where C++ notation is not very convenient.
|
inline |
|
inlinestaticconstexpr |
|
inline |
Multiply two sizes (elementwise product).
Definition at line 145 of file itkSize.h.
References itk::Size< VDimension >::m_InternalArray.
|
inline |
Multiply two sizes (elementwise product).
Definition at line 158 of file itkSize.h.
References itk::Size< VDimension >::m_InternalArray.
|
inline |
Add two sizes.
Definition at line 96 of file itkSize.h.
References itk::Size< VDimension >::m_InternalArray.
|
inline |
Increment size by a size.
Definition at line 109 of file itkSize.h.
References itk::Size< VDimension >::m_InternalArray.
|
inline |
Subtract two sizes.
Definition at line 121 of file itkSize.h.
References itk::Size< VDimension >::m_InternalArray.
|
inline |
Decrement size by a size.
Definition at line 134 of file itkSize.h.
References itk::Size< VDimension >::m_InternalArray.
|
inlineconstexpr |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Sets the value of one of the elements. This method is mainly intended to facilitate the access to elements from Tcl and Python where C++ notation is not very convenient.
|
inline |
Set the size. Try to prototype this function so that val has to point to a block of memory that is the appropriate size.
Definition at line 181 of file itkSize.h.
Referenced by itk::ScanlineFilterCommon< TInputImage, TOutputImage >::SetupLineOffsets().
|
inline |
Definition at line 276 of file itkSize.h.
References itk::Size< VDimension >::m_InternalArray, and itk::swap().
|
staticconstexpr |
SizeValueType itk::Size< VDimension >::m_InternalArray[VDimension] |
Size is an "aggregate" class. Its data is public (m_InternalArray) allowing for fast and convenient instantiations/assignments. ( See main class documentation for an example of initialization)
Definition at line 246 of file itkSize.h.
Referenced by itk::RectangularImageNeighborhoodShape< VImageDimension >::CalculateNumberOfOffsets(), itk::ImageRegionSplitterBase::GetNumberOfSplits(), itk::ImageRegionSplitterBase::GetSplit(), itk::Size< VDimension >::operator*(), itk::Index< VDimension >::operator*(), itk::Size< VDimension >::operator*=(), itk::Size< VDimension >::operator+(), itk::Size< VDimension >::operator+=(), itk::Size< VDimension >::operator-(), itk::Size< VDimension >::operator-=(), itk::MultiThreaderBase::ParallelizeImageRegion(), itk::Neighborhood< TPixel, VDimension, TAllocator >::SetRadius(), itk::Size< VDimension >::swap(), and itk::swap().