#include <itkVectorDataContainer.h>
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
This is a full-fleged Object, so there is modification time, debug, and reference count information.
Template parameters for VectorDataContainer:
TElementIdentifier = An INTEGRAL type for use in indexing the vector.
TElement = The element type stored in the container.
CHANGES: This class is a modification of the itk::VectorContainer. It now inherits from itk::DataObject instead of itk::Object. This way it is easy to use in an itk::ProcessObject (a filter).
Definition at line 73 of file itkVectorDataContainer.h.
Public Types | |
using | ConstIterator = typename VectorContainer<TElementIdentifier, TElement>::ConstIterator |
using | ConstPointer = SmartPointer<const Self> |
using | Element = TElement |
using | ElementIdentifier = TElementIdentifier |
using | Iterator = typename VectorContainer<TElementIdentifier, TElement>::Iterator |
using | Pointer = SmartPointer<Self> |
using | Self = VectorDataContainer |
using | STLContainerType = VectorType |
using | Superclass = DataObject |
Public Member Functions | |
Iterator | Begin () |
ConstIterator | Begin () const |
const STLContainerType & | CastToSTLConstContainer () const |
STLContainerType & | CastToSTLContainer () |
Element & | CreateElementAt (ElementIdentifier) |
void | CreateIndex (ElementIdentifier) |
void | DeleteIndex (ElementIdentifier) |
Element & | ElementAt (ElementIdentifier) |
const Element & | ElementAt (ElementIdentifier) const |
Iterator | End () |
ConstIterator | End () const |
virtual const char * | GetClassName () const |
Element | GetElement (ElementIdentifier) const |
bool | GetElementIfIndexExists (ElementIdentifier, Element *) const |
bool | IndexExists (ElementIdentifier) const |
void | Initialize () override |
void | InsertElement (ElementIdentifier, Element) |
void | Reserve (ElementIdentifier) |
void | SetElement (ElementIdentifier, Element) |
unsigned long | Size () const |
void | Squeeze () |
Static Public Member Functions | |
static Pointer | New () |
Protected Member Functions | |
VectorDataContainer () | |
VectorDataContainer (const Self &r) | |
template<typename InputIterator > | |
VectorDataContainer (InputIterator first, InputIterator last) | |
VectorDataContainer (size_type n) | |
VectorDataContainer (size_type n, const Element &x) | |
Private Types | |
using | size_type = typename VectorType::size_type |
using | VectorConstIterator = typename VectorType::const_iterator |
using | VectorIterator = typename VectorType::iterator |
using | VectorType = std::vector<Element> |
using itk::VectorDataContainer< TElementIdentifier, TElement >::ConstIterator = typename VectorContainer<TElementIdentifier, TElement>::ConstIterator |
Definition at line 193 of file itkVectorDataContainer.h.
using itk::VectorDataContainer< TElementIdentifier, TElement >::ConstPointer = SmartPointer<const Self> |
Definition at line 82 of file itkVectorDataContainer.h.
using itk::VectorDataContainer< TElementIdentifier, TElement >::Element = TElement |
Definition at line 86 of file itkVectorDataContainer.h.
using itk::VectorDataContainer< TElementIdentifier, TElement >::ElementIdentifier = TElementIdentifier |
Save the template parameters.
Definition at line 85 of file itkVectorDataContainer.h.
using itk::VectorDataContainer< TElementIdentifier, TElement >::Iterator = typename VectorContainer<TElementIdentifier, TElement>::Iterator |
Definition at line 192 of file itkVectorDataContainer.h.
using itk::VectorDataContainer< TElementIdentifier, TElement >::Pointer = SmartPointer<Self> |
Definition at line 81 of file itkVectorDataContainer.h.
using itk::VectorDataContainer< TElementIdentifier, TElement >::Self = VectorDataContainer |
Standard class typedefs.
Definition at line 79 of file itkVectorDataContainer.h.
|
private |
Definition at line 91 of file itkVectorDataContainer.h.
using itk::VectorDataContainer< TElementIdentifier, TElement >::STLContainerType = VectorType |
This type is provided to Adapt this container as an STL container
Definition at line 123 of file itkVectorDataContainer.h.
using itk::VectorDataContainer< TElementIdentifier, TElement >::Superclass = DataObject |
Definition at line 80 of file itkVectorDataContainer.h.
|
private |
Definition at line 93 of file itkVectorDataContainer.h.
|
private |
Definition at line 92 of file itkVectorDataContainer.h.
|
private |
Quick access to the STL vector type that was inherited.
Definition at line 90 of file itkVectorDataContainer.h.
|
inlineprotected |
Provide pass-through constructors corresponding to all the STL vector constructors. These are for internal use only since this is also an Object which must be constructed through the "New()" routine.
Definition at line 99 of file itkVectorDataContainer.h.
|
inlineexplicitprotected |
Definition at line 103 of file itkVectorDataContainer.h.
|
inlineprotected |
Definition at line 107 of file itkVectorDataContainer.h.
|
inlineprotected |
Definition at line 111 of file itkVectorDataContainer.h.
|
inlineprotected |
Definition at line 116 of file itkVectorDataContainer.h.
Iterator itk::VectorDataContainer< TElementIdentifier, TElement >::Begin | ( | ) |
Get a begin iterator for the vector.
ConstIterator itk::VectorDataContainer< TElementIdentifier, TElement >::Begin | ( | ) | const |
Get a begin const iterator for the vector.
|
inline |
Cast the container to a const STL container type
Definition at line 141 of file itkVectorDataContainer.h.
|
inline |
Cast the container to a STL container type
Definition at line 133 of file itkVectorDataContainer.h.
Element & itk::VectorDataContainer< TElementIdentifier, TElement >::CreateElementAt | ( | ElementIdentifier | ) |
Get a reference to the element at the given index. If the element location does not exist, it will be created with a default element value.
It is assumed that the value of the element is modified through the reference.
void itk::VectorDataContainer< TElementIdentifier, TElement >::CreateIndex | ( | ElementIdentifier | ) |
Make sure that the index range of the vector is large enough to allow the given index, expanding it if necessary. The index will contain the default element regardless of whether expansion occurred.
void itk::VectorDataContainer< TElementIdentifier, TElement >::DeleteIndex | ( | ElementIdentifier | ) |
Delete the element defined by the index identifier. In practice, it doesn't make sense to delete a vector index. Instead, this method just overwrite the index with the default element.
Element & itk::VectorDataContainer< TElementIdentifier, TElement >::ElementAt | ( | ElementIdentifier | ) |
Get a reference to the element at the given index. It is assumed that the index exists, and it will not automatically be created.
It is assumed that the value of the element is modified through the reference.
const Element & itk::VectorDataContainer< TElementIdentifier, TElement >::ElementAt | ( | ElementIdentifier | ) | const |
Get a reference to the element at the given index. It is assumed that the index exists, and it will not automatically be created.
Iterator itk::VectorDataContainer< TElementIdentifier, TElement >::End | ( | ) |
Get an end iterator for the vector.
ConstIterator itk::VectorDataContainer< TElementIdentifier, TElement >::End | ( | ) | const |
Get an end const iterator for the vector.
|
virtual |
Standard part of every itk Object.
Element itk::VectorDataContainer< TElementIdentifier, TElement >::GetElement | ( | ElementIdentifier | ) | const |
Read the element from the given index. It is assumed that the index exists.
bool itk::VectorDataContainer< TElementIdentifier, TElement >::GetElementIfIndexExists | ( | ElementIdentifier | , |
Element * | ) const |
Check if the given index is in range of the vector. If it is not, return false. Otherwise, set the element through the pointer (if it isn't NULL), and return true.
bool itk::VectorDataContainer< TElementIdentifier, TElement >::IndexExists | ( | ElementIdentifier | ) | const |
Check if the index range of the vector is large enough to allow the given index without expansion.
|
override |
Clear the elements. The final size will be zero.
void itk::VectorDataContainer< TElementIdentifier, TElement >::InsertElement | ( | ElementIdentifier | , |
Element | ) |
Set the element value at the given index. If the element location does not exist, it will be created with a default element value.
|
static |
Method for creation through the object factory.
void itk::VectorDataContainer< TElementIdentifier, TElement >::Reserve | ( | ElementIdentifier | ) |
Tell the container to allocate enough memory to allow at least as many elements as the size given to be stored. In the generic case of ITK containers this is NOT guaranteed to actually allocate any memory, but it is useful if the implementation of the container allocates contiguous storage. In the particular implementation of this VectorDataContainer the call to this method actually allocates memory for the number of elements defined by ElementIdentifier.
void itk::VectorDataContainer< TElementIdentifier, TElement >::SetElement | ( | ElementIdentifier | , |
Element | ) |
Set the element value at the given index. It is assumed that the index exists.
unsigned long itk::VectorDataContainer< TElementIdentifier, TElement >::Size | ( | ) | const |
Get the number of elements currently stored in the vector.
void itk::VectorDataContainer< TElementIdentifier, TElement >::Squeeze | ( | ) |
Tell the container to try to minimize its memory usage for storage of the current number of elements. This is NOT guaranteed to decrease memory usage. This method is included here mainly for providing a unified API with other containers in the toolkit.
Generated on 2024-07-17 for elastix by 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) |