MeVisLab Toolbox Reference
mlZTUIndex.h
Go to the documentation of this file.
1// Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2// **InsertLicense** code
3//----------------------------------------------------------------------------------
5
10//----------------------------------------------------------------------------------
11
12#pragma once
13
14#include "MLDICOMTagsSystem.h"
15#include <mlUtilsSystem.h>
16#include <FMEThirdPartyWarningsDisable.h>
17#include <iostream>
18#include <vector>
19#include <FMEThirdPartyWarningsRestore.h>
20
22
23namespace DICOMTagTools {
24
27
28public:
30 ZTUIndex(MLuint64 zp = 0, MLuint64 tp = 0, MLuint64 up = 0, const std::string& val = "");
31
33 ZTUIndex(const std::string& val);
34
36 bool operator==(const ZTUIndex& a) const;
37
39 bool operator!=(const ZTUIndex& a) const;
40
44 bool operator<(const ZTUIndex& a) const;
45
51 bool readMembersFromString(const std::string& srcVal);
52
54 bool isInUINT32Range() const;
55
58 bool isInSize_TRange() const;
59
63 std::string value;
64};
65
66//----------------------------------------------------------------------------------
69//----------------------------------------------------------------------------------
70typedef std::vector<ZTUIndex> ZTUVector;
71
72}
74
75namespace std
76{
77 //-------------------------------------------------------------------
79 //-------------------------------------------------------------------
80 inline std::ostream& operator<<(std::ostream& os, const ML_NAMESPACE::DICOMTagTools::ZTUIndex & ztu)
81 {
82 os << ztu.z << " " << ztu.t << " " << ztu.u << ":" << ztu.value;
83 return os;
84 }
85
86 //-------------------------------------------------------------------
88 //-------------------------------------------------------------------
89 inline std::istream& operator>>(std::istream& is, ML_NAMESPACE::DICOMTagTools::ZTUIndex & ztu)
90 {
91 ML_NAMESPACE::DICOMTagTools::ZTUIndex ztuTmp;
92 char colonChar='\0';
93 is >> ztuTmp.z >> ztuTmp.t >> ztuTmp.u >> colonChar >> ztuTmp.value;
94 if (is && (colonChar==':')){ ztu = ztuTmp; }
95 return is;
96 }
97}
Project global and OS specific declarations.
#define MLDICOMTags_EXPORT
If included by external modules, exported symbols are declared as import symbols.
Class managing a multi-frame Z, T, and U-dimension plus a string value.
Definition mlZTUIndex.h:26
std::string value
A string value assigned to the coordinate.
Definition mlZTUIndex.h:63
bool isInSize_TRange() const
Returns true if z, t, and u are smaller or equal than the currently compiled range of the size_t data...
bool operator<(const ZTUIndex &a) const
Artificial comparison operator on z,t, and u to be able to insert it into a map: u comparison is stro...
bool isInUINT32Range() const
Returns true if z, t, and u are smaller or equal than ML_UINT32_MAX, otherwise false.
bool readMembersFromString(const std::string &srcVal)
Reads a string of type "Z T U:Value" into the members and returns true on success,...
MLuint64 u
u-Coordinate of the frame.
Definition mlZTUIndex.h:62
ZTUIndex(MLuint64 zp=0, MLuint64 tp=0, MLuint64 up=0, const std::string &val="")
Convenience constructor.
ZTUIndex(const std::string &val)
Convenience constructor setting members from string with readMembersFromString.
MLuint64 z
z-Coordinate of the frame.
Definition mlZTUIndex.h:60
bool operator==(const ZTUIndex &a) const
Equality operator.
bool operator!=(const ZTUIndex &a) const
Inequality operator.
MLuint64 t
t-Coordinate of the frame.
Definition mlZTUIndex.h:61
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
UINT64 MLuint64
Introduce platform independent 64 bit unsigned integer type.
Definition mlTypeDefs.h:425
std::vector< ZTUIndex > ZTUVector
A std::vector typedef of ZTUIndexes to describe indexes of handles in the multi-frame Z,...
Definition mlZTUIndex.h:70
STL namespace.
MLEXPORT std::ostream & operator<<(std::ostream &s, const ml::Field &v)
Overloads the operator "<<" for stream output of Field objects.
istream & operator>>(istream &is, ml::FloatingPointVector< T, size, DataContainer > &v)
Reads a vector from std::istream.