ITK
5.0.0
Insight Segmentation and Registration Toolkit
|
#include <itkVector.h>
A templated class holding a n-Dimensional vector.
Vector is a templated class that holds a single vector (i.e., an array of values). Vector can be used as the data type held at each pixel in an Image or at each vertex of an Mesh. The template parameter T can be any data type that behaves like a primitive (or atomic) data type (int, short, float, complex). The NVectorDimension defines the number of components in the vector array.
Vector is not a dynamically extendible array like std::vector. It is intended to be used like a mathematical vector.
If you wish a simpler pixel types, you can use Scalar, which represents a single data value at a pixel. There is also the more complex type ScalarVector, which supports (for a given pixel) a single scalar value plus an array of vector values. (The scalar and vectors can be of different data type.)
Definition at line 62 of file itkVector.h.
Public Types | |
using | BaseArray = FixedArray< T, NVectorDimension > |
using | ComponentType = T |
using | RealValueType = typename NumericTraits< ValueType >::RealType |
using | Self = Vector |
using | Superclass = FixedArray< T, NVectorDimension > |
using | ValueType = T |
using | VectorType = Self |
Public Types inherited from itk::FixedArray< T, NVectorDimension > | |
typedef ValueType | CArray [VLength] |
using | const_pointer = const ValueType * |
using | const_reference = const ValueType & |
using | ConstIterator = const ValueType * |
using | Iterator = ValueType * |
using | pointer = ValueType * |
using | reference = ValueType & |
using | SizeType = unsigned int |
using | ValueType = T |
Public Member Functions | |
RealValueType | GetNorm () const |
RealValueType | GetSquaredNorm () const |
vnl_vector_ref< T > | GetVnlVector () |
vnl_vector< T > | GetVnlVector () const |
RealValueType | Normalize () |
template<typename TCoordRepB > | |
operator Vector< TCoordRepB, NVectorDimension > () | |
ValueType | operator* (const Self &vec) const |
Self | operator* (const ValueType &value) const |
Self | operator+ (const Self &vec) const |
const Self & | operator+= (const Self &vec) |
Self | operator- () const |
Self | operator- (const Self &vec) const |
const Self & | operator-= (const Self &vec) |
template<typename Tt > | |
Self | operator/ (const Tt &value) const |
Vector & | operator= (const ValueType r[NVectorDimension]) |
void | SetNthComponent (int c, const ComponentType &v) |
void | SetVnlVector (const vnl_vector< T > &) |
Vector (const ValueType &r) | |
Vector ()=default | |
Vector (const Vector &)=default | |
Vector (Vector &&)=default | |
Vector & | operator= (const Vector &)=default |
Vector & | operator= (Vector &&)=default |
~Vector ()=default | |
template<typename TVectorValueType > | |
Vector (const Vector< TVectorValueType, NVectorDimension > &r) | |
Vector (const ValueType r[Dimension]) | |
template<typename TVectorValueType > | |
Vector & | operator= (const Vector< TVectorValueType, NVectorDimension > &r) |
template<typename Tt > | |
const Self & | operator*= (const Tt &value) |
template<typename Tt > | |
const Self & | operator/= (const Tt &value) |
bool | operator== (const Self &v) const |
bool | operator!= (const Self &v) const |
template<typename TCoordRepB > | |
void | CastFrom (const Vector< TCoordRepB, NVectorDimension > &pa) |
Public Member Functions inherited from itk::FixedArray< T, NVectorDimension > | |
Iterator | Begin () |
ConstIterator | Begin () const |
Iterator | End () |
ConstIterator | End () const |
void | Fill (const ValueType &) |
FixedArray (const TScalarValue *r) | |
ValueType * | GetDataPointer () |
const ValueType * | GetDataPointer () const |
bool | operator!= (const FixedArray &r) const |
FixedArray & | operator= (const ValueType r[VLength]) |
bool | operator== (const FixedArray &r) const |
ReverseIterator | rBegin () |
ConstReverseIterator | rBegin () const |
ReverseIterator | rEnd () |
ConstReverseIterator | rEnd () const |
SizeType | Size () const |
void | swap (FixedArray &other) |
FixedArray ()=default | |
FixedArray (const FixedArray &)=default | |
FixedArray (FixedArray &&)=default | |
FixedArray & | operator= (const FixedArray &)=default |
FixedArray & | operator= (FixedArray &&)=default |
~FixedArray ()=default | |
FixedArray (const ValueType r[VLength]) | |
FixedArray (const ValueType &) | |
FixedArray (const FixedArray< TFixedArrayValueType, VLength > &r) | |
FixedArray & | operator= (const FixedArray< TFixedArrayValueType, VLength > &r) |
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 |
void | SetElement (unsigned short index, const_reference value) |
const_reference | GetElement (unsigned short index) const |
Static Public Member Functions | |
static unsigned int | GetNumberOfComponents () |
static unsigned int | GetVectorDimension () |
Static Public Member Functions inherited from itk::FixedArray< T, NVectorDimension > | |
static FixedArray | Filled (const ValueType &) |
Static Public Attributes | |
static constexpr unsigned int | Dimension = NVectorDimension |
Static Public Attributes inherited from itk::FixedArray< T, NVectorDimension > | |
static constexpr unsigned int | Dimension |
static constexpr unsigned int | Length |
using itk::Vector< T, NVectorDimension >::BaseArray = FixedArray< T, NVectorDimension > |
The Array type from which this vector is derived.
Definition at line 84 of file itkVector.h.
using itk::Vector< T, NVectorDimension >::ComponentType = T |
Component value type
Definition at line 81 of file itkVector.h.
using itk::Vector< T, NVectorDimension >::RealValueType = typename NumericTraits< ValueType >::RealType |
Definition at line 72 of file itkVector.h.
using itk::Vector< T, NVectorDimension >::Self = Vector |
Standard class type aliases.
Definition at line 66 of file itkVector.h.
using itk::Vector< T, NVectorDimension >::Superclass = FixedArray< T, NVectorDimension > |
Definition at line 67 of file itkVector.h.
using itk::Vector< T, NVectorDimension >::ValueType = T |
ValueType can be used to declare a variable that is the same type as a data element held in an Vector.
Definition at line 71 of file itkVector.h.
using itk::Vector< T, NVectorDimension >::VectorType = Self |
I am a vector type.
Definition at line 78 of file itkVector.h.
|
default |
Default constructors, assignments and destructor
|
default |
Default constructors, assignments and destructor
|
default |
Default constructors, assignments and destructor
|
default |
Default constructors, assignments and destructor
itk::Vector< T, NVectorDimension >::Vector | ( | const ValueType & | r | ) |
Constructor to initialize entire vector to one value.
|
inline |
Pass-through constructor for the Array base class.
Definition at line 122 of file itkVector.h.
|
inline |
Pass-through constructor for the Array base class.
Definition at line 123 of file itkVector.h.
|
inline |
Copy from another Vector with a different representation type. Casting is done with C-Like rules
Definition at line 237 of file itkVector.h.
Referenced by itk::ImageBase< TImage::ImageDimension >::InternalSetSpacing().
RealValueType itk::Vector< T, NVectorDimension >::GetNorm | ( | ) | const |
Returns the Euclidean Norm of the vector
|
inlinestatic |
Returns the number of components in this vector type
Definition at line 225 of file itkVector.h.
RealValueType itk::Vector< T, NVectorDimension >::GetSquaredNorm | ( | ) | const |
Returns vector's Squared Euclidean Norm
|
inlinestatic |
Get the dimension (size) of the vector.
Definition at line 87 of file itkVector.h.
vnl_vector_ref< T > itk::Vector< T, NVectorDimension >::GetVnlVector | ( | ) |
Get a vnl_vector_ref referencing the same memory block.
vnl_vector< T > itk::Vector< T, NVectorDimension >::GetVnlVector | ( | ) | const |
Get a vnl_vector with a copy of the internal memory block.
RealValueType itk::Vector< T, NVectorDimension >::Normalize | ( | ) |
Divides the vector components by the vector norm (when the norm is not null). The norm used is returned.
|
inline |
Definition at line 247 of file itkVector.h.
|
inline |
Operators == and != compare a vector component by component. All components must be equal for two vectors to be equal. (Of course compile-time constraints on the template parameters length and type prevent comparisons between vectors of different type and length.)
Definition at line 214 of file itkVector.h.
ValueType itk::Vector< T, NVectorDimension >::operator* | ( | const Self & | vec | ) | const |
Vector operator*. Performs the inner product of two vectors. this is also known as the scalar product.
|
inline |
Scalar operator*. Scale the elements of a vector by a scalar. Return a new vector.
Definition at line 183 of file itkVector.h.
|
inline |
Scalar operator*=. Scales elements by a scalar.
Definition at line 139 of file itkVector.h.
Self itk::Vector< T, NVectorDimension >::operator+ | ( | const Self & | vec | ) | const |
Vector addition. Add two vectors. Return a new vector.
const Self& itk::Vector< T, NVectorDimension >::operator+= | ( | const Self & | vec | ) |
Vector operator+=. Adds a vectors to the current vector.
Self itk::Vector< T, NVectorDimension >::operator- | ( | ) | const |
Vector negation. Negate all the elements of a vector. Return a new vector
Self itk::Vector< T, NVectorDimension >::operator- | ( | const Self & | vec | ) | const |
Vector subtraction. Subtract two vectors. Return a new vector.
const Self& itk::Vector< T, NVectorDimension >::operator-= | ( | const Self & | vec | ) |
Vector operator-=. Subtracts a vector from a current vector.
|
inline |
Scalar operator/. Scale (divide) the elements of a vector by a scalar. Return a new vector.
Definition at line 197 of file itkVector.h.
|
inline |
Scalar operator/=. Scales (divides) elements by a scalar.
Definition at line 151 of file itkVector.h.
|
default |
Default constructors, assignments and destructor
|
default |
Default constructors, assignments and destructor
|
inline |
Pass-through assignment operator for the Array base class.
Definition at line 128 of file itkVector.h.
Vector& itk::Vector< T, NVectorDimension >::operator= | ( | const ValueType | r[NVectorDimension] | ) |
|
inline |
Operators == and != compare a vector component by component. All components must be equal for two vectors to be equal. (Of course compile-time constraints on the template parameters length and type prevent comparisons between vectors of different type and length.)
Definition at line 212 of file itkVector.h.
|
inline |
Definition at line 231 of file itkVector.h.
void itk::Vector< T, NVectorDimension >::SetVnlVector | ( | const vnl_vector< T > & | ) |
Set a vnl_vector_ref referencing the same memory block.
|
static |
Dimension of the vector space.
Definition at line 75 of file itkVector.h.