Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
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 mitkIsoDoseLevelCollections_h
15 #define mitkIsoDoseLevelCollections_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::IsoDoseLevelSet::IsoDoseLevelSet
IsoDoseLevelSet()
Definition: mitkIsoDoseLevelCollections.h:58
mitk::IsoDoseLevel::DoseValueType
DoseValueRel DoseValueType
Definition: mitkIsoDoseLevel.h:40
mitk::IsoDoseLevelSet::ConstIterator
Definition: mitkIsoDoseLevelCollections.h:79
mitk::IsoDoseLevelSet::ConstIterator::ConstIterator
ConstIterator()
Definition: mitkIsoDoseLevelCollections.h:82
mitk::IsoDoseLevelSet::ConstIterator::operator*
const IsoDoseLevel & operator*()
Definition: mitkIsoDoseLevelCollections.h:85
mitkClassMacroItkParent
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
mitk::IsoDoseLevelSet::ConstIterator::operator=
ConstIterator & operator=(const ConstIterator &r)
Definition: mitkIsoDoseLevelCollections.h:91
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
MITKRT_EXPORT
#define MITKRT_EXPORT
Definition: MitkRTExports.h:15
mitk::IsoDoseLevelSet::ConstIterator::ConstIterator
ConstIterator(const VectorConstIterator &i)
Definition: mitkIsoDoseLevelCollections.h:83
mitk::IsoDoseLevelSet::ConstIterator::operator->
const IsoDoseLevel * operator->()
Definition: mitkIsoDoseLevelCollections.h:86
mitk::IsoDoseLevelSet::ConstIterator::operator--
ConstIterator & operator--()
Definition: mitkIsoDoseLevelCollections.h:89
mitk::IsoDoseLevelSet::~IsoDoseLevelSet
~IsoDoseLevelSet() override
Definition: mitkIsoDoseLevelCollections.h:61
mitk::IsoDoseLevelSet::IsoLevelIndexType
size_type IsoLevelIndexType
Definition: mitkIsoDoseLevelCollections.h:66
mitk::IsoDoseLevelSet
Stores values needed for the representation/visualization of dose iso levels.
Definition: mitkIsoDoseLevelCollections.h:41
mitk::IsoDoseLevelVector
::itk::VectorContainer< unsigned int, mitk::IsoDoseLevel::Pointer > IsoDoseLevelVector
Definition: mitkIsoDoseLevelCollections.h:30
mitk::IsoDoseLevelSet::ConstIterator::operator!=
bool operator!=(const ConstIterator &r) const
Definition: mitkIsoDoseLevelCollections.h:93
mitk::IsoDoseLevelSet::ConstIterator::operator--
ConstIterator operator--(int)
Definition: mitkIsoDoseLevelCollections.h:90
mitk::IsoDoseLevelSet::ConstIterator::ConstIterator
ConstIterator(const ConstIterator &r)
Definition: mitkIsoDoseLevelCollections.h:84
mitkIsoDoseLevel.h
mitk::IsoDoseLevelSet::ConstIterator::Value
const IsoDoseLevel & Value(void) const
Definition: mitkIsoDoseLevelCollections.h:95
mitk::IsoDoseLevelSet::ConstIterator::operator++
ConstIterator & operator++()
Definition: mitkIsoDoseLevelCollections.h:87
mitk::IsoDoseLevelSet::ConstIterator::operator==
bool operator==(const ConstIterator &r) const
Definition: mitkIsoDoseLevelCollections.h:92
mitkCloneMacro
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:154
mitk::IsoDoseLevel
Stores values needed for the representation/visualization of dose iso levels.
Definition: mitkIsoDoseLevel.h:36
mitk::IsoDoseLevelSet::DoseValueType
IsoDoseLevel::DoseValueType DoseValueType
Definition: mitkIsoDoseLevelCollections.h:67
mitk::IsoDoseLevelSet::ConstIterator::operator++
ConstIterator operator++(int)
Definition: mitkIsoDoseLevelCollections.h:88