ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkLevelSetNeighborhoodExtractor.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 itkLevelSetNeighborhoodExtractor_h
19 #define itkLevelSetNeighborhoodExtractor_h
20 
21 #include "itkLightProcessObject.h"
22 #include "itkLevelSet.h"
23 #include "itkIndex.h"
24 
25 namespace itk
26 {
56 template< typename TLevelSet >
57 class ITK_TEMPLATE_EXPORT LevelSetNeighborhoodExtractor:
58  public LightProcessObject
59 {
60 public:
61  ITK_DISALLOW_COPY_AND_ASSIGN(LevelSetNeighborhoodExtractor);
62 
68 
70  itkNewMacro(Self);
71 
74 
81  using NodeType = typename LevelSetType::NodeType;
84 
86  static constexpr unsigned int SetDimension = LevelSetType::SetDimension;
87 
90 
92  itkSetConstObjectMacro(InputLevelSet, LevelSetImageType);
93  itkGetConstObjectMacro(InputLevelSet, LevelSetImageType);
95 
97  itkSetMacro(LevelSetValue, double);
98 
100  itkGetConstMacro(LevelSetValue, double);
101 
103  itkSetClampMacro( NarrowBandwidth, double, 0.0,
105 
107  itkGetConstMacro(NarrowBandwidth, double);
108 
110  itkSetMacro(NarrowBanding, bool);
111 
113  itkGetConstMacro(NarrowBanding, bool);
114  itkBooleanMacro(NarrowBanding);
116 
119  void SetInputNarrowBand(NodeContainer *ptr);
120  itkGetModifiableObjectMacro(InputNarrowBand, NodeContainer);
122 
126  { return m_InsidePoints; }
127 
131  { return m_OutsidePoints; }
132 
135  void Locate();
136 
137 protected:
139  ~LevelSetNeighborhoodExtractor() override = default;
140  void PrintSelf(std::ostream & os, Indent indent) const override;
141 
142  typename LevelSetImageType::PixelType GetLargeValue() const
143  { return m_LargeValue; }
144 
145  const NodeType & GetNodeUsedInCalculation(unsigned int idx) const
146  { return m_NodesUsed[idx]; }
147 
148  virtual void Initialize();
149 
150  virtual double CalculateDistance(IndexType & index);
151 
152  void GenerateData() override;
153 
154  bool GetLastPointIsInside() const
155  { return m_LastPointIsInside; }
156 
157 private:
158  void GenerateDataFull();
159 
160  void GenerateDataNarrowBand();
161 
162  double m_LevelSetValue{0.0};
163 
166 
168 
169  bool m_NarrowBanding{false};
170  double m_NarrowBandwidth{12.0};
172 
174  typename LevelSetImageType::PixelType m_LargeValue;
175 
176  std::vector< NodeType > m_NodesUsed;
177 
178  bool m_LastPointIsInside{false};
179 };
180 } // namespace itk
181 
182 #ifndef ITK_MANUAL_INSTANTIATION
183 #include "itkLevelSetNeighborhoodExtractor.hxx"
184 #endif
185 
186 #endif
Locate pixels of a particular level set.
typename NodeContainer::Pointer NodeContainerPointer
Definition: itkLevelSet.h:65
Light weight base class for most itk classes.
Define numeric traits for std::vector.
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:66
LevelSetImageType::PixelType GetLargeValue() const
typename LevelSetType::LevelSetPointer LevelSetPointer
typename TLevelSet::Pointer LevelSetPointer
Definition: itkLevelSet.h:51
typename LevelSetType::NodeContainer NodeContainer
const NodeType & GetNodeUsedInCalculation(unsigned int idx) const
typename LevelSetType::LevelSetConstPointer LevelSetConstPointer
typename TLevelSet::PixelType PixelType
Definition: itkLevelSet.h:55
typename LevelSetType::NodeContainerPointer NodeContainerPointer
Represent a node in a level set.
typename TLevelSet::ConstPointer LevelSetConstPointer
Definition: itkLevelSet.h:52
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
LightProcessObject is the base class for all process objects (source, filters, mappers) in the Insigh...
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename LevelSetType::LevelSetImageType LevelSetImageType
Base class for most ITK classes.
Definition: itkObject.h:60
Level set type information.
Definition: itkLevelSet.h:40