ITK
5.0.0
Insight Segmentation and Registration 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 teh 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 = std::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 |
Static Public Member Functions | |
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 = std::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 |
|
inline |
Definition at line 254 of file itkSize.h.
Referenced by itk::Experimental::RectangularImageNeighborhoodShape< VImageDimension >::FillOffsets(), itk::operator==(), itk::Size< Self::ImageDimension >::swap(), and itk::swap().
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 264 of file itkSize.h.
Referenced by itk::Experimental::RectangularImageNeighborhoodShape< VImageDimension >::FillOffsets(), itk::operator==(), and itk::swap().
|
inline |
|
inline |
Set one value for the index in all dimensions. Useful for initializing an offset to zero.
Definition at line 201 of file itkSize.h.
Referenced by itk::BinaryCrossStructuringElement< TPixel, VDimension, TAllocator >::BinaryCrossStructuringElement(), itk::BoxAccumulateFunction(), itk::BoxSquareAccumulateFunction(), and itk::CornerOffsets().
|
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 |
Get the size. This provides a read only pointer to the size.
|
inlinestatic |
|
inline |
|
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 170 of file itkSize.h.
Referenced by itk::ScanlineFilterCommon< TInputImage, TOutputImage >::SetupLineOffsets().
|
static |
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 220 of file itkSize.h.
Referenced by itk::Experimental::RectangularImageNeighborhoodShape< VImageDimension >::CalculateNumberOfOffsets(), itk::Size< Self::ImageDimension >::operator*(), itk::Index< Self::ImageDimension >::operator*(), itk::Size< Self::ImageDimension >::operator*=(), itk::Size< Self::ImageDimension >::operator+(), itk::Size< Self::ImageDimension >::operator+=(), itk::Size< Self::ImageDimension >::operator-(), itk::Size< Self::ImageDimension >::operator-=(), itk::MultiThreaderBase::ParallelizeImageRegion(), and itk::Neighborhood< char, TImage::ImageDimension >::SetRadius().