Orfeo Toolbox  4.0
Public Types | Public Member Functions | Private Attributes | List of all members
itk::Array< TValueType > Class Template Reference

Array class with size defined at construction time. More...

#include <itkArray.h>

+ Inheritance diagram for itk::Array< TValueType >:
+ Collaboration diagram for itk::Array< TValueType >:

Public Types

typedef Array Self
 
typedef vnl_vector< TValueType >
::size_type 
SizeValueType
 
typedef TValueType ValueType
 
typedef vnl_vector< TValueType > VnlVectorType
 

Public Member Functions

template<typename TValueType >
 Array (const Self &rhs)
 
 Array ()
 
 Array (const Array &)
 
 Array (SizeValueType dimension)
 
 Array (ValueType *data, SizeValueType sz, bool LetArrayManageMemory=false)
 
 Array (const ValueType *data, SizeValueType sz, bool LetArrayManageMemory=false)
 
template<typename TArrayValue >
 Array (const Array< TArrayValue > &r)
 
 ~Array ()
 
void Fill (TValueType const &v)
 
const TValueType & GetElement (SizeValueType i) const
 
unsigned int GetNumberOfElements (void) const
 
SizeValueType GetSize (void) const
 
const Selfoperator= (const Self &rhs)
 
const Selfoperator= (const VnlVectorType &rhs)
 
void SetData (TValueType *data, bool LetArrayManageMemory=false)
 
void SetData (TValueType *data, SizeValueType sz, bool LetArrayManageMemory=false)
 
void SetElement (SizeValueType i, const TValueType &value)
 
void SetSize (SizeValueType sz)
 
SizeValueType Size (void) const
 

Private Attributes

bool m_LetArrayManageMemory
 

Detailed Description

template<typename TValueType>
class itk::Array< TValueType >

Array class with size defined at construction time.

This class derives from the vnl_vector<> class. Its size is assigned at construction time (run time) and can not be changed afterwards except by using assignment to another Array.

The class is templated over the type of the elements.

Template parameters for class Array:

Definition at line 50 of file itkArray.h.

Member Typedef Documentation

template<typename TValueType>
typedef Array itk::Array< TValueType >::Self

Definition at line 56 of file itkArray.h.

template<typename TValueType>
typedef vnl_vector< TValueType>::size_type itk::Array< TValueType >::SizeValueType

Definition at line 58 of file itkArray.h.

template<typename TValueType>
typedef TValueType itk::Array< TValueType >::ValueType

The element type stored at each location in the Array.

Definition at line 55 of file itkArray.h.

template<typename TValueType>
typedef vnl_vector< TValueType > itk::Array< TValueType >::VnlVectorType

Definition at line 57 of file itkArray.h.

Constructor & Destructor Documentation

template<typename TValueType >
itk::Array< TValueType >::Array ( )

Default constructor. It is created with an empty array it has to be allocated later by assignment

Default constructor

Definition at line 29 of file itkArray.hxx.

template<typename TValueType>
itk::Array< TValueType >::Array ( const Array< TValueType > &  )

Copy constructor. Uses VNL copy construtor with correct setting for memory management.

template<typename TValueType >
itk::Array< TValueType >::Array ( SizeValueType  dimension)
explicit

Constructor with size. Size can only be changed by assignment

Constructor with size

Definition at line 48 of file itkArray.hxx.

template<typename TValueType >
itk::Array< TValueType >::Array ( ValueType datain,
SizeValueType  sz,
bool  LetArrayManageMemory = false 
)

Constructor that initializes array with contents from a user supplied buffer. The pointer to the buffer and the length is specified. By default, the array does not manage the memory of the buffer. It merely points to that location and it is the user's responsibility to delete it. If "LetArrayManageMemory" is true, then this class will free the memory when this object is destroyed.

Constructor with user specified data

Definition at line 56 of file itkArray.hxx.

template<typename TValueType >
itk::Array< TValueType >::Array ( const ValueType datain,
SizeValueType  sz,
bool  LetArrayManageMemory = false 
)

Constructor that initializes array with contents from a user supplied buffer. The pointer to the buffer and the length is specified. By default, the array does not manage the memory of the buffer. It merely points to that location and it is the user's responsibility to delete it. If "LetArrayManageMemory" is true, then this class will free the memory when this object is destroyed.

Constructor with user specified data

Definition at line 66 of file itkArray.hxx.

template<typename TValueType>
template<typename TArrayValue >
itk::Array< TValueType >::Array ( const Array< TArrayValue > &  r)
inline

