Orfeo Toolbox  4.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | List of all members
itk::FixedArray< TValueType, VLength > Class Template Reference

Simulate a standard C array with copy semnatics. More...

#include <itkFixedArray.h>

+ Collaboration diagram for itk::FixedArray< TValueType, VLength >:

Classes

class  ConstReverseIterator
 A const reverse iterator through an array. More...
 
class  ReverseIterator
 A reverse iterator through an array. More...
 

Public Types

typedef ValueType CArray [VLength]
 
typedef const ValueTypeconst_pointer
 
typedef const ValueTypeconst_reference
 
typedef const ValueTypeConstIterator
 
typedef ValueTypeIterator
 
typedef ValueTypepointer
 
typedef ValueTypereference
 
typedef unsigned int SizeType
 
typedef TValueType ValueType
 

Public Member Functions

 FixedArray ()
 
 FixedArray (const ValueType r[VLength])
 
 FixedArray (const ValueType &r)
 
template<typename TFixedArrayValueType >
 FixedArray (const FixedArray< TFixedArrayValueType, VLength > &r)
 
template<typename TScalarValue >
 FixedArray (const TScalarValue *r)
 
Iterator Begin ()
 
ConstIterator Begin () const
 
Iterator End ()
 
ConstIterator End () const
 
void Fill (const ValueType &)
 
ValueTypeGetDataPointer ()
 
const ValueTypeGetDataPointer () const
 
const_reference GetElement (unsigned short index) const
 
bool operator!= (const FixedArray &r) const
 
template<typename TFixedArrayValueType >
FixedArrayoperator= (const FixedArray< TFixedArrayValueType, VLength > &r)
 
FixedArrayoperator= (const ValueType r[VLength])
 
bool operator== (const FixedArray &r) const
 
reference operator[] (short index)
 
const_reference operator[] (short index) const
 
reference operator[] (unsigned short index)
 
const_reference operator[] (unsigned short index) const
 
reference operator[] (int index)
 
const_reference operator[] (int index) const
 
reference operator[] (unsigned int index)
 
const_reference operator[] (unsigned int index) const
 
reference operator[] (long index)
 
const_reference operator[] (long index) const
 
reference operator[] (unsigned long index)
 
const_reference operator[] (unsigned long index) const
 
reference operator[] (long long index)
 
const_reference operator[] (long long index) const
 
reference operator[] (unsigned long long index)
 
const_reference operator[] (unsigned long long index) const
 
ReverseIterator rBegin ()
 
ConstReverseIterator rBegin () const
 
ReverseIterator rEnd ()
 
ConstReverseIterator rEnd () const
 
void SetElement (unsigned short index, const_reference value)
 
SizeType Size () const
 

Static Public Member Functions

static FixedArray Filled (const ValueType &)
 

Static Public Attributes

static const unsigned int Dimension = VLength
 
static const unsigned int Length = VLength
 

Private Attributes

CArray m_InternalArray
 

Detailed Description

template<typename TValueType, unsigned int VLength = 3>
class itk::FixedArray< TValueType, VLength >

Simulate a standard C array with copy semnatics.

Simulates a standard C array, except that copy semantics are used instead of reference semantics. Also, arrays of different sizes cannot be assigned to one another, and size information is known for function returns.

Template Parameters
TValueTypeElement type stored at each location in the array.
VLength= Length of the array.

The length of the array is fixed at compile time. If you wish to specify the length of the array at run-time, use the class itk::Array. If you wish to change to change the length of the array at run-time, you're best off using std::vector<>.

{Utilities/FixedArray,C-style array}

Definition at line 50 of file itkFixedArray.h.

Member Typedef Documentation

template<typename TValueType, unsigned int VLength = 3>
typedef ValueType itk::FixedArray< TValueType, VLength >::CArray[VLength]

A type representing the C-array version of this FixedArray.

Definition at line 63 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
typedef const ValueType* itk::FixedArray< TValueType, VLength >::const_pointer

A const pointer to the ValueType.

Definition at line 121 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
typedef const ValueType& itk::FixedArray< TValueType, VLength >::const_reference

A const reference to the ValueType.

Definition at line 127 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
typedef const ValueType* itk::FixedArray< TValueType, VLength >::ConstIterator

A const iterator through the array.

Definition at line 69 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
typedef ValueType* itk::FixedArray< TValueType, VLength >::Iterator

An iterator through the array.

Definition at line 66 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
typedef ValueType* itk::FixedArray< TValueType, VLength >::pointer

A pointer to the ValueType.

Definition at line 118 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
typedef ValueType& itk::FixedArray< TValueType, VLength >::reference

A reference to the ValueType.

Definition at line 124 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
typedef unsigned int itk::FixedArray< TValueType, VLength >::SizeType

Definition at line 129 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
typedef TValueType itk::FixedArray< TValueType, VLength >::ValueType

The element type stored at each location in the FixedArray.

Definition at line 60 of file itkFixedArray.h.

Constructor & Destructor Documentation

template<typename TValueType , unsigned int VLength>
itk::FixedArray< TValueType, VLength >::FixedArray ( )

Constructors

Default constructor uses compiler's default initialization of memory. For efficiency, no initialization to zero is done.

Definition at line 31 of file itkFixedArray.hxx.

template<typename TValueType , unsigned int VLength>
itk::FixedArray< TValueType, VLength >::FixedArray ( const ValueType  r[VLength])

Constructor assumes input points to array of correct size. Values are copied individually instead of with a binary copy. This allows the ValueType's assignment operator to be executed.

Definition at line 54 of file itkFixedArray.hxx.

template<typename TValueType , unsigned int VLength>
itk::FixedArray< TValueType, VLength >::FixedArray ( const ValueType r)

Constructor to initialize entire array to one value.

Definition at line 39 of file itkFixedArray.hxx.

template<typename TValueType, unsigned int VLength = 3>
template<typename TFixedArrayValueType >
itk::FixedArray< TValueType, VLength >::FixedArray ( const FixedArray< TFixedArrayValueType, VLength > &  r)
inline

Constructor to initialize a fixed array from another of any data type

Definition at line 139 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
template<typename TScalarValue >
itk::FixedArray< TValueType, VLength >::FixedArray ( const TScalarValue *  r)
inline

Definition at line 150 of file itkFixedArray.h.

Member Function Documentation

template<typename TValueType , unsigned int VLength>
FixedArray< TValueType, VLength >::Iterator itk::FixedArray< TValueType, VLength >::Begin ( void  )
template<typename TValueType , unsigned int VLength>
FixedArray< TValueType, VLength >::ConstIterator itk::FixedArray< TValueType, VLength >::Begin ( void  ) const

Get a ConstIterator for the beginning of the FixedArray.

Definition at line 128 of file itkFixedArray.hxx.

template<typename TValueType , unsigned int VLength>
FixedArray< TValueType, VLength >::Iterator itk::FixedArray< TValueType, VLength >::End ( void  )
template<typename TValueType , unsigned int VLength>
FixedArray< TValueType, VLength >::ConstIterator itk::FixedArray< TValueType, VLength >::End ( void  ) const

Get a ConstIterator for the end of the FixedArray.

Definition at line 150 of file itkFixedArray.hxx.

template<typename TValueType , unsigned int VLength>
void itk::FixedArray< TValueType, VLength >::Fill ( const ValueType value)

Fill all elements of the array with the given value.

Definition at line 216 of file itkFixedArray.hxx.

