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 <ThirdPartyWarningsDisable.h>
17 #include <iostream>
18 #include <vector>
19 #include <ThirdPartyWarningsRestore.h>
20 
21 ML_START_NAMESPACE
22 
23 namespace DICOMTagTools {
24 
27 
28 public:
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 //----------------------------------------------------------------------------------
70 typedef std::vector<ZTUIndex> ZTUVector;
71 
72 }
73 ML_END_NAMESPACE
74 
75 namespace 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
MLEXPORT std::ostream & operator<<(std::ostream &s, const ml::Field &v)
Overloads the operator "<<" for stream output of Field objects.
UINT64 MLuint64
Introduce platform independent 64 bit unsigned integer type.
Definition: mlTypeDefs.h:513
std::istream & operator>>(std::istream &in, ml::Variant &variant)
Definition: mlVariant.h:215
std::vector< ZTUIndex > ZTUVector
A std::vector typedef of ZTUIndexes to describe indexes of handles in the multi-frame Z,...
Definition: mlZTUIndex.h:70
constexpr Is< T > is(T d)