Constructor to initialize an array from another of any data type

Definition at line 92 of file itkArray.h.

template<typename TValueType >
itk::Array< TValueType >::~Array ( )

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

Destructor

Definition at line 77 of file itkArray.hxx.

template<typename TValueType>
template<typename TValueType >
itk::Array< TValueType >::Array ( const Self rhs)

Copy constructor

Definition at line 37 of file itkArray.hxx.

Member Function Documentation

template<typename TValueType>
void itk::Array< TValueType >::Fill ( TValueType const &  v)
inline

Set the all the elements of the array to the specified value

Definition at line 103 of file itkArray.h.

Referenced by itk::MutualInformationImageToImageMetric< TFixedImage, TMovingImage >::CalculateDerivatives(), otb::KMeansAttributesLabelMapFilter< TInputImage >::Compute(), itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::ComputeGradientJointEntropy(), otb::BinaryFunctorNeighborhoodJoinHistogramImageFilter< TInputImage1, TInputImage2, TOutputImage, TFunction >::ComputeHistogram(), itk::BSplineBaseTransform< TScalar, NDimensions, VSplineOrder >::ComputeJacobianFromBSplineWeightsWithRespectToPosition(), itk::Statistics::WeightedMeanSampleFilter< TSample >::ComputeMeanWithWeights(), itk::HistogramMatchingImageFilter< TInputImage, TOutputImage, THistogramMeasurement >::ConstructHistogram(), itk::DisplacementFieldTransform< TScalar, NDimensions >::DisplacementFieldTransform(), itk::MRIBiasFieldCorrectionFilter< TInputImage, TOutputImage, TMaskImage >::EstimateBiasField(), itk::RegistrationParameterScalesFromJacobian< TMetric >::EstimateScales(), itk::RegistrationParameterScalesFromShiftBase< TMetric >::EstimateScales(), otb::LocalHistogramImageFunction< TInputImage, TCoordRep >::EvaluateAtIndex(), itk::Statistics::Algorithm::FindSampleBoundAndMean(), itk::Statistics::MeanSampleFilter< TSample >::GenerateData(), itk::Statistics::SampleClassifierFilter< TSample >::GenerateData(), itk::Statistics::ImageClassifierFilter< TSample, TInputImage, TOutputImage >::GenerateData(), itk::Statistics::ScalarImageToCooccurrenceMatrixFilter< TImageType, THistogramFrequencyContainer >::GenerateData(), itk::HistogramThresholdImageFilter< TInputImage, TOutputImage, TMaskImage >::GenerateData(), itk::Statistics::ScalarImageToRunLengthMatrixFilter< TImageType, THistogramFrequencyContainer >::GenerateData(), itk::Statistics::WeightedCentroidKdTreeGenerator< TSample >::GenerateNonterminalNode(), otb::SparseUnmixingImageFilter< TInputImage, TOutputImage, VNbInputImage, TPrecision, TMotherWaveletOperator >::GenerateNumberOfComponentsRequired(), itk::ImageSeriesReader< TOutputImage >::GenerateOutputInformation(), itk::MeanSquaresPointSetToImageMetric< TFixedPointSet, TMovingImage >::GetDerivative(), itk::NormalizedCorrelationImageToImageMetric< TFixedImage, TMovingImage >::GetDerivative(), itk::NormalizedCorrelationPointSetToImageMetric< TFixedPointSet, TMovingImage >::GetDerivative(), itk::MeanReciprocalSquareDifferencePointSetToImageMetric< TFixedPointSet, TMovingImage >::GetDerivative(), otb::SVMCrossValidationCostFunction< TModel >::GetDerivative(), itk::KappaStatisticImageToImageMetric< TFixedImage, TMovingImage >::GetDerivative(), itk::MatchCardinalityImageToImageMetric< TFixedImage, TMovingImage >::GetDerivative(), itk::HistogramImageToImageMetric< TFixedImage, TMovingImage >::GetDerivative(), itk::ExpectationBasedPointSetToPointSetMetricv4< TFixedPointSet, TMovingPointSet >::GetLocalNeighborhoodValueAndDerivative(), itk::MeanSquaresPointSetToImageMetric< TFixedPointSet, TMovingImage >::GetValueAndDerivative(), itk::NormalizedCorrelationImageToImageMetric< TFixedImage, TMovingImage >::GetValueAndDerivative(), itk::NormalizedCorrelationPointSetToImageMetric< TFixedPointSet, TMovingImage >::GetValueAndDerivative(), itk::MeanReciprocalSquareDifferencePointSetToImageMetric< TFixedPointSet, TMovingImage >::GetValueAndDerivative(), itk::MutualInformationImageToImageMetric< TFixedImage, TMovingImage >::GetValueAndDerivative(), itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::InitializePatchWeights(), itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::InitializePatchWeights(), otb::ListSampleToHistogramListGenerator< TListSample, THistogramMeasurement, TFrequencyContainer >::ListSampleToHistogramListGenerator(), otb::Functor::LHMI< itk::ConstNeighborhoodIterator< TInputImage1 >, itk::ConstNeighborhoodIterator< TInputImage2 >, TOutputImage::PixelType >::operator()(), otb::SVMModelEstimator< InputPixelType, LabelPixelType >::OptimizeParameters(), itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::ResolveSigmaUpdate(), itk::Rigid3DPerspectiveTransform< TScalar >::Rigid3DPerspectiveTransform(), itk::VelocityFieldTransform< TScalar, NDimensions >::SetFixedParameters(), itk::ConstantVelocityFieldTransform< TScalar, NDimensions >::SetFixedParameters(), itk::DisplacementFieldTransform< TScalar, NDimensions >::SetFixedParameters(), itk::NumericTraits< Array< T > >::SetLength(), itk::ImageRegistrationMethodv4< TFixedImage, TMovingImage, TOutputTransform, TVirtualImage >::SetMetricSamplingPercentage(), itk::Statistics::ScalarImageToHistogramGenerator< TImageType >::SetNumberOfBins(), itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::ThreadedComputeSigmaUpdate(), itk::Statistics::ImageToHistogramFilter< TImage >::ThreadedGenerateData(), and itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::ThreadedRiemannianMinMax().

template<typename TValueType>
const TValueType& itk::Array< TValueType >::GetElement ( SizeValueType  i) const
inline
template<typename TValueType>
unsigned int itk::Array< TValueType >::GetNumberOfElements ( void  ) const
inline
template<typename TValueType>
SizeValueType itk::Array< TValueType >::GetSize ( void  ) const
inline

Definition at line 130 of file itkArray.h.

Referenced by itk::Array< PixelType >::Array(), itk::Statistics::ChiSquareDistribution::CDF(), itk::Statistics::TDistribution::CDF(), itk::Statistics::GaussianDistribution::CDF(), itk::SPSAOptimizer::ComputeGradient(), itk::RegistrationParameterScalesFromShiftBase< TMetric >::EstimateStepScale(), itk::Statistics::ChiSquareDistribution::EvaluateCDF(), itk::Statistics::TDistribution::EvaluateCDF(), itk::Statistics::GaussianDistribution::EvaluateCDF(), itk::Statistics::ChiSquareDistribution::EvaluateInverseCDF(), itk::Statistics::TDistribution::EvaluateInverseCDF(), itk::Statistics::GaussianDistribution::EvaluateInverseCDF(), itk::Statistics::ChiSquareDistribution::EvaluatePDF(), itk::Statistics::TDistribution::EvaluatePDF(), itk::Statistics::GaussianDistribution::EvaluatePDF(), otb::SparseUnmixingImageFilter< TInputImage, TOutputImage, VNbInputImage, TPrecision, TMotherWaveletOperator >::GenerateNumberOfComponentsRequired(), itk::NumericTraits< Array< T > >::GetLength(), itk::MeanSquaresImageToImageMetric< TFixedImage, TMovingImage >::GetValueAndDerivative(), itk::MattesMutualInformationImageToImageMetric< TFixedImage, TMovingImage >::GetValueAndDerivative(), itk::SPSAOptimizer::GuessParameters(), itk::Statistics::ChiSquareDistribution::InverseCDF(), itk::Statistics::TDistribution::InverseCDF(), itk::Statistics::GaussianDistribution::InverseCDF(), itk::OptimizerParametersHelper< TValueType >::MoveDataPointer(), itk::Array< TValueType >::operator=(), itk::Statistics::ChiSquareDistribution::PDF(), itk::Statistics::TDistribution::PDF(), itk::Statistics::GaussianDistribution::PDF(), itk::ParticleSwarmOptimizerBase::RandomInitialization(), otb::MRFOptimizer::SetParameters(), itk::Statistics::ProbabilityDistribution::SetParameters(), itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::SetPatchWeights(), itk::SingleValuedVnlCostFunctionAdaptor::SetScales(), and itk::MultipleValuedVnlCostFunctionAdaptor::SetScales().

