ITK
6.0.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 |
constexpr reference | back () |
constexpr 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) |
constexpr reference | front () |
constexpr 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 >::reverse_iterator = std::reverse_iterator<iterator> |
using itk::Size< VDimension >::SizeValueType = itk::SizeValueType |
using itk::Size< VDimension >::value_type = itk::SizeValueType |
|
inline |
|
inline |
|
inlineconstexpr |
|
inlineconstexpr |
Definition at line 286 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 304 of file itkSize.h.
Referenced by itk::RectangularImageNeighborhoodShape< VImageDimension >::FillOffsets(), itk::operator<(), and itk::operator==().
|
inlineconstexpr |
|
inline |
|
inlinestaticconstexpr |
|
inlineconstexpr |
|
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 |
|
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 179 of file itkSize.h.
Referenced by itk::ScanlineFilterCommon< TInputImage, TOutputImage >::SetupLineOffsets().
|
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 243 of file itkSize.h.
Referenced by itk::RectangularImageNeighborhoodShape< VImageDimension >::CalculateNumberOfOffsets(), itk::Size< Self::OutputImageDimension >::operator*(), itk::Index< Self::Dimension >::operator*(), itk::Size< Self::OutputImageDimension >::operator*=(), itk::Size< Self::OutputImageDimension >::operator+(), itk::Size< Self::OutputImageDimension >::operator+=(), itk::Size< Self::OutputImageDimension >::operator-(), itk::Size< Self::OutputImageDimension >::operator-=(), itk::MultiThreaderBase::ParallelizeImageRegion(), itk::Neighborhood< char, TImage::ImageDimension >::SetRadius(), itk::Size< Self::OutputImageDimension >::swap(), and itk::swap().