13#ifndef ML_IMAGE_VECTOR_H
14#define ML_IMAGE_VECTOR_H
38 template <
typename CompIntType>
134 template <
typename CompIntType=ML
int>
165 template <
typename T2IntType>
224 if (xp){ *xp = ParentClass::x; }
225 if (yp){ *yp = ParentClass::y; }
226 if (zp){ *zp = ParentClass::z; }
227 if (cp){ *cp = ParentClass::c; }
228 if (tp){ *tp = ParentClass::t; }
229 if (up){ *up = ParentClass::u; }
242 if (ParentClass::x >= ext.x){
243 ParentClass::x = 0; ParentClass::y++;
244 if (ParentClass::y >= ext.y){
245 ParentClass::y = 0; ParentClass::z++;
246 if (ParentClass::z >= ext.z){
247 ParentClass::z = 0; ParentClass::c++;
248 if (ParentClass::c >= ext.c){
249 ParentClass::c = 0; ParentClass::t++;
250 if (ParentClass::t >= ext.t){
251 ParentClass::t = 0; ParentClass::u++;
252 if (ParentClass::u >= ext.u){
253 ParentClass::u = 0;
return true;
266 return Vector6(
static_cast<double>(ParentClass::x),
267 static_cast<double>(ParentClass::y),
268 static_cast<double>(ParentClass::z),
269 static_cast<double>(ParentClass::c),
270 static_cast<double>(ParentClass::t),
271 static_cast<double>(ParentClass::u));
277 return Vector3(
static_cast<double>(ParentClass::x),
278 static_cast<double>(ParentClass::y),
279 static_cast<double>(ParentClass::z));
ImageVector is the 6D TVector specialization used by the ML for all image indexing.
static MLint dim()
Returns the dimension the ML calculates with.
bool iterate(const TImageVector< ComponentType > &ext)
Coordinate incrementation/iterator function inside ext.
TImageVector(const ComponentType xp, const ComponentType yp, const ComponentType zp, const ComponentType cp, const ComponentType tp, const ComponentType up)
Constructor which initializes all components with the values x, y, z, c, t and u.
void set(const ParentClass &v)
Like assignment operator.
ParentClass::ComponentType ComponentType
Integer type used by this vector.
TImageVector(const TImageVector< T2IntType > &v2)
Copy constructor from another TVector of same or other integer type, values are cast.
void set(const ComponentType v=0)
Sets all components to v or - if v is not specified - to 0.
TImageVector(const Vector6 &v6)
Copies the six double components of v6 into x, ..., u, respectively.
TVector< TVector6DBase< CompIntType > > ParentClass
Parent class of this class.
TImageVector(const ComponentType i)
Constructor which initializes all components to i.
TImageVector()
Constructor. All components are initialized to 0.
Vector3 toVector3() const
Returns the x,y,z components as Vector3.
void get(ComponentType *const xp=nullptr, ComponentType *const yp=nullptr, ComponentType *const zp=nullptr, ComponentType *const cp=nullptr, ComponentType *const tp=nullptr, ComponentType *const up=nullptr) const
Returns the subset of those Vector components whose corresponding pointers are not NULL.
void set(const ComponentType vx, const ComponentType vy, const ComponentType vz=0, const ComponentType vc=0, const ComponentType vt=0, const ComponentType vu=0)
Sets vector to (vx, vy, vz, vc, vt, vu). Not passed components are set to 0.
TImageVector(const ParentClass &v)
Copy constructor from Base class.
TImageVector(const ComponentType xp, const TImageVector< ComponentType > &p)
Constructor which assigns X to x and copies other elements from p.
Vector6 toVector6() const
Returns the vector contents as Vector6.
TImageVector(const MLint num, const ComponentType *const arr, const ComponentType deflt)
Constructor which initializes the vector components by copying them from arr[0] ,....
TVector6DBase is the data container class for TVector providing specialized 6D container functionalit...
ComponentType c
Color component of the vector.
ComponentType t
Time component of the vector.
ComponentType u
Unit/Modality/User component of the vector.
TVector6DBase()
Do not allow a direct creation of this class as object, because this container does not initialize it...
ComponentType z
Z component of the vector.
ComponentType x
X component of the vector.
CompIntType ComponentType
Integer type used by this vector.
ComponentType y
Y component of the vector.
ML integer image vector class to be specialized for different purposes.
TVectorBase::ComponentType ComponentType
Integer type used by this vector.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...