template<typename TValueType >
const Array< TValueType >::Self & itk::Array< TValueType >::operator= ( const Self rhs)

Copy opertor

Definition at line 152 of file itkArray.hxx.

References itk::Array< TValueType >::GetSize().

template<typename TValueType >
const Array< TValueType >::Self & itk::Array< TValueType >::operator= ( const VnlVectorType rhs)

Definition at line 173 of file itkArray.hxx.

template<typename TValueType>
void itk::Array< TValueType >::SetData ( TValueType *  datain,
bool  LetArrayManageMemory = false 
)

Set the pointer from which the data is imported. If "LetArrayManageMemory" is false, then the application retains the responsibility of freeing the memory for this data. If "LetArrayManageMemory" is true, then this class will free the memory when this object is destroyed.

Definition at line 93 of file itkArray.hxx.

Referenced by itk::SingleValuedVnlCostFunctionAdaptor::compute(), itk::MultipleValuedVnlCostFunctionAdaptor::compute(), itk::SingleValuedVnlCostFunctionAdaptor::f(), itk::MultipleValuedVnlCostFunctionAdaptor::f(), itk::SingleValuedVnlCostFunctionAdaptor::gradf(), itk::MultipleValuedVnlCostFunctionAdaptor::gradf(), itk::OptimizerParametersHelper< TValueType >::MoveDataPointer(), and itk::ImageVectorOptimizerParametersHelper< TValueType, NVectorDimension, VImageDimension >::SetParametersObject().

template<typename TValueType>
void itk::Array< TValueType >::SetData ( TValueType *  datain,
SizeValueType  sz,
bool  LetArrayManageMemory = false 
)

Similar to the previous method. In the above method, the size must be separately set prior to using user-supplied data. This introduces an unnecessary allocation step to be performed. This method avoids it and should be used to import data wherever possible to avoid this. Set the pointer from which the data is imported. If "LetArrayManageMemory" is false, then the application retains the responsibility of freeing the memory for this data. If "LetArrayManageMemory" is true, then this class will free the memory when this object is destroyed.

Definition at line 115 of file itkArray.hxx.

template<typename TValueType>
void itk::Array< TValueType >::SetElement ( SizeValueType  i,
const TValueType &  value 
)
inline
template<typename TValueType >
void itk::Array< TValueType >::SetSize ( SizeValueType  sz)

Destructively set the size to that given. Will lose data.

Definition at line 128 of file itkArray.hxx.

Referenced by itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::AfterThreadedGenerateData(), itk::Array< PixelType >::Array(), itk::HistogramMatchingImageFilter< TInputImage, TOutputImage, THistogramMeasurement >::ConstructHistogram(), itk::DisplacementFieldTransform< TScalar, NDimensions >::DisplacementFieldTransform(), itk::Statistics::SquaredDifferenceErrorFunction< TMeasurementVector, ScalarType >::EvaluateDerivative(), itk::CumulativeGaussianOptimizer::FindParametersOfGaussian(), itk::Statistics::RBFLayer< TMeasurementVector, TTargetVector >::ForwardPropagate(), itk::Statistics::SampleClassifierFilter< TSample >::GenerateData(), itk::Statistics::ImageClassifierFilter< TSample, TInputImage, TOutputImage >::GenerateData(), itk::Statistics::MultilayerNeuralNetworkBase< TMeasurementVector, TTargetVector, TLearningLayer >::GenerateOutput(), otb::SVMCrossValidationCostFunction< TModel >::GetDerivative(), itk::TranslationTransform< TScalar, NDimensions >::GetFixedParameters(), itk::Statistics::Histogram< TMeasurement, TFrequencyContainer >::GetIndex(), itk::ExpectationBasedPointSetToPointSetMetricv4< TFixedPointSet, TMovingPointSet >::GetLocalNeighborhoodValueAndDerivative(), itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::GetMedian(), itk::Statistics::ExpectationMaximizationMixtureModelEstimator< TSample >::GetMembershipFunctionsWeightsArray(), itk::Statistics::KdTreeBasedKmeansEstimator< TKdTree >::GetOutput(), itk::CellInterface< TPixelType, TCellTraits >::GetPointIdsContainer(), itk::LevenbergMarquardtOptimizer::GetValue(), itk::CumulativeGaussianCostFunction::GetValuePointer(), itk::Statistics::Histogram< TMeasurement, TFrequencyContainer >::Initialize(), itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::Initialize(), itk::PatchBasedDenoisingBaseImageFilter< TInputImage, TOutputImage >::InitializePatchWeights(), itk::PatchBasedDenoisingImageFilter< TInputImage, TOutputImage >::InitializePatchWeights(), itk::ImageRegistrationMethodv4< TFixedImage, TMovingImage, TOutputTransform, TVirtualImage >::InitializeRegistrationAtEachLevel(), itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::LabelStatistics::LabelStatistics(), otb::LabelToProSailParameters< TLabel >::LabelToProSailParameters(), itk::ImageToImageMetric< TFixedImage, TMovingImage >::MultiThreadingInitialize(), itk::NumericTraits< Array< T > >::SetLength(), itk::ImageRegistrationMethodv4< TFixedImage, TMovingImage, TOutputTransform, TVirtualImage >::SetMetricSamplingPercentage(), itk::Statistics::ScalarImageToHistogramGenerator< TImageType >::SetNumberOfBins(), otb::Statistics::GaussianModelComponent< TSample >::SetParameters(), itk::Optimizer::SetScales(), and itk::CumulativeGaussianOptimizer::StartOptimization().

