ITK  4.13.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:
66 
68  itkNewMacro(Self);
69 
72 
79  typedef typename LevelSetType::NodeType NodeType;
82 
84  itkStaticConstMacro(SetDimension, unsigned int,
85  LevelSetType::SetDimension);
86 
89 
91  itkSetConstObjectMacro(InputLevelSet, LevelSetImageType);
92  itkGetConstObjectMacro(InputLevelSet, LevelSetImageType);
94 
96  itkSetMacro(LevelSetValue, double);
97 
99  itkGetConstMacro(LevelSetValue, double);
100 
102  itkSetClampMacro( NarrowBandwidth, double, 0.0,
104 
106  itkGetConstMacro(NarrowBandwidth, double);
107 
109  itkSetMacro(NarrowBanding, bool);
110 
112  itkGetConstMacro(NarrowBanding, bool);
113  itkBooleanMacro(NarrowBanding);
115 
118  void SetInputNarrowBand(NodeContainer *ptr);
119  itkGetModifiableObjectMacro(InputNarrowBand, NodeContainer);
121 
125  { return m_InsidePoints; }
126 
130  { return m_OutsidePoints; }
131 
134  void Locate();
135 
136 protected:
139  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
140 
141  typename LevelSetImageType::PixelType GetLargeValue() const
142  { return m_LargeValue; }
143 
144  const NodeType & GetNodeUsedInCalculation(unsigned int idx) const
145  { return m_NodesUsed[idx]; }
146 
147  virtual void Initialize();
148 
149  virtual double CalculateDistance(IndexType & index);
150 
151  virtual void GenerateData() ITK_OVERRIDE;
152 
153  bool GetLastPointIsInside() const
154  { return m_LastPointIsInside; }
155 
156 private:
157  ITK_DISALLOW_COPY_AND_ASSIGN(LevelSetNeighborhoodExtractor);
158 
159  void GenerateDataFull();
160 
161  void GenerateDataNarrowBand();
162 
164 
167 
169 
173 
174  typename LevelSetImageType::RegionType m_ImageRegion;
175  typename LevelSetImageType::PixelType m_LargeValue;
176 
177  std::vector< NodeType > m_NodesUsed;
178 
180 };
181 } // namespace itk
182 
183 #ifndef ITK_MANUAL_INSTANTIATION
184 #include "itkLevelSetNeighborhoodExtractor.hxx"
185 #endif
186 
187 #endif
Locate pixels of a particular level set.
Light weight base class for most itk classes.
TLevelSet::PixelType PixelType
Definition: itkLevelSet.h:55
LevelSetImageType::PixelType GetLargeValue() const
LevelSetTypeDefault< TLevelSet > LevelSetType
LevelSetType::LevelSetConstPointer LevelSetConstPointer
LevelSetType::LevelSetImageType LevelSetImageType
const NodeType & GetNodeUsedInCalculation(unsigned int idx) const
LevelSetType::NodeContainerPointer NodeContainerPointer
Represent a node in a level set.
TLevelSet::ConstPointer LevelSetConstPointer
Definition: itkLevelSet.h:52
Index< itkGetStaticConstMacro(SetDimension) > IndexType
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
Define additional traits for native types such as int or float.
Base class for most ITK classes.
Definition: itkObject.h:59
Level set type information.
Definition: itkLevelSet.h:40
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:72
TLevelSet::Pointer LevelSetPointer
Definition: itkLevelSet.h:51