ITK  5.3.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | List of all members
itk::Size< VDimension > Struct Template Referencefinal

#include <itkSize.h>

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 const_iterator cbegin () const
 
constexpr const_iterator cend () const
 
SizeValueTypedata ()
 
const SizeValueTypedata () 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 SizeValueTypeGetSize () 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 Selfoperator+= (const Self &vec)
 
const Selfoperator-= (const Self &vec)
 
const Selfoperator*= (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
 

Detailed Description

template<unsigned int VDimension = 2>
struct itk::Size< VDimension >

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.

See also
Index
ITK Sphinx Examples:
Examples
SphinxExamples/src/Core/Common/CreateABackwardDifferenceOperator/Code.cxx, and SphinxExamples/src/Core/Common/CreateASize/Code.cxx.

Definition at line 71 of file itkSize.h.

Member Typedef Documentation

◆ const_iterator

template<unsigned int VDimension = 2>
using itk::Size< VDimension >::const_iterator = const value_type *

Definition at line 246 of file itkSize.h.

◆ const_reference

template<unsigned int VDimension = 2>
using itk::Size< VDimension >::const_reference = const value_type &

Definition at line 244 of file itkSize.h.

◆ const_reverse_iterator

template<unsigned int VDimension = 2>
using itk::Size< VDimension >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Definition at line 250 of file itkSize.h.

◆ difference_type

template<unsigned int VDimension = 2>
using itk::Size< VDimension >::difference_type = ptrdiff_t

Definition at line 248 of file itkSize.h.

◆ iterator

template<unsigned int VDimension = 2>
using itk::Size< VDimension >::iterator = value_type *

Definition at line 245 of file itkSize.h.

◆ reference

template<unsigned int VDimension = 2>
using itk::Size< VDimension >::reference = value_type &

Definition at line 243 of file itkSize.h.

◆ reverse_iterator

template<unsigned int VDimension = 2>
using itk::Size< VDimension >::reverse_iterator = std::reverse_iterator<iterator>

Definition at line 249 of file itkSize.h.

◆ Self

template<unsigned int VDimension = 2>
using itk::Size< VDimension >::Self = Size

Standard class type aliases.

Definition at line 78 of file itkSize.h.

◆ size_type

template<unsigned int VDimension = 2>
using itk::Size< VDimension >::size_type = unsigned int

Definition at line 247 of file itkSize.h.

◆ SizeType

template<unsigned int VDimension = 2>
using itk::Size< VDimension >::SizeType = Size<VDimension>

Compatible Size and value type alias

Definition at line 81 of file itkSize.h.

◆ SizeValueType

template<unsigned int VDimension = 2>
using itk::Size< VDimension >::SizeValueType = itk::SizeValueType

Definition at line 82 of file itkSize.h.

◆ value_type

template<unsigned int VDimension = 2>
using itk::Size< VDimension >::value_type = itk::SizeValueType

Mirror the std::array type aliases and member function so that the Size class can be treated as a container class in a way that is similar to the std::array.

Definition at line 242 of file itkSize.h.

Member Function Documentation

◆ assign()

template<unsigned int VDimension = 2>
void itk::Size< VDimension >::assign ( const value_type newValue)
inline

Mirror behavior of the std::array manipulations See std::array for documentation on these methods

Definition at line 257 of file itkSize.h.

◆ at() [1/2]

template<unsigned int VDimension = 2>
reference itk::Size< VDimension >::at ( size_type  pos)
inline

Definition at line 351 of file itkSize.h.

◆ at() [2/2]

template<unsigned int VDimension = 2>
const_reference itk::Size< VDimension >::at ( size_type  pos) const
inline

Definition at line 358 of file itkSize.h.

◆ back() [1/2]

template<unsigned int VDimension = 2>
reference itk::Size< VDimension >::back ( )
inline

Definition at line 377 of file itkSize.h.

◆ back() [2/2]

template<unsigned int VDimension = 2>
const_reference itk::Size< VDimension >::back ( ) const
inline

Definition at line 383 of file itkSize.h.

◆ begin() [1/2]

template<unsigned int VDimension = 2>
constexpr iterator itk::Size< VDimension >::begin ( )
inlineconstexpr

◆ begin() [2/2]

template<unsigned int VDimension = 2>
constexpr const_iterator itk::Size< VDimension >::begin ( ) const
inlineconstexpr

Definition at line 281 of file itkSize.h.

◆ cbegin()

template<unsigned int VDimension = 2>
constexpr const_iterator itk::Size< VDimension >::cbegin ( ) const
inlineconstexpr

Definition at line 269 of file itkSize.h.

◆ cend()

template<unsigned int VDimension = 2>
constexpr const_iterator itk::Size< VDimension >::cend ( ) const
inlineconstexpr

Definition at line 287 of file itkSize.h.

◆ data() [1/2]

template<unsigned int VDimension = 2>
SizeValueType* itk::Size< VDimension >::data ( )
inline

Definition at line 389 of file itkSize.h.

◆ data() [2/2]

template<unsigned int VDimension = 2>
const SizeValueType* itk::Size< VDimension >::data ( ) const
inline

Definition at line 395 of file itkSize.h.

◆ empty()

template<unsigned int VDimension = 2>
constexpr bool itk::Size< VDimension >::empty ( ) const
inlineconstexpr

Definition at line 341 of file itkSize.h.

◆ end() [1/2]

template<unsigned int VDimension = 2>
constexpr iterator itk::Size< VDimension >::end ( )
inlineconstexpr

◆ end() [2/2]

template<unsigned int VDimension = 2>
constexpr const_iterator itk::Size< VDimension >::end ( ) const
inlineconstexpr

Definition at line 299 of file itkSize.h.

◆ ExceptionThrowingBoundsCheck()

template<unsigned int VDimension = 2>
void itk::Size< VDimension >::ExceptionThrowingBoundsCheck ( size_type  pos) const
inlineprivate

Definition at line 402 of file itkSize.h.

◆ Fill()

template<unsigned int VDimension = 2>
void itk::Size< VDimension >::Fill ( SizeValueType  value)
inline

Set one value for the index in all dimensions. Useful for initializing an offset to zero.

Examples
SphinxExamples/src/Bridge/VtkGlue/VisualizeEvolvingDense2DLevelSetAsElevationMap/Code.cxx, SphinxExamples/src/Bridge/VtkGlue/VisualizeEvolvingDense2DLevelSetZeroSet/Code.cxx, SphinxExamples/src/Core/Common/ApplyAFilterOnlyToASpecifiedRegionOfAnImage/Code.cxx, SphinxExamples/src/Core/Common/CreateAnImageRegion/Code.cxx, SphinxExamples/src/Core/Common/CreateAnother/Code.cxx, SphinxExamples/src/Core/Common/CreateVectorImage/Code.cxx, SphinxExamples/src/Core/Common/CropImageBySpecifyingRegion/Code.cxx, SphinxExamples/src/Core/Common/IsPixelInsideRegion/Code.cxx, SphinxExamples/src/Core/Common/IterateLineThroughImage/Code.cxx, SphinxExamples/src/Core/Common/IterateLineThroughImageWithoutWriteAccess/Code.cxx, SphinxExamples/src/Core/Common/IterateOverARegionWithAShapedNeighborhoodIterator/Code.cxx, SphinxExamples/src/Core/Common/IterateOverARegionWithAShapedNeighborhoodIteratorManual/Code.cxx, SphinxExamples/src/Core/Common/IterateOverSpecificRegion/Code.cxx, SphinxExamples/src/Core/Common/ObserveAnEvent/Code.cxx, SphinxExamples/src/Core/Common/RandomSelectPixelFromRegionWithoutReplacee/Code.cxx, SphinxExamples/src/Core/Common/StoreNonPixelDataInImage/Code.cxx, SphinxExamples/src/Core/Common/StreamAPipeline/Code.cxx, SphinxExamples/src/Core/Common/WatchAFilter/Code.cxx, SphinxExamples/src/Core/ImageAdaptors/AddConstantToPixelsWithoutDuplicatingImage/Code.cxx, SphinxExamples/src/Core/ImageAdaptors/ExtractChannelOfImageWithMultipleComponents/Code.cxx, SphinxExamples/src/Core/ImageAdaptors/PresentImageAfterOperation/Code.cxx, SphinxExamples/src/Core/ImageAdaptors/ProcessNthComponentOfVectorImage/Code.cxx, SphinxExamples/src/Core/ImageAdaptors/ViewComponentVectorImageAsScaleImage/Code.cxx, SphinxExamples/src/Core/ImageFunction/MultiplyKernelWithAnImageAtLocation/Code.cxx, SphinxExamples/src/Core/TestKernel/GenerateRandomImage/Code.cxx, SphinxExamples/src/Filtering/BinaryMathematicalMorphology/ThinImage/Code.cxx, SphinxExamples/src/Filtering/Convolution/ColorNormalizedCorrelation/Code.cxx, SphinxExamples/src/Filtering/Convolution/ConvolveImageWithKernel/Code.cxx, SphinxExamples/src/Filtering/Convolution/NormalizedCorrelation/Code.cxx, SphinxExamples/src/Filtering/Convolution/NormalizedCorrelationOfMaskedImage/Code.cxx, SphinxExamples/src/Filtering/Convolution/NormalizedCorrelationUsingFFT/Code.cxx, SphinxExamples/src/Filtering/Convolution/NormalizedCorrelationUsingFFTWithMaskImages/Code.cxx, SphinxExamples/src/Filtering/ImageCompare/AbsValueOfTwoImages/Code.cxx, SphinxExamples/src/Filtering/ImageCompare/CombineTwoImagesWithCheckerBoardPattern/Code.cxx, SphinxExamples/src/Filtering/ImageCompare/SquaredDifferenceOfTwoImages/Code.cxx, SphinxExamples/src/Filtering/ImageCompose/ComposeVectorFromThreeScalarImages/Code.cxx, SphinxExamples/src/Filtering/ImageCompose/CreateVectorImageFromScalarImages/Code.cxx, SphinxExamples/src/Filtering/ImageCompose/JoinImages/Code.cxx, SphinxExamples/src/Filtering/ImageFilterBase/ApplyKernelToEveryPixel/Code.cxx, SphinxExamples/src/Filtering/ImageFilterBase/ComputeLocalNoise/Code.cxx, SphinxExamples/src/Filtering/ImageFilterBase/CustomOperationToCorrespondingPixelsInTwoImages/Code.cxx, SphinxExamples/src/Filtering/ImageFilterBase/PredefinedOperationToCorrespondingPixelsInTwoImages/Code.cxx, SphinxExamples/src/Filtering/ImageFusion/ColorBoundariesOfRegions/Code.cxx, SphinxExamples/src/Filtering/ImageFusion/ColorLabeledRegions/Code.cxx, SphinxExamples/src/Filtering/ImageFusion/OverlayLabelMapOnImage/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/FitSplineIntoPointSet/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/PadAnImageWithAConstant/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/ShrinkImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/AddConstantToEveryPixel/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/ApplyAtanImageFilter/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/BinaryANDTwoImages/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/BinaryORTwoImages/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/BinaryXORTwoImages/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/CompareTwoImagesAndSetOutputPixelToMax/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/CompareTwoImagesAndSetOutputPixelToMin/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/ComputeEdgePotential/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/ExtractComponentOfVectorImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/IntensityWindowing/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/InverseOfMaskToImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/ScalePixelSumToConstant/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/SquareEveryPixel/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/SubtractConstantFromEveryPixel/Code.cxx, SphinxExamples/src/Filtering/ImageLabel/ExtractInnerAndOuterBoundariesOfBlobsInBinaryImage/Code.cxx, SphinxExamples/src/Filtering/ImageStatistics/StatisticalPropertiesOfRegions/Code.cxx, SphinxExamples/src/Filtering/LabelMap/ConvertLabelMapToImage/Code.cxx, SphinxExamples/src/Filtering/LabelMap/InvertImageUsingBinaryNot/Code.cxx, SphinxExamples/src/Filtering/LabelMap/KeepRegionsAboveLevel/Code.cxx, SphinxExamples/src/Filtering/LabelMap/KeepRegionsThatMeetSpecific/Code.cxx, SphinxExamples/src/Filtering/LabelMap/LabelBinaryRegionsAndGetProperties/Code.cxx, SphinxExamples/src/Filtering/LabelMap/LabelBinaryRegionsInImage/Code.cxx, SphinxExamples/src/Filtering/LabelMap/MaskOneImageGivenLabelMap/Code.cxx, SphinxExamples/src/Filtering/LabelMap/RemoveLabelsFromLabelMap/Code.cxx, SphinxExamples/src/Filtering/Thresholding/SeparateGroundUsingOtsu/Code.cxx, SphinxExamples/src/ImageCompareCommand.cxx, SphinxExamples/src/Nonunit/Review/GeometricPropertiesOfRegion/Code.cxx, SphinxExamples/src/Registration/Common/MultiresolutionPyramidFromImage/Code.cxx, SphinxExamples/src/Registration/Common/RegisterImageToAnotherUsingLandmarks/Code.cxx, and SphinxExamples/src/Segmentation/Voronoi/VoronoiDiagram/Code.cxx.

Definition at line 213 of file itkSize.h.

Referenced by itk::BinaryCrossStructuringElement< TPixel, VDimension, TAllocator >::BinaryCrossStructuringElement(), itk::BoxAccumulateFunction(), itk::BoxSquareAccumulateFunction(), and itk::CornerOffsets().

◆ Filled()

template<unsigned int VDimension = 2>
static constexpr Self itk::Size< VDimension >::Filled ( const SizeValueType  value)
inlinestaticconstexpr

Returns a Size object, filled with the specified value for each element.

Definition at line 414 of file itkSize.h.

◆ front() [1/2]

template<unsigned int VDimension = 2>
reference itk::Size< VDimension >::front ( )
inline

Definition at line 365 of file itkSize.h.

◆ front() [2/2]

template<unsigned int VDimension = 2>
const_reference itk::Size< VDimension >::front ( ) const
inline

Definition at line 371 of file itkSize.h.

◆ GetElement()

template<unsigned int VDimension = 2>
SizeValueType itk::Size< VDimension >::GetElement ( unsigned long  element) const
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.

Warning
No bound checking is performed
See also
GetSize()
SetElement()

Definition at line 205 of file itkSize.h.

◆ GetSize()

template<unsigned int VDimension = 2>
const SizeValueType* itk::Size< VDimension >::GetSize ( ) const
inline

Get the size. This provides a read only pointer to the size.

See also
SetSize
Examples
Examples/DataRepresentation/Path/PolyLineParametricPath1.cxx, Examples/Filtering/DigitallyReconstructedRadiograph1.cxx, Examples/Filtering/FFTDirectInverse.cxx, Examples/Filtering/ResampleImageFilter4.cxx, Examples/Filtering/ResampleImageFilter5.cxx, Examples/Filtering/ResampleImageFilter7.cxx, Examples/Filtering/ResampleImageFilter8.cxx, Examples/Filtering/ResampleVolumesToBeIsotropic.cxx, Examples/Filtering/SubsampleVolume.cxx, Examples/IO/ImageReadDicomSeriesWrite.cxx, Examples/IO/ImageReadExtractFilterInsertWrite.cxx, Examples/IO/ImageReadExtractWrite.cxx, Examples/IO/ImageReadImageSeriesWrite.cxx, Examples/Iterators/ImageRegionIteratorWithIndex.cxx, Examples/RegistrationITKv4/BSplineWarping1.cxx, Examples/RegistrationITKv4/BSplineWarping2.cxx, Examples/RegistrationITKv4/DeformableRegistration2.cxx, Examples/RegistrationITKv4/DeformableRegistration5.cxx, Examples/RegistrationITKv4/ImageRegistration14.cxx, Examples/RegistrationITKv4/ImageRegistration15.cxx, Examples/RegistrationITKv4/ImageRegistration5.cxx, Examples/RegistrationITKv4/ImageRegistration8.cxx, Examples/RegistrationITKv4/ModelToImageRegistration2.cxx, Examples/RegistrationITKv4/MultiStageImageRegistration1.cxx, Examples/RegistrationITKv4/ThinPlateSplineWarp.cxx, SphinxExamples/src/Core/Common/GetImageSize/Code.cxx, SphinxExamples/src/Core/ImageFunction/ResampleSegmentedImage/Code.cxx, SphinxExamples/src/Core/Transform/ApplyAffineTransformFromHomogeneousMatrixAndResample/Code.cxx, SphinxExamples/src/Filtering/FFT/FilterImageInFourierDomain/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/ProcessA2DSliceOfA3DImage/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/ResampleAnImage/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/ResampleAScalarImage/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/UpsampleAnImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/InverseOfMaskToImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/MaskImage/Code.cxx, SphinxExamples/src/IO/GDCM/ResampleDICOMSeries/Code.cxx, SphinxExamples/src/IO/ImageBase/GenerateSlicesFromVolume/Code.cxx, and SphinxExamples/src/IO/ImageBase/ProcessImageChunks/Code.cxx.

Definition at line 171 of file itkSize.h.

◆ GetSizeDimension()

template<unsigned int VDimension = 2>
static constexpr unsigned int itk::Size< VDimension >::GetSizeDimension ( )
inlinestaticconstexpr

Get the dimension.

Definition at line 89 of file itkSize.h.

◆ max_size()

template<unsigned int VDimension = 2>
constexpr size_type itk::Size< VDimension >::max_size ( ) const
inlineconstexpr

Definition at line 335 of file itkSize.h.

◆ operator*()

template<unsigned int VDimension = 2>
const Self itk::Size< VDimension >::operator* ( const Self vec) const
inline

Multiply two sizes (elementwise product).

Definition at line 145 of file itkSize.h.

◆ operator*=()

template<unsigned int VDimension = 2>
const Self& itk::Size< VDimension >::operator*= ( const Self vec)
inline

Multiply two sizes (elementwise product).

Definition at line 158 of file itkSize.h.

◆ operator+()

template<unsigned int VDimension = 2>
const Self itk::Size< VDimension >::operator+ ( const Self vec) const
inline

Add two sizes.

Definition at line 96 of file itkSize.h.

◆ operator+=()

template<unsigned int VDimension = 2>
const Self& itk::Size< VDimension >::operator+= ( const Self vec)
inline

Increment size by a size.

Definition at line 109 of file itkSize.h.

◆ operator-()

template<unsigned int VDimension = 2>
const Self itk::Size< VDimension >::operator- ( const Self vec) const
inline

Subtract two sizes.

Definition at line 121 of file itkSize.h.

◆ operator-=()

template<unsigned int VDimension = 2>
const Self& itk::Size< VDimension >::operator-= ( const Self vec)
inline

Decrement size by a size.

Definition at line 134 of file itkSize.h.

◆ operator[]() [1/2]

template<unsigned int VDimension = 2>
constexpr reference itk::Size< VDimension >::operator[] ( size_type  pos)
inlineconstexpr

Definition at line 346 of file itkSize.h.

◆ operator[]() [2/2]

template<unsigned int VDimension = 2>
constexpr const_reference itk::Size< VDimension >::operator[] ( size_type  pos) const
inlineconstexpr

Definition at line 348 of file itkSize.h.

◆ rbegin() [1/2]

template<unsigned int VDimension = 2>
reverse_iterator itk::Size< VDimension >::rbegin ( )
inline

Definition at line 305 of file itkSize.h.

◆ rbegin() [2/2]

template<unsigned int VDimension = 2>
const_reverse_iterator itk::Size< VDimension >::rbegin ( ) const
inline

Definition at line 311 of file itkSize.h.

◆ rend() [1/2]

template<unsigned int VDimension = 2>
reverse_iterator itk::Size< VDimension >::rend ( )
inline

Definition at line 317 of file itkSize.h.

◆ rend() [2/2]

template<unsigned int VDimension = 2>
const_reverse_iterator itk::Size< VDimension >::rend ( ) const
inline

Definition at line 323 of file itkSize.h.

◆ SetElement()

template<unsigned int VDimension = 2>
void itk::Size< VDimension >::SetElement ( unsigned long  element,
SizeValueType  val 
)
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.

Warning
No bound checking is performed.
See also
SetSize()
GetElement()

Definition at line 193 of file itkSize.h.

◆ SetSize()

template<unsigned int VDimension = 2>
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.

See also
GetSize
Examples
Examples/Filtering/DigitallyReconstructedRadiograph1.cxx, Examples/Filtering/ResampleImageFilter.cxx, Examples/Filtering/ResampleImageFilter2.cxx, Examples/Filtering/ResampleImageFilter3.cxx, Examples/Filtering/ResampleImageFilter6.cxx, Examples/Filtering/ResampleImageFilter9.cxx, Examples/Filtering/ResampleOrientedImageFilter.cxx, Examples/Filtering/SpatialObjectToImage1.cxx, Examples/Filtering/SpatialObjectToImage2.cxx, Examples/Filtering/SpatialObjectToImage3.cxx, Examples/RegistrationITKv4/DeformableRegistration2.cxx, Examples/RegistrationITKv4/DeformableRegistration5.cxx, Examples/RegistrationITKv4/ImageRegistration14.cxx, Examples/RegistrationITKv4/ImageRegistration15.cxx, Examples/RegistrationITKv4/ImageRegistrationHistogramPlotter.cxx, Examples/RegistrationITKv4/ModelToImageRegistration1.cxx, SphinxExamples/src/Core/Common/ApplyCustomOperationToEachPixelInImage/Code.cxx, SphinxExamples/src/Core/Common/MakeOutOfBoundsPixelsReturnConstValue/Code.cxx, SphinxExamples/src/Core/Common/MakePartOfImageTransparent/Code.cxx, SphinxExamples/src/Core/Common/SetPixelValueInOneImage/Code.cxx, SphinxExamples/src/Core/ImageFunction/LinearlyInterpolatePositionInImage/Code.cxx, SphinxExamples/src/Core/ImageFunction/ResampleSegmentedImage/Code.cxx, SphinxExamples/src/Core/SpatialObjects/ConvertSpatialObjectToImage/Code.cxx, SphinxExamples/src/Core/SpatialObjects/Ellipse/Code.cxx, SphinxExamples/src/Core/Transform/GlobalRegistrationTwoImagesAffine/Code.cxx, SphinxExamples/src/Core/Transform/GlobalRegistrationTwoImagesBSpline/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/CropImageBySpecifyingRegion2/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/FitSplineIntoPointSet/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/PadImageByWrapping/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/ResampleAVectorImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/AbsValueOfImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/AddTwoImages/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/InvertImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/PixelDivisionOfTwoImages/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/SubtractTwoImages/Code.cxx, SphinxExamples/src/Filtering/ImageLabel/ExtractBoundariesOfConnectedRegionsInBinaryImage/Code.cxx, SphinxExamples/src/Filtering/ImageLabel/LabelContoursOfConnectComponent/Code.cxx, SphinxExamples/src/Filtering/ImageStatistics/ComputeMinMaxVarianceMeanOfImage/Code.cxx, SphinxExamples/src/Filtering/LabelMap/ConvertImageToLabelMap/Code.cxx, SphinxExamples/src/Filtering/LabelMap/ConvertImageWithLabelsToShapeLabelMap/Code.cxx, SphinxExamples/src/Filtering/LabelMap/KeepBinaryRegionsThatMeetSpecific/Code.cxx, SphinxExamples/src/Filtering/MathematicalMorphology/RegionalMaximal/Code.cxx, SphinxExamples/src/Filtering/MathematicalMorphology/ValuedRegionalMaximaImage/Code.cxx, SphinxExamples/src/Filtering/MathematicalMorphology/ValuedRegionalMinimalImage/Code.cxx, SphinxExamples/src/IO/ImageBase/WriteAnImage/Code.cxx, SphinxExamples/src/IO/TIFF/WriteATIFFImage/Code.cxx, SphinxExamples/src/Numerics/Statistics/DistributionOfPixelsUsingGMM/Code.cxx, SphinxExamples/src/Registration/Common/GlobalRegistrationOfTwoImages/Code.cxx, SphinxExamples/src/Segmentation/Classifiers/ClusterPixelsInGrayscaleImage/Code.cxx, SphinxExamples/src/Segmentation/Classifiers/KMeansClusterOfPixelsInImage/Code.cxx, SphinxExamples/src/Segmentation/ConnectedComponents/AssignContiguousLabelsToConnectedRegions/Code.cxx, SphinxExamples/src/Segmentation/KLMRegionGrowing/BasicRegionGrowing/Code.cxx, and SphinxExamples/src/Segmentation/RegionGrowing/ConnectedComponentsInImage/Code.cxx.

Definition at line 181 of file itkSize.h.

Referenced by itk::ScanlineFilterCommon< TInputImage, TOutputImage >::SetupLineOffsets().

◆ size()

template<unsigned int VDimension = 2>
constexpr size_type itk::Size< VDimension >::size ( ) const
inlineconstexpr

Definition at line 329 of file itkSize.h.

◆ swap()

template<unsigned int VDimension = 2>
void itk::Size< VDimension >::swap ( Size< VDimension > &  other)
inline

Definition at line 263 of file itkSize.h.

Member Data Documentation

◆ Dimension

template<unsigned int VDimension = 2>
constexpr unsigned int itk::Size< VDimension >::Dimension = VDimension
staticconstexpr

Dimension constant

Definition at line 85 of file itkSize.h.

◆ m_InternalArray

template<unsigned int VDimension = 2>
SizeValueType itk::Size< VDimension >::m_InternalArray[VDimension]

The documentation for this struct was generated from the following file: