Medical Imaging Interaction Toolkit  2018.04.99-3ec0dd08
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 
14 #ifndef _MITK_DOSE_ISO_LEVEL_COLLECTIONS_H_
15 #define _MITK_DOSE_ISO_LEVEL_COLLECTIONS_H_
16 
17 #include <set>
18 #include <itkVectorContainer.h>
19 
20 #include "mitkIsoDoseLevel.h"
21 
22 namespace mitk
23 {
30  typedef ::itk::VectorContainer<unsigned int, mitk::IsoDoseLevel::Pointer> IsoDoseLevelVector;
31 
32 
42  public itk::Object
43 {
44 public:
46  itkNewMacro(Self);
47 
48 private:
50  typedef std::vector< IsoDoseLevel::Pointer > InternalVectorType;
51  typedef InternalVectorType::size_type size_type;
52  typedef InternalVectorType::iterator VectorIterator;
53  typedef InternalVectorType::const_iterator VectorConstIterator;
54 
55  InternalVectorType m_IsoLevels;
56 
57 protected:
59  explicit IsoDoseLevelSet(const IsoDoseLevelSet & other);
60 
61  ~IsoDoseLevelSet() override {};
62 
64 
65 public:
66  typedef size_type IsoLevelIndexType;
68 
71 
73  friend class ConstIterator;
74 
80  {
81 public:
83  ConstIterator(const VectorConstIterator & i): m_Iter(i) {}
84  ConstIterator(const ConstIterator & r) { m_Iter = r.m_Iter; }
85  const IsoDoseLevel & operator*() { return *(m_Iter->GetPointer()); }
86  const IsoDoseLevel * operator->() { return m_Iter->GetPointer(); }
87  ConstIterator & operator++() {++m_Iter; return *this; }
88  ConstIterator operator++(int) { ConstIterator temp(*this); ++m_Iter; return temp; }
89  ConstIterator & operator--() {--m_Iter; return *this; }
90  ConstIterator operator--(int) { ConstIterator temp(*this); --m_Iter; return temp; }
91  ConstIterator & operator=(const ConstIterator & r) {m_Iter = r.m_Iter; return *this; }
92  bool operator==(const ConstIterator & r) const { return m_Iter == r.m_Iter; }
93  bool operator!=(const ConstIterator & r) const { return m_Iter != r.m_Iter; }
94 
95  const IsoDoseLevel & Value(void) const { return *(m_Iter->GetPointer()); }
96 
97 private:
98  VectorConstIterator m_Iter;
99  };
100 
101  /* Declare the public interface routines. */
102 
107  const IsoDoseLevel& GetIsoDoseLevel(IsoLevelIndexType) const;
108  const IsoDoseLevel& GetIsoDoseLevel(DoseValueType) const;
109 
114  void SetIsoDoseLevel(const IsoDoseLevel*);
115 
120  bool DoseLevelExists(IsoLevelIndexType) const;
121  bool DoseLevelExists(DoseValueType) const;
122 
128  void DeleteIsoDoseLevel(DoseValueType);
129  void DeleteIsoDoseLevel(IsoLevelIndexType);
130 
134  ConstIterator Begin(void) const;
135 
139  ConstIterator End(void) const;
140 
144  IsoLevelIndexType Size(void) const;
145 
149  void Reset(void);
150 };
151 
152 }
153 
154 #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.
Stores values needed for the representation/visualization of dose iso levels.
#define MITKRT_EXPORT
Definition: MitkRTExports.h:15
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
IsoDoseLevel::DoseValueType DoseValueType
bool operator==(const ConstIterator &r) const
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:158
DoseValueRel DoseValueType
const IsoDoseLevel & Value(void) const
ConstIterator & operator=(const ConstIterator &r)
bool operator!=(const ConstIterator &r) const