template<typename TValueType>
SizeValueType itk::Array< TValueType >::Size ( void  ) const
inline

Return the number of elements in the Array

Definition at line 114 of file itkArray.h.

Referenced by itk::Statistics::MeasurementVectorTraits::Assert(), itk::Statistics::KdTreeBasedKmeansEstimator< TKdTree >::Filter(), itk::Statistics::SampleClassifierFilter< TSample >::GenerateData(), itk::Statistics::ImageClassifierFilter< TSample, TInputImage, TOutputImage >::GenerateData(), itk::Statistics::MultilayerNeuralNetworkBase< TMeasurementVector, TTargetVector, TLearningLayer >::GenerateOutput(), itk::Statistics::Histogram< TMeasurement, TFrequencyContainer >::GetIndex(), otb::SailModel::GetInput(), itk::NumericTraits< Array< T > >::itkLegacyMacro(), itk::NumericTraits< Array< T > >::max(), itk::NumericTraits< Array< T > >::min(), itk::NumericTraits< Array< T > >::NonpositiveMin(), itk::NumericTraits< Array< T > >::OneValue(), itk::AutomaticTopologyMeshSource< TOutputMesh >::IdentifierArrayHashFunction::operator()(), itk::AutomaticTopologyMeshSource< TOutputMesh >::IdentifierArrayEqualsFunction::operator()(), itk::VariableSizeMatrix< T >::operator*(), otb::OverlapSaveConvolutionImageFilter< TInputImage, TOutputImage, TBoundaryCondition >::SetFilter(), otb::ConvolutionImageFilter< TInputImage, TOutputImage, TBoundaryCondition, TFilterPrecision >::SetFilter(), itk::VelocityFieldTransform< TScalar, NDimensions >::SetFixedParameters(), itk::ConstantVelocityFieldTransform< TScalar, NDimensions >::SetFixedParameters(), itk::DisplacementFieldTransform< TScalar, NDimensions >::SetFixedParameters(), otb::ProspectModel::SetInput(), otb::SailModel::SetInput(), itk::Statistics::DistanceMetric< TVector >::SetOrigin(), otb::MRFEnergy< TInput1, TInput2 >::SetParameters(), otb::MRFEnergy< TInput2, TInput2 >::SetParameters(), itk::DisplacementFieldTransform< TScalar, NDimensions >::SetParameters(), itk::CellInterface< TPixelType, TCellTraits >::SetPointIdsContainer(), itk::ImageRegistrationMethodv4< TFixedImage, TMovingImage, TOutputTransform >::SetShrinkFactorsPerLevel(), SimpleMultiResolutionImageRegistrationUI2< TRegistration >::StartNewLevel(), itk::LBFGSBOptimizer::StartOptimization(), itk::Transform< TScalar, NInputDimensions, NOutputDimensions >::UpdateTransformParameters(), itk::ParticleSwarmOptimizerBase::ValidateSettings(), and itk::NumericTraits< Array< T > >::ZeroValue().

Member Data Documentation

template<typename TValueType>
bool itk::Array< TValueType >::m_LetArrayManageMemory
private

Definition at line 162 of file itkArray.h.

Referenced by itk::Array< PixelType >::Array().


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

Generated at Sat Mar 8 2014 16:34:45 for Orfeo Toolbox with doxygen 1.8.3.1