go home Home | Main Page | Topics | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itk::VectorDataContainer< TElement > Class Template Reference

#include <itkVectorDataContainer.h>

Detailed Description

template<typename TElement>
class itk::VectorDataContainer< TElement >

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 parameter for VectorDataContainer:

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 70 of file itkVectorDataContainer.h.

Inheritance diagram for itk::VectorDataContainer< TElement >:

Public Types

using ConstIterator = typename VectorContainer<ElementIdentifier, TElement>::ConstIterator
using ConstPointer = SmartPointer<const Self>
using Element = TElement
using ElementIdentifier = SizeValueType
using Iterator = typename VectorContainer<ElementIdentifier, TElement>::Iterator
using Pointer = SmartPointer<Self>
using Self = VectorDataContainer
using STLContainerType = VectorType
using Superclass = DataObject

Public Member Functions

Iterator Begin ()
ConstIterator Begin () const
const STLContainerTypeCastToSTLConstContainer () const
STLContainerTypeCastToSTLContainer ()
ElementCreateElementAt (ElementIdentifier)
void CreateIndex (ElementIdentifier)
void DeleteIndex (ElementIdentifier)
ElementElementAt (ElementIdentifier)
const ElementElementAt (ElementIdentifier) const
Iterator End ()
ConstIterator End () const
Element GetElement (ElementIdentifier) const
bool GetElementIfIndexExists (ElementIdentifier, Element *) const
bool IndexExists (ElementIdentifier) const
void Initialize () override
void InsertElement (ElementIdentifier, Element)
 itkOverrideGetNameOfClassMacro (VectorDataContainer)
void Reserve (ElementIdentifier)
void SetElement (ElementIdentifier, Element)
SizeValueType 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>

Member Typedef Documentation

◆ ConstIterator

template<typename TElement>
using itk::VectorDataContainer< TElement >::ConstIterator = typename VectorContainer<ElementIdentifier, TElement>::ConstIterator

Definition at line 190 of file itkVectorDataContainer.h.

◆ ConstPointer

template<typename TElement>
using itk::VectorDataContainer< TElement >::ConstPointer = SmartPointer<const Self>

Definition at line 79 of file itkVectorDataContainer.h.

◆ Element

template<typename TElement>
using itk::VectorDataContainer< TElement >::Element = TElement

Definition at line 83 of file itkVectorDataContainer.h.

◆ ElementIdentifier

template<typename TElement>
using itk::VectorDataContainer< TElement >::ElementIdentifier = SizeValueType

Save the template parameters.

Definition at line 82 of file itkVectorDataContainer.h.

◆ Iterator

template<typename TElement>
using itk::VectorDataContainer< TElement >::Iterator = typename VectorContainer<ElementIdentifier, TElement>::Iterator

Definition at line 189 of file itkVectorDataContainer.h.

◆ Pointer

template<typename TElement>
using itk::VectorDataContainer< TElement >::Pointer = SmartPointer<Self>

Definition at line 78 of file itkVectorDataContainer.h.

◆ Self

template<typename TElement>
using itk::VectorDataContainer< TElement >::Self = VectorDataContainer

Standard class typedefs.

Definition at line 76 of file itkVectorDataContainer.h.

◆ size_type

template<typename TElement>
using itk::VectorDataContainer< TElement >::size_type = typename VectorType::size_type
private

Definition at line 88 of file itkVectorDataContainer.h.

◆ STLContainerType

template<typename TElement>
using itk::VectorDataContainer< TElement >::STLContainerType = VectorType

This type is provided to Adapt this container as an STL container

Definition at line 120 of file itkVectorDataContainer.h.

◆ Superclass

template<typename TElement>
using itk::VectorDataContainer< TElement >::Superclass = DataObject

Definition at line 77 of file itkVectorDataContainer.h.

◆ VectorConstIterator

template<typename TElement>
using itk::VectorDataContainer< TElement >::VectorConstIterator = typename VectorType::const_iterator
private

Definition at line 90 of file itkVectorDataContainer.h.

◆ VectorIterator

template<typename TElement>
using itk::VectorDataContainer< TElement >::VectorIterator = typename VectorType::iterator
private

Definition at line 89 of file itkVectorDataContainer.h.

◆ VectorType

template<typename TElement>
using itk::VectorDataContainer< TElement >::VectorType = std::vector<Element>
private

Quick access to the STL vector type that was inherited.

Definition at line 87 of file itkVectorDataContainer.h.

Constructor & Destructor Documentation

◆ VectorDataContainer() [1/5]

