ITK
5.2.0
Insight Toolkit
|
#include <itkArray.h>
Public Types | |
using | Self = Array |
using | SizeValueType = typename vnl_vector< TValue >::size_type |
using | ValueType = TValue |
using | VnlVectorType = vnl_vector< TValue > |
Public Member Functions | |
Array () | |
Array (const Array &) | |
Array (const ValueType *datain, SizeValueType sz) | |
Array (const VnlVectorType &) | |
Array (SizeValueType dimension) | |
Array (SizeValueType dimension, const ValueType &value) | |
Array (ValueType *datain, SizeValueType sz, bool LetArrayManageMemory=false) | |
bool | m_LetArrayManageMemory |
template<typename TArrayValue > | |
Array (const Array< TArrayValue > &r) | |
void | Fill (TValue const &v) |
const Self & | operator= (const Self &rhs) |
const Self & | operator= (const VnlVectorType &rhs) |
SizeValueType | Size () const |
unsigned int | GetNumberOfElements () const |
const TValue & | GetElement (SizeValueType i) const |
void | SetElement (SizeValueType i, const TValue &value) |
void | SetSize (SizeValueType sz) |
SizeValueType | GetSize () const |
void | SetDataSameSize (TValue *datain, bool LetArrayManageMemory=false) |
void | SetData (TValue *datain, SizeValueType sz, bool LetArrayManageMemory=false) |
~Array () override | |
void | Swap (Array &other) |
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 47 of file itkArray.h.
using itk::Array< TValue >::Self = Array |
Definition at line 53 of file itkArray.h.
using itk::Array< TValue >::SizeValueType = typename vnl_vector<TValue>::size_type |
Definition at line 55 of file itkArray.h.
using itk::Array< TValue >::ValueType = TValue |
The element type stored at each location in the Array.
Definition at line 52 of file itkArray.h.
using itk::Array< TValue >::VnlVectorType = vnl_vector<TValue> |
Definition at line 54 of file itkArray.h.
itk::Array< TValue >::Array | ( | ) |
Default constructor. It is created with an empty array it has to be allocated later by assignment
itk::Array< TValue >::Array | ( | const Array< TValue > & | ) |
Copy constructor. Uses VNL copy constructor with correct setting for memory management.
|
explicit |
Construct from a VnlVectorType
|
explicit |
Constructor with size. Size can only be changed by assignment.
|
explicit |
Constructor with size and initial value for each element.
itk::Array< TValue >::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.
itk::Array< TValue >::Array | ( | const ValueType * | datain, |
SizeValueType | sz | ||
) |
Constructor that initializes array with contents from a user supplied const buffer. The pointer to the buffer and the length is specified. By default, the array does a deep copy of the const pointer data, so the array class also manages memory.
|
inline |
Constructor to initialize an array from another of any data type
Definition at line 104 of file itkArray.h.
|
override |
This destructor is not virtual for performance reasons. However, this means that subclasses cannot allocate memory.
|
inline |
Set the all the elements of the array to the specified value
Definition at line 117 of file itkArray.h.
Referenced by itk::MatchCardinalityImageToImageMetric< TFixedImage, TMovingImage >::GetDerivative(), itk::NumericTraits< Array< T > >::max(), itk::NumericTraits< Array< T > >::min(), itk::NumericTraits< Array< T > >::NonpositiveMin(), itk::NumericTraits< Array< T > >::OneValue(), itk::NumericTraits< Array< T > >::SetLength(), and itk::NumericTraits< Array< T > >::ZeroValue().
|
inline |
Get one element
Definition at line 144 of file itkArray.h.
|
inline |
Constructor to initialize an array from another of any data type
Definition at line 136 of file itkArray.h.
|
inline |
Constructor to initialize an array from another of any data type
Definition at line 161 of file itkArray.h.
Referenced by itk::Array< AccumulateType >::Array(), itk::NumericTraits< Array< T > >::GetLength(), itk::OptimizerParametersHelper< TValue >::MoveDataPointer(), and itk::MetaArrayWriter::SetMultiChannelInput().
const Self& itk::Array< TValue >::operator= | ( | const Self & | rhs | ) |
Copy operator
const Self& itk::Array< TValue >::operator= | ( | const VnlVectorType & | rhs | ) |
Constructor to initialize an array from another of any data type
void itk::Array< TValue >::SetData | ( | TValue * | 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.
Referenced by itk::MetaArrayReader::GetOutput(), and itk::OptimizerParametersHelper< TValue >::MoveDataPointer().
void itk::Array< TValue >::SetDataSameSize | ( | TValue * | 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. NOTE: This signature requires that internal array is being replaced by data array of exactly the same size
|
inline |
Set one element
Definition at line 151 of file itkArray.h.
void itk::Array< TValue >::SetSize | ( | SizeValueType | sz | ) |
Destructively set the size to that given. Will lose data.
Referenced by itk::TranslationTransform< TParametersValueType, NDimensions >::GetFixedParameters(), itk::MetaArrayReader::GetMultiChannelOutput(), itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::LabelStatistics::LabelStatistics(), and itk::NumericTraits< Array< T > >::SetLength().
|
inline |
Return the number of elements in the Array
Definition at line 131 of file itkArray.h.
Referenced by itk::Statistics::MeasurementVectorTraits::Assert(), 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::MetaArrayWriter::SetInput(), itk::DisplacementFieldTransform< TParametersValueType, NDimensions >::SetParameters(), itk::MeshIOBase::SetPixelType(), itk::ImageRegistrationMethodv4< TFixedImage, TMovingImage, TOutputTransform, TVirtualImage, TPointSet >::SetShrinkFactorsPerLevel(), SimpleMultiResolutionImageRegistrationUI2< TRegistration >::StartNewLevel(), and itk::NumericTraits< Array< T > >::ZeroValue().
|
inline |
Constructor to initialize an array from another of any data type
Definition at line 205 of file itkArray.h.
Referenced by itk::swap().
|
private |
Constructor to initialize an array from another of any data type
Definition at line 213 of file itkArray.h.
Referenced by itk::Array< AccumulateType >::Swap().