Referenced by itk::bio::CellularAggregate< NSpaceDimension >::Add(), otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::BeforeThreadedGenerateData(), itk::FlatStructuringElement< VDimension >::Box(), itk::PointSetToPointSetMetricv4< TFixedPointSet, TMovingPointSet >::CalculateValueAndDerivative(), itk::SpatialObject< VDimension >::ComputeBoundingBox(), otb::PolyLineParametricPathWithValue< TValue, VDimension >::ComputeBoundingRegion(), itk::DeformableSimplexMesh3DGradientConstraintForceFilter< TInputMesh, TOutputMesh >::ComputeExternalForce(), itk::DeformableSimplexMesh3DFilter< TInputMesh, TOutputMesh >::ComputeExternalForce(), itk::DeformableSimplexMesh3DFilter< TInputMesh, TOutputMesh >::ComputeGeometry(), itk::DeformableSimplexMesh3DFilter< TInputMesh, TOutputMesh >::ComputeInternalForce(), itk::DisplacementFieldTransform< TScalar, NDimensions >::ComputeJacobianWithRespectToPositionInternal(), itk::FiniteDifferenceFunction< TImageType >::ComputeNeighborhoodScales(), itk::SimplexMesh< TPixelType, VDimension, TMeshTraits >::ComputeNormal(), itk::TubeSpatialObject< TDimension, TTubePointType >::ComputeTangentAndNormals(), otb::NCCRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >::ComputeUpdate(), otb::VectorDataExtractROI< TVectorData >::ComputeVertexListBoundingRegion(), otb::OGRIOHelper::ConvertGeometryToPointNode(), otb::KMLVectorDataIO::ConvertGeometryToPointNode(), itk::SpatialObject< VDimension >::DerivativeAt(), itk::DiscreteGaussianImageFilter< TInputImage, TOutputImage >::DiscreteGaussianImageFilter(), itk::GaussianInterpolateImageFunction< TInputImage, TCoordRep >::EvaluateAtContinuousIndex(), otb::GroundSpacingImageFunction< TInputImage, TCoordRep >::EvaluateAtIndex(), itk::FourierSeriesPath< VDimension >::EvaluateDerivative(), itk::CentralDifferenceImageFunction< TInputImage, TCoordRep, TOutputType >::EvaluateSpecialized(), itk::FixedArray< TValueType, VLength >::Filled(), itk::ImageToImageMetric< TFixedImage, TMovingImage >::FixedImageSamplePoint::FixedImageSamplePoint(), itk::VoronoiDiagram2DGenerator< TCoordType >::FortuneSite::FortuneSite(), otb::BSplinesInterpolateTransformDisplacementFieldGenerator< TPointSet, TDisplacementField >::GenerateData(), otb::ImageToSURFKeyPointSetFilter< TInputImage, TOutputPointSet >::GenerateData(), itk::DisplacementFieldToBSplineImageFilter< TInputImage, TOutputImage >::GenerateData(), itk::ExtractImageFilter< TInputImage, TOutputImage >::GenerateOutputInformation(), itk::VoronoiDiagram2DGenerator< TCoordType >::GenerateVDFortune(), otb::ogr::ImageReference< double >::ImageReference(), itk::ImageRegistrationMethodv4< TFixedImage, TMovingImage, TOutputTransform, TVirtualImage >::ImageRegistrationMethodv4(), otb::RationalTransform< TScalarType, Dimension >::InitalizeParameters(), itk::FastMarchingUpwindGradientImageFilter< TLevelSet, TSpeedImage >::Initialize(), itk::FastMarchingUpwindGradientImageFilterBase< TInput, TOutput >::InitializeOutput(), otb::Functor::LabelObjectToPolygonFunctor< TLabelObject, TPolygon >::LabelObjectToPolygonFunctor(), itk::LineSpatialObjectPoint< TPointDimension >::LineSpatialObjectPoint(), itk::MatrixOffsetTransformBase< TScalar, NInputDimensions, NOutputDimensions >::MatrixOffsetTransformBase(), otb::Functor::StatisticsAttributesLabelObjectFunctor< TLabelObject, TFeatureImage >::operator()(), otb::Functor::AlphaBlendingFunctor< itk::RGBAPixel< TInputInternalPixel1 >, itk::RGBAPixel< TInputInternalPixel2 >, itk::RGBAPixel< TOutputInternalPixel > >::operator()(), otb::Functor::PolarimetricSynthesisFunctor< TInput1, TInput2, TInput3, TInput4, TOutput >::PolarimetricSynthesisFunctor(), itk::Rigid3DPerspectiveTransform< TScalar >::Rigid3DPerspectiveTransform(), itk::ScaleSkewVersor3DTransform< TScalar >::ScaleSkewVersor3DTransform(), itk::ScaleTransform< TScalar, NDimensions >::ScaleTransform(), itk::ScaleVersor3DTransform< TScalar >::ScaleVersor3DTransform(), itk::BSplineTransform< TScalar, NDimensions, VSplineOrder >::SetCoefficientImages(), itk::BilateralImageFilter< TInputImage, TOutputImage >::SetDomainSigma(), itk::BSplineTransform< TScalar, NDimensions, VSplineOrder >::SetFixedParametersGridOriginFromTransformDomainInformation(), itk::ScaleTransform< TScalar, NDimensions >::SetIdentity(), itk::ImageSpatialObject< TDimension, TPixelType >::SetImage(), itk::MovingHistogramImageFilterBase< TInputImage, TOutputImage, TKernel >::SetKernel(), itk::NumericTraits< FixedArray< T, D > >::SetLength(), itk::ZeroCrossingBasedEdgeDetectionImageFilter< TInputImage, TOutputImage >::SetMaximumError(), itk::DiscreteGaussianImageFilter< TInputImage, TOutputImage >::SetMaximumError(), itk::CannyEdgeDetectionImageFilter< ImageType, ImageType >::SetMaximumError(), itk::DisplacementFieldToBSplineImageFilter< TInputImage, TOutputImage >::SetNumberOfFittingLevels(), itk::N4BiasFieldCorrectionImageFilter< TInputImage, TMaskImage, TOutputImage >::SetNumberOfFittingLevels(), itk::ImageRegistrationMethodv4< TFixedImage, TMovingImage, TOutputTransform, TVirtualImage >::SetNumberOfLevels(), itk::PermuteAxesImageFilter< TImage >::SetOrder(), itk::ImageRegistrationMethodv4< TFixedImage, TMovingImage, TOutputTransform >::SetShrinkFactorsPerLevel(), itk::ZeroCrossingBasedEdgeDetectionImageFilter< TInputImage, TOutputImage >::SetVariance(), itk::DiscreteGaussianImageFilter< TInputImage, TOutputImage >::SetVariance(), itk::CannyEdgeDetectionImageFilter< ImageType, ImageType >::SetVariance(), itk::ShapeLabelObject< TLabel, VImageDimension >::ShapeLabelObject(), itk::SimplexMeshGeometry::SimplexMeshGeometry(), itk::MutualInformationImageToImageMetric< TFixedImage, TMovingImage >::SpatialSample::SpatialSample(), itk::StatisticsLabelObject< TLabel, VImageDimension >::StatisticsLabelObject(), itk::SymmetricEigenSystem< TMatrixElement, VNumberOfRows >::SymmetricEigenSystem(), otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::ThreadedGenerateData(), itk::MovingHistogramImageFilter< TInputImage, TOutputImage, TKernel, THistogram >::ThreadedGenerateData(), itk::BSplineControlPointImageFilter< TInputImage, TOutputImage >::ThreadedGenerateData(), itk::BSplineScatteredDataPointSetToImageFilter< TInputPointSet, TOutputImage >::ThreadedGenerateDataForReconstruction(), itk::BSplineTransform< TScalar, NDimensions, VSplineOrder >::TransformPoint(), itk::BSplineDeformableTransform< TScalar, NDimensions, VSplineOrder >::TransformPoint(), itk::TranslationTransform< TScalar, NDimensions >::TranslationTransform(), itk::N4BiasFieldCorrectionImageFilter< TInputImage, TMaskImage, TOutputImage >::UpdateBiasFieldEstimate(), itk::BSplineScatteredDataPointSetToImageFilter< TInputPointSet, TOutputImage >::UpdatePointSet(), and itk::ZeroCrossingBasedEdgeDetectionImageFilter< TInputImage, TOutputImage >::ZeroCrossingBasedEdgeDetectionImageFilter().