template<typename TElement>
itk::VectorDataContainer< TElement >::VectorDataContainer ( )
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 96 of file itkVectorDataContainer.h.

◆ VectorDataContainer() [2/5]

template<typename TElement>
itk::VectorDataContainer< TElement >::VectorDataContainer ( size_type n)
inlineexplicitprotected

Definition at line 100 of file itkVectorDataContainer.h.

◆ VectorDataContainer() [3/5]

template<typename TElement>
itk::VectorDataContainer< TElement >::VectorDataContainer ( size_type n,
const Element & x )
inlineprotected

Definition at line 104 of file itkVectorDataContainer.h.

◆ VectorDataContainer() [4/5]

template<typename TElement>
itk::VectorDataContainer< TElement >::VectorDataContainer ( const Self & r)
inlineprotected

Definition at line 108 of file itkVectorDataContainer.h.

◆ VectorDataContainer() [5/5]

template<typename TElement>
template<typename InputIterator>
itk::VectorDataContainer< TElement >::VectorDataContainer ( InputIterator first,
InputIterator last )
inlineprotected

Definition at line 113 of file itkVectorDataContainer.h.

Member Function Documentation

◆ Begin() [1/2]

template<typename TElement>
Iterator itk::VectorDataContainer< TElement >::Begin ( )

Get a begin iterator for the vector.

◆ Begin() [2/2]

template<typename TElement>
ConstIterator itk::VectorDataContainer< TElement >::Begin ( ) const

Get a begin const iterator for the vector.

◆ CastToSTLConstContainer()

template<typename TElement>
const STLContainerType & itk::VectorDataContainer< TElement >::CastToSTLConstContainer ( ) const
inline

Cast the container to a const STL container type

Definition at line 138 of file itkVectorDataContainer.h.

◆ CastToSTLContainer()

template<typename TElement>
STLContainerType & itk::VectorDataContainer< TElement >::CastToSTLContainer ( )
inline

Cast the container to a STL container type

Definition at line 130 of file itkVectorDataContainer.h.

◆ CreateElementAt()

template<typename TElement>
Element & itk::VectorDataContainer< 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.

◆ CreateIndex()

template<typename TElement>
void itk::VectorDataContainer< 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.

◆ DeleteIndex()

template<typename TElement>
void itk::VectorDataContainer< 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.

◆ ElementAt() [1/2]

template<typename TElement>
Element & itk::VectorDataContainer< 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.

◆ ElementAt() [2/2]

template<typename TElement>
const Element & itk::VectorDataContainer< 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.

◆ End() [1/2]

template<typename TElement>
Iterator itk::VectorDataContainer< TElement >::End ( )

Get an end iterator for the vector.

◆ End() [2/2]

template<typename TElement>
ConstIterator itk::VectorDataContainer< TElement >::End ( ) const

Get an end const iterator for the vector.

◆ GetElement()

template<typename TElement>
Element itk::VectorDataContainer< TElement >::GetElement ( ElementIdentifier ) const

Read the element from the given index. It is assumed that the index exists.

◆ GetElementIfIndexExists()

template<typename TElement>
bool itk::VectorDataContainer< 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.

◆ IndexExists()

template<typename TElement>
bool itk::VectorDataContainer< TElement >::IndexExists ( ElementIdentifier ) const

Check if the index range of the vector is large enough to allow the given index without expansion.

◆ Initialize()

template<typename TElement>
void itk::VectorDataContainer< TElement >::Initialize ( )
override

Clear the elements. The final size will be zero.

◆ InsertElement()

template<typename TElement>
void itk::VectorDataContainer< 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.

◆ itkOverrideGetNameOfClassMacro()

template<typename TElement>
itk::VectorDataContainer< TElement >::itkOverrideGetNameOfClassMacro ( VectorDataContainer< TElement > )

Standard part of every itk Object.

◆ New()

template<typename TElement>
Pointer itk::VectorDataContainer< TElement >::New ( )
static

Method for creation through the object factory.

◆ Reserve()

template<typename TElement>
void itk::VectorDataContainer< 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.

◆ SetElement()

template<typename TElement>
void itk::VectorDataContainer< TElement >::SetElement ( ElementIdentifier ,
Element  )

Set the element value at the given index. It is assumed that the index exists.

◆ Size()

template<typename TElement>
SizeValueType itk::VectorDataContainer< TElement >::Size ( ) const

Get the number of elements currently stored in the vector.

◆ Squeeze()

template<typename TElement>
void itk::VectorDataContainer< 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 26-02-2026 for elastix by doxygen 1.16.1 (669aeeefca743c148e2d935b3d3c69535c7491e6) elastix logo