ITK  5.2.0
Insight Toolkit
itkLevelSetNode.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkLevelSetNode_h
19 #define itkLevelSetNode_h
20 
21 #include "itkIndex.h"
22 #include "itkImage.h"
23 #include "itkVectorContainer.h"
24 #include "itkVector.h"
25 
26 namespace itk
27 {
44 template <typename TPixel, unsigned int VSetDimension = 2>
46 {
47 public:
48 
50  using Self = LevelSetNode;
51 
53  using PixelType = TPixel;
54 
56  static constexpr unsigned int SetDimension = VSetDimension;
57 
60 
62  bool
63  operator>(const Self & node) const
64  {
65  return m_Value > node.m_Value;
66  }
67 
69  bool
70  operator<(const Self & node) const
71  {
72  return m_Value < node.m_Value;
73  }
74 
76  bool
77  operator<=(const Self & node) const
78  {
79  return m_Value <= node.m_Value;
80  }
81 
83  bool
84  operator>=(const Self & node) const
85  {
86  return m_Value >= node.m_Value;
87  }
88 
91  Self &
92  operator=(const Self & rhs)
93  {
94  if (this != &rhs)
95  {
96  m_Value = rhs.m_Value;
97  m_Index = rhs.m_Index;
98  }
99  return *this;
100  }
102 
104  PixelType &
106  {
107  return m_Value;
108  }
109  const PixelType &
110  GetValue() const
111  {
112  return m_Value;
113  }
114  void
115  SetValue(const PixelType & input)
116  {
117  m_Value = input;
118  }
120 
122  IndexType &
124  {
125  return m_Index;
126  }
127  const IndexType &
128  GetIndex() const
129  {
130  return m_Index;
131  }
132  void
133  SetIndex(const IndexType & input)
134  {
135  m_Index = input;
136  }
138 
141  : m_Value(NumericTraits<PixelType>::ZeroValue())
142  {
143  m_Index.Fill(0);
144  }
145 
147  LevelSetNode(const Self & node)
148  : m_Value(node.m_Value)
149  , m_Index(node.m_Index)
150  {}
151 
152 private:
155 };
156 } // end namespace itk
157 
158 #endif
itk::Index< VSetDimension >
itk::LevelSetNode::operator<=
bool operator<=(const Self &node) const
Definition: itkLevelSetNode.h:77
itk::LevelSetNode::LevelSetNode
LevelSetNode(const Self &node)
Definition: itkLevelSetNode.h:147
itk::LevelSetNode::operator>=
bool operator>=(const Self &node) const
Definition: itkLevelSetNode.h:84
itk::LevelSetNode::SetValue
void SetValue(const PixelType &input)
Definition: itkLevelSetNode.h:115
itk::LevelSetNode::m_Index
IndexType m_Index
Definition: itkLevelSetNode.h:154
itk::LevelSetNode::operator<
bool operator<(const Self &node) const
Definition: itkLevelSetNode.h:70
itkImage.h
itk::LevelSetNode
Represent a node in a level set.
Definition: itkLevelSetNode.h:45
itk::Index::Fill
void Fill(IndexValueType value)
Definition: itkIndex.h:270
itk::LevelSetNode::IndexType
Index< VSetDimension > IndexType
Definition: itkLevelSetNode.h:59
itk::LevelSetNode::GetValue
PixelType & GetValue()
Definition: itkLevelSetNode.h:105
itk::LevelSetNode::SetDimension
static constexpr unsigned int SetDimension
Definition: itkLevelSetNode.h:56
itk::LevelSetNode::Self
LevelSetNode Self
Definition: itkLevelSetNode.h:50
itk::LevelSetNode::GetIndex
IndexType & GetIndex()
Definition: itkLevelSetNode.h:123
itk::LevelSetNode::LevelSetNode
LevelSetNode()
Definition: itkLevelSetNode.h:140
itk::LevelSetNode::operator=
Self & operator=(const Self &rhs)
Definition: itkLevelSetNode.h:92
itk::LevelSetNode::PixelType
TPixel PixelType
Definition: itkLevelSetNode.h:53
itkIndex.h
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:58
itkVectorContainer.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::LevelSetNode::GetIndex
const IndexType & GetIndex() const
Definition: itkLevelSetNode.h:128
itkVector.h
itk::LevelSetNode::m_Value
PixelType m_Value
Definition: itkLevelSetNode.h:153
itk::LevelSetNode::SetIndex
void SetIndex(const IndexType &input)
Definition: itkLevelSetNode.h:133
itk::LevelSetNode::operator>
bool operator>(const Self &node) const
Definition: itkLevelSetNode.h:63
itk::LevelSetNode::GetValue
const PixelType & GetValue() const
Definition: itkLevelSetNode.h:110