template<typename TValueType , unsigned int VLength>
FixedArray< TValueType, VLength > itk::FixedArray< TValueType, VLength >::Filled ( const ValueType value)
static

Return an FixedArray with all elements assigned to the given value.

Definition at line 232 of file itkFixedArray.hxx.

References itk::FixedArray< TValueType, VLength >::Fill().

template<typename TValueType, unsigned int VLength = 3>
ValueType* itk::FixedArray< TValueType, VLength >::GetDataPointer ( )
inline
template<typename TValueType, unsigned int VLength = 3>
const ValueType* itk::FixedArray< TValueType, VLength >::GetDataPointer ( ) const
inline

Definition at line 225 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
const_reference itk::FixedArray< TValueType, VLength >::GetElement ( unsigned short  index) const
inline
template<typename TValueType, unsigned int VLength = 3>
bool itk::FixedArray< TValueType, VLength >::operator!= ( const FixedArray< TValueType, VLength > &  r) const
inline

Definition at line 191 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
template<typename TFixedArrayValueType >
FixedArray& itk::FixedArray< TValueType, VLength >::operator= ( const FixedArray< TFixedArrayValueType, VLength > &  r)
inline

This destructor is not virtual for performance reasons. However, this means that subclasses cannot allocate memory.

The destructor is PURPOSELY NOT DEFINED, in order to prevent inefficient byte alignment of arrays of this object.

~FixedArray();

For a full discussion, see http://www.itk.org/mailman/private/insight-developers/2008-June/010480.htmlOperator= defined for a variety of types.

Definition at line 170 of file itkFixedArray.h.

Referenced by itk::SymmetricSecondRankTensor< TComponent, 3 >::operator=().

template<typename TValueType , unsigned int VLength>
FixedArray< TValueType, VLength > & itk::FixedArray< TValueType, VLength >::operator= ( const ValueType  r[VLength])

Assignment operator assumes input points to array of correct size. Values are copied individually instead of with a binary copy. This allows the ValueType's assignment operator to be executed.

Definition at line 73 of file itkFixedArray.hxx.

template<typename TValueType , unsigned int VLength>
bool itk::FixedArray< TValueType, VLength >::operator== ( const FixedArray< TValueType, VLength > &  r) const

Operators == and != are used to compare whether two arrays are equal. Note that arrays are equal when the number of components (size) is the same, and each component value is equal.

Operator != compares different types of arrays.

Definition at line 93 of file itkFixedArray.hxx.

References itk::FixedArray< TValueType, VLength >::Begin().

Referenced by itk::FixedArray< TInternalImageFunctionType::CoordRepType, NPointDimension >::operator!=().

template<typename TValueType, unsigned int VLength = 3>
reference itk::FixedArray< TValueType, VLength >::operator[] ( short  index)
inline

Allow the FixedArray to be indexed normally. No bounds checking is done. The separate versions are a work-around for an integer conversion bug in Visual C++.

Definition at line 197 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
const_reference itk::FixedArray< TValueType, VLength >::operator[] ( short  index) const
inline

Definition at line 198 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
reference itk::FixedArray< TValueType, VLength >::operator[] ( unsigned short  index)
inline

Definition at line 199 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
const_reference itk::FixedArray< TValueType, VLength >::operator[] ( unsigned short  index) const
inline

Definition at line 200 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
reference itk::FixedArray< TValueType, VLength >::operator[] ( int  index)
inline

Definition at line 201 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
const_reference itk::FixedArray< TValueType, VLength >::operator[] ( int  index) const
inline

Definition at line 202 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
reference itk::FixedArray< TValueType, VLength >::operator[] ( unsigned int  index)
inline

Definition at line 203 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
const_reference itk::FixedArray< TValueType, VLength >::operator[] ( unsigned int  index) const
inline

Definition at line 204 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
reference itk::FixedArray< TValueType, VLength >::operator[] ( long  index)
inline

Definition at line 205 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
const_reference itk::FixedArray< TValueType, VLength >::operator[] ( long  index) const
inline

Definition at line 206 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
reference itk::FixedArray< TValueType, VLength >::operator[] ( unsigned long  index)
inline

Definition at line 207 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
const_reference itk::FixedArray< TValueType, VLength >::operator[] ( unsigned long  index) const
inline

Definition at line 208 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
reference itk::FixedArray< TValueType, VLength >::operator[] ( long long  index)
inline

Definition at line 209 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
const_reference itk::FixedArray< TValueType, VLength >::operator[] ( long long  index) const
inline

Definition at line 210 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
reference itk::FixedArray< TValueType, VLength >::operator[] ( unsigned long long  index)
inline

Definition at line 211 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
const_reference itk::FixedArray< TValueType, VLength >::operator[] ( unsigned long long  index) const
inline

Definition at line 212 of file itkFixedArray.h.

template<typename TValueType , unsigned int VLength>
FixedArray< TValueType, VLength >::ReverseIterator itk::FixedArray< TValueType, VLength >::rBegin ( )

Get a begin ReverseIterator.

Definition at line 161 of file itkFixedArray.hxx.

template<typename TValueType , unsigned int VLength>
FixedArray< TValueType, VLength >::ConstReverseIterator itk::FixedArray< TValueType, VLength >::rBegin ( ) const

Get a begin ConstReverseIterator.

Definition at line 172 of file itkFixedArray.hxx.

template<typename TValueType , unsigned int VLength>
FixedArray< TValueType, VLength >::ReverseIterator itk::FixedArray< TValueType, VLength >::rEnd ( )

Get an end ReverseIterator.

Definition at line 183 of file itkFixedArray.hxx.

template<typename TValueType , unsigned int VLength>
FixedArray< TValueType, VLength >::ConstReverseIterator itk::FixedArray< TValueType, VLength >::rEnd ( ) const

Get an end ConstReverseIterator.

Definition at line 194 of file itkFixedArray.hxx.

template<typename TValueType, unsigned int VLength = 3>
void itk::FixedArray< TValueType, VLength >::SetElement ( unsigned short  index,
const_reference  value 
)
inline

Set/Get element methods are more convenient in wrapping languages

Definition at line 215 of file itkFixedArray.h.

template<typename TValueType , unsigned int VLength>
FixedArray< TValueType, VLength >::SizeType itk::FixedArray< TValueType, VLength >::Size ( void  ) const

Member Data Documentation

template<typename TValueType, unsigned int VLength = 3>
const unsigned int itk::FixedArray< TValueType, VLength >::Dimension = VLength
static

Dimension constant

Definition at line 57 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
const unsigned int itk::FixedArray< TValueType, VLength >::Length = VLength
static

Length constant

Definition at line 54 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
CArray itk::FixedArray< TValueType, VLength >::m_InternalArray
private

The documentation for this class was generated from the following files:

Generated at Sat Mar 8 2014 17:01:56 for Orfeo Toolbox with doxygen 1.8.3.1