ITK  6.0.0
Insight Toolkit
itkLevelSetNeighborhoodExtractor.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 itkLevelSetNeighborhoodExtractor_h
19#define itkLevelSetNeighborhoodExtractor_h
20
22#include "itkLevelSet.h"
23#include "itkIndex.h"
24
25namespace itk
26{
56template <typename TLevelSet>
57class ITK_TEMPLATE_EXPORT LevelSetNeighborhoodExtractor : public LightProcessObject
58{
59public:
60 ITK_DISALLOW_COPY_AND_MOVE(LevelSetNeighborhoodExtractor);
61
67
69 itkNewMacro(Self);
70
72 itkOverrideGetNameOfClassMacro(LevelSetNeighborhoodExtractor);
73
83
85 static constexpr unsigned int SetDimension = LevelSetType::SetDimension;
86
89
91 itkSetConstObjectMacro(InputLevelSet, LevelSetImageType);
92 itkGetConstObjectMacro(InputLevelSet, LevelSetImageType);
96 itkSetMacro(LevelSetValue, double);
97
99 itkGetConstMacro(LevelSetValue, double);
100
102 itkSetClampMacro(NarrowBandwidth, double, 0.0, NumericTraits<double>::max());
103
105 itkGetConstMacro(NarrowBandwidth, double);
106
108 itkSetMacro(NarrowBanding, bool);
109
111 itkGetConstMacro(NarrowBanding, bool);
112 itkBooleanMacro(NarrowBanding);
117 void
119 itkGetModifiableObjectMacro(InputNarrowBand, NodeContainer);
126 {
127 return m_InsidePoints;
128 }
129
132 NodeContainerPointer
134 {
135 return m_OutsidePoints;
136 }
137
140 void
142
143protected:
145 ~LevelSetNeighborhoodExtractor() override = default;
146 void
147 PrintSelf(std::ostream & os, Indent indent) const override;
148
149 typename LevelSetImageType::PixelType
151 {
152 return m_LargeValue;
153 }
154
155 const NodeType &
156 GetNodeUsedInCalculation(unsigned int idx) const
157 {
158 return m_NodesUsed[idx];
159 }
160
161 virtual void
163
164 virtual double
166
167 void
168 GenerateData() override;
169
170 bool
172 {
173 return m_LastPointIsInside;
174 }
175
176private:
177 void
179
180 void
182
183 double m_LevelSetValue{ 0.0 };
184
185 NodeContainerPointer m_InsidePoints{};
186 NodeContainerPointer m_OutsidePoints{};
187
188 LevelSetConstPointer m_InputLevelSet{};
189
190 bool m_NarrowBanding{ false };
191 double m_NarrowBandwidth{ 12.0 };
192 NodeContainerPointer m_InputNarrowBand{};
193
194 typename LevelSetImageType::RegionType m_ImageRegion{};
195 typename LevelSetImageType::PixelType m_LargeValue{};
196
197 std::vector<NodeType> m_NodesUsed{};
198
199 bool m_LastPointIsInside{ false };
200};
201} // namespace itk
202
203#ifndef ITK_MANUAL_INSTANTIATION
204# include "itkLevelSetNeighborhoodExtractor.hxx"
205#endif
206
207#endif
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Locate pixels of a particular level set.
void PrintSelf(std::ostream &os, Indent indent) const override
LevelSetImageType::PixelType GetLargeValue() const
void SetInputNarrowBand(NodeContainer *ptr)
typename LevelSetType::NodeContainer NodeContainer
const NodeType & GetNodeUsedInCalculation(unsigned int idx) const
~LevelSetNeighborhoodExtractor() override=default
typename LevelSetType::LevelSetImageType LevelSetImageType
typename LevelSetType::NodeContainerPointer NodeContainerPointer
typename LevelSetType::LevelSetPointer LevelSetPointer
virtual double CalculateDistance(IndexType &index)
typename LevelSetType::LevelSetConstPointer LevelSetConstPointer
Represent a node in a level set.
Level set type information.
Definition: itkLevelSet.h:41
typename TLevelSet::PixelType PixelType
Definition: itkLevelSet.h:55
typename TLevelSet::ConstPointer LevelSetConstPointer
Definition: itkLevelSet.h:52
typename NodeContainer::Pointer NodeContainerPointer
Definition: itkLevelSet.h:64
typename TLevelSet::Pointer LevelSetPointer
Definition: itkLevelSet.h:51
Light weight base class for most itk classes.
LightProcessObject is the base class for all process objects (source, filters, mappers) in the Insigh...
Define additional traits for native types such as int or float.
Base class for most ITK classes.
Definition: itkObject.h:62
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
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