ITK  6.0.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 * https://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
26namespace itk
27{
44template <typename TPixel, unsigned int VSetDimension = 2>
46{
47public:
48
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 }
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 }
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 }
141 : m_Value(PixelType{})
142 {
143 m_Index.Fill(0);
144 }
148 LevelSetNode(const Self & node)
149 : m_Value(node.m_Value)
150 , m_Index(node.m_Index)
151 {}
152
153private:
156};
157} // end namespace itk
158
159#endif
Pixel-wise addition of two images.
Represent a node in a level set.
bool operator>(const Self &node) const
bool operator<(const Self &node) const
void SetIndex(const IndexType &input)
const PixelType & GetValue() const
bool operator>=(const Self &node) const
Self & operator=(const Self &rhs)
bool operator<=(const Self &node) const
Index< VSetDimension > IndexType
const IndexType & GetIndex() const
PixelType & GetValue()
void SetValue(const PixelType &input)
LevelSetNode(const Self &node)
IndexType & GetIndex()
static constexpr unsigned int SetDimension
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:69
void Fill(IndexValueType value)
Definition: itkIndex.h:272