ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkLevelSetNode.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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  typedef LevelSetNode Self;
51 
53  typedef TPixel PixelType;
54 
56  itkStaticConstMacro(SetDimension, unsigned int, VSetDimension);
57 
60 
62  bool operator>(const Self & node) const
63  { return m_Value > node.m_Value; }
64 
66  bool operator<(const Self & node) const
67  { return m_Value < node.m_Value; }
68 
70  bool operator<=(const Self & node) const
71  { return m_Value <= node.m_Value; }
72 
74  bool operator>=(const Self & node) const
75  { return m_Value >= node.m_Value; }
76 
79  Self & operator=(const Self & rhs)
80  {
81  if ( this != &rhs )
82  {
83  m_Value = rhs.m_Value;
84  m_Index = rhs.m_Index;
85  }
86  return *this;
87  }
89 
92  { return m_Value; }
93  const PixelType & GetValue() const
94  { return m_Value; }
95  void SetValue(const PixelType & input)
96  { m_Value = input; }
98 
101  { return m_Index; }
102  const IndexType & GetIndex() const
103  { return m_Index; }
104  void SetIndex(const IndexType & input)
105  { m_Index = input; }
107 
110  {
111  m_Index.Fill(0);
112  }
113 
115  LevelSetNode(const Self & node):m_Value(node.m_Value), m_Index(node.m_Index) {}
116 
117 private:
120 };
121 } // end namespace itk
122 
123 #endif
PixelType & GetValue()
LevelSetNode(const Self &node)
bool operator>(const Self &node) const
void SetValue(const PixelType &input)
const PixelType & GetValue() const
bool operator<=(const Self &node) const
Index< VSetDimension > IndexType
void SetIndex(const IndexType &input)
bool operator<(const Self &node) const
LevelSetNode Self
Represent a node in a level set.
void Fill(IndexValueType value)
Definition: itkIndex.h:293
const IndexType & GetIndex() const
static const unsigned int SetDimension
bool operator>=(const Self &node) const
Self & operator=(const Self &rhs)
Define additional traits for native types such as int or float.
IndexType & GetIndex()