#include <itkSize.h>
Size is a class to represent multi-dimensional array bounds, templated over the dimension. Insight assumes that the first element of Size is the fastest moving index.
For the sake of 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_Size) allowing for fast and convienent instantiations/assignments.
The following syntax for assigning a size is allowed/suggested: Size<3> size = {256, 256, 20};
Definition at line 47 of file itkSize.h.
Public Types | |
typedef Size | Self |
typedef Size< VDimension > | SizeType |
typedef unsigned long | SizeValueType |
Public Member Functions | |
const SizeValueType | __getitem__ (unsigned int dim) const |
const unsigned int | __len__ () const |
void | __setitem__ (unsigned int dim, SizeValueType value) |
const char * | __str__ () const |
void | Fill (SizeValueType value) |
SizeValueType | GetElement (unsigned long element) const |
const SizeValueType * | GetSize () const |
SizeValueType | operator[] (unsigned int dim) const |
SizeValueType & | operator[] (unsigned int dim) |
void | SetElement (unsigned long element, SizeValueType val) |
void | SetSize (const SizeValueType val[VDimension]) |
const Self | operator * (const Self &vec) |
const Self & | operator *= (const Self &vec) |
bool | operator!= (const Self &vec) const |
const Self | operator+ (const Self &vec) |
const Self & | operator+= (const Self &vec) |
const Self | operator- (const Self &vec) |
const Self & | operator-= (const Self &vec) |
bool | operator== (const Self &vec) const |
Static Public Member Functions | |
static unsigned int | GetSizeDimension (void) |
Public Attributes | |
SizeValueType | m_Size [VDimension] |
typedef unsigned long itk::Size< VDimension >::SizeValueType |
const SizeValueType itk::Size< VDimension >::__getitem__ | ( | unsigned int | dim | ) | const [inline] |
const unsigned int itk::Size< VDimension >::__len__ | ( | ) | const [inline] |
void itk::Size< VDimension >::__setitem__ | ( | unsigned int | dim, | |
SizeValueType | value | |||
) | [inline] |
const char* itk::Size< VDimension >::__str__ | ( | ) | const [inline] |
void itk::Size< VDimension >::Fill | ( | SizeValueType | value | ) | [inline] |
Set one value for the index in all dimensions. Useful for initializing an offset to zero.
Definition at line 185 of file itkSize.h.
References itk::Size< VDimension >::m_Size.
Referenced by itk::ImageRegion< VImageDimension >::ImageRegion(), itk::PadImageFilter< TInputImage, TOutputImage >::SetPadBound(), itk::PadImageFilter< TInputImage, TOutputImage >::SetPadLowerBound(), and itk::PadImageFilter< TInputImage, TOutputImage >::SetPadUpperBound().
SizeValueType itk::Size< VDimension >::GetElement | ( | unsigned long | element | ) | const [inline] |
Get an element of the Size. gets the value of one of the elements in the size This method is mainly intended to facilitate the access to elements from Tcl and Python where C++ notation is not very convenient.
Definition at line 180 of file itkSize.h.
References itk::Size< VDimension >::m_Size.
Referenced by itk::Size< VDimension >::__getitem__().
const SizeValueType* itk::Size< VDimension >::GetSize | ( | void | ) | const [inline] |
Get the size. This provides a read only reference to the size.
Definition at line 157 of file itkSize.h.
References itk::Size< VDimension >::m_Size.
static unsigned int itk::Size< VDimension >::GetSizeDimension | ( | void | ) | [inline, static] |
const Self itk::Size< VDimension >::operator * | ( | const Self & | vec | ) | [inline] |
Multiply two sizes (elementwise product).
Definition at line 103 of file itkSize.h.
References itk::Size< VDimension >::m_Size.
const Self& itk::Size< VDimension >::operator *= | ( | const Self & | vec | ) | [inline] |
Multiply two sizes (elementwise product).
Definition at line 114 of file itkSize.h.
References itk::Size< VDimension >::m_Size.
bool itk::Size< VDimension >::operator!= | ( | const Self & | vec | ) | const [inline] |
Compare two sizes.
Definition at line 135 of file itkSize.h.
References itk::Size< VDimension >::m_Size.
const Self& itk::Size< VDimension >::operator+= | ( | const Self & | vec | ) | [inline] |
Increment size by a size.
Definition at line 72 of file itkSize.h.
References itk::Size< VDimension >::m_Size.
const Self itk::Size< VDimension >::operator- | ( | const Self & | vec | ) | [inline] |
Subtract two sizes.
Definition at line 82 of file itkSize.h.
References itk::Size< VDimension >::m_Size.
const Self& itk::Size< VDimension >::operator-= | ( | const Self & | vec | ) | [inline] |
Decrement size by a size.
Definition at line 93 of file itkSize.h.
References itk::Size< VDimension >::m_Size.
bool itk::Size< VDimension >::operator== | ( | const Self & | vec | ) | const [inline] |
Compare two sizes.
Definition at line 124 of file itkSize.h.
References itk::Size< VDimension >::m_Size.
SizeValueType itk::Size< VDimension >::operator[] | ( | unsigned int | dim | ) | const [inline] |
Access an element of the size. Elements are numbered 0, ..., VDimension-1. This version can only be an rvalue. No bounds checking is performed.
Definition at line 152 of file itkSize.h.
References itk::Size< VDimension >::m_Size.
SizeValueType& itk::Size< VDimension >::operator[] | ( | unsigned int | dim | ) | [inline] |
Access an element of the size. Elements are numbered 0, ..., VDimension-1. No bounds checking is performed.
Definition at line 146 of file itkSize.h.
References itk::Size< VDimension >::m_Size.
void itk::Size< VDimension >::SetElement | ( | unsigned long | element, | |
SizeValueType | val | |||
) | [inline] |
Set an element of the Size. sets the value of one of the elements in the Size This method is mainly intended to facilitate the access to elements from Tcl and Python where C++ notation is not very convenient.
Definition at line 171 of file itkSize.h.
References itk::Size< VDimension >::m_Size.
Referenced by itk::Size< VDimension >::__setitem__().
void itk::Size< VDimension >::SetSize | ( | const SizeValueType | val[VDimension] | ) | [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 162 of file itkSize.h.
References itk::Size< VDimension >::m_Size.
SizeValueType itk::Size< VDimension >::m_Size[VDimension] |
Size is an "aggregate" class. Its data is public (m_Size) allowing for fast and convenient instantiations/assignments.
The following syntax for assigning a size is allowed/suggested:
Size<3> size = {{256, 256, 20}};
The doubled braces {{ and }} are required to prevent `gcc -Wall' (and perhaps other compilers) from complaining about a partly bracketed initializer.
Definition at line 198 of file itkSize.h.
Referenced by itk::Size< VDimension >::Fill(), itk::Size< VDimension >::GetElement(), itk::Size< VDimension >::GetSize(), itk::Size< VDimension >::operator *(), itk::Index< VIndexDimension >::operator *(), itk::Size< VDimension >::operator *=(), itk::Size< VDimension >::operator!=(), itk::Size< VDimension >::operator+(), itk::Size< VDimension >::operator+=(), itk::Size< VDimension >::operator-(), itk::Size< VDimension >::operator-=(), itk::Size< VDimension >::operator==(), itk::Size< VDimension >::operator[](), itk::Size< VDimension >::SetElement(), itk::PadImageFilter< TInputImage, TOutputImage >::SetPadLowerBound(), itk::PadImageFilter< TInputImage, TOutputImage >::SetPadUpperBound(), itk::Neighborhood< OutputPixelType::ValueType, itkGetStaticConstMacro(ImageDimension)>::SetRadius(), and itk::Size< VDimension >::SetSize().