ITK  4.2.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< class TPixel, unsigned int VSetDimension = 2 >
45 class ITK_EXPORT LevelSetNode
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 ) { return *this; }
82 
83  m_Value = rhs.m_Value;
84  m_Index = rhs.m_Index;
85  return *this;
86  }
87 
89  PixelType & GetValue()
90  { return m_Value; }
91  const PixelType & GetValue() const
92  { return m_Value; }
93  void SetValue(const PixelType & input)
94  { m_Value = input; }
96 
98  IndexType & GetIndex()
99  { return m_Index; }
100  const IndexType & GetIndex() const
101  { return m_Index; }
102  void SetIndex(const IndexType & input)
103  { m_Index = input; }
105 
108  {
109  m_Index.Fill(0);
110  }
111 
113  LevelSetNode(const Self & node):m_Value(node.m_Value), m_Index(node.m_Index) {}
114 private:
117 };
118 } // end namespace itk
119 
120 #endif
121