Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkIsoDoseLevelCollections.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 
18 #ifndef _MITK_DOSE_ISO_LEVEL_COLLECTIONS_H_
19 #define _MITK_DOSE_ISO_LEVEL_COLLECTIONS_H_
20 
21 #include <set>
22 #include <itkVectorContainer.h>
23 
24 #include "mitkIsoDoseLevel.h"
25 
26 namespace mitk
27 {
34  typedef ::itk::VectorContainer<unsigned int, mitk::IsoDoseLevel::Pointer> IsoDoseLevelVector;
35 
36 
46  public itk::Object
47 {
48 public:
50  itkNewMacro(Self);
51 
52 private:
54  typedef std::vector< IsoDoseLevel::Pointer > InternalVectorType;
55  typedef InternalVectorType::size_type size_type;
56  typedef InternalVectorType::iterator VectorIterator;
57  typedef InternalVectorType::const_iterator VectorConstIterator;
58 
59  InternalVectorType m_IsoLevels;
60 
61 protected:
63  IsoDoseLevelSet(const IsoDoseLevelSet & other);
64 
65  virtual ~IsoDoseLevelSet() {};
66 
68 
69 public:
70  typedef size_type IsoLevelIndexType;
72 
75 
77  friend class ConstIterator;
78 
84  {
85 public:
87  ConstIterator(const VectorConstIterator & i): m_Iter(i) {}
88  ConstIterator(const ConstIterator & r) { m_Iter = r.m_Iter; }
89  const IsoDoseLevel & operator*() { return *(m_Iter->GetPointer()); }
90  const IsoDoseLevel * operator->() { return m_Iter->GetPointer(); }
91  ConstIterator & operator++() {++m_Iter; return *this; }
92  ConstIterator operator++(int) { ConstIterator temp(*this); ++m_Iter; return temp; }
93  ConstIterator & operator--() {--m_Iter; return *this; }
94  ConstIterator operator--(int) { ConstIterator temp(*this); --m_Iter; return temp; }
95  ConstIterator & operator=(const ConstIterator & r) {m_Iter = r.m_Iter; return *this; }
96  bool operator==(const ConstIterator & r) const { return m_Iter == r.m_Iter; }
97  bool operator!=(const ConstIterator & r) const { return m_Iter != r.m_Iter; }
98 
99  const IsoDoseLevel & Value(void) const { return *(m_Iter->GetPointer()); }
100 
101 private:
102  VectorConstIterator m_Iter;
103  };
104 
105  /* Declare the public interface routines. */
106 
111  const IsoDoseLevel& GetIsoDoseLevel(IsoLevelIndexType) const;
112  const IsoDoseLevel& GetIsoDoseLevel(DoseValueType) const;
113 
118  void SetIsoDoseLevel(const IsoDoseLevel*);
119 
124  bool DoseLevelExists(IsoLevelIndexType) const;
125  bool DoseLevelExists(DoseValueType) const;
126 
132  void DeleteIsoDoseLevel(DoseValueType);
133  void DeleteIsoDoseLevel(IsoLevelIndexType);
134 
138  ConstIterator Begin(void) const;
139 
143  ConstIterator End(void) const;
144 
148  IsoLevelIndexType Size(void) const;
149 
153  void Reset(void);
154 };
155 
156 }
157 
158 #endif //_MITK_DOSE_ISO_LEVEL_COLLECTIONS_H_
Stores values needed for the representation/visualization of dose iso levels.
::itk::VectorContainer< unsigned int, mitk::IsoDoseLevel::Pointer > IsoDoseLevelVector
DataCollection - Class to facilitate loading/accessing structured data.
#define MITKDICOMRT_EXPORT
Stores values needed for the representation/visualization of dose iso levels.
bool operator!=(const ConstIterator &r) const
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
IsoDoseLevel::DoseValueType DoseValueType
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:162
DoseValueRel DoseValueType
ConstIterator & operator=(const ConstIterator &r)
bool operator==(const ConstIterator &r) const
const IsoDoseLevel & Value(void) const