ITK  4.10.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 >
58  public LightProcessObject
59 {
60 public:
66 
68  itkNewMacro(Self);
69 
72 
79  typedef typename LevelSetType::NodeType NodeType;
82 
84  itkStaticConstMacro(SetDimension, unsigned int,
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 
124  NodeContainerPointer GetInsidePoints()
125  { return m_InsidePoints; }
126 
129  NodeContainerPointer GetOutsidePoints(void)
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  LevelSetNeighborhoodExtractor(const Self &) ITK_DELETE_FUNCTION;
158  void operator=(const Self &) ITK_DELETE_FUNCTION;
159 
160  void GenerateDataFull();
161 
162  void GenerateDataNarrowBand();
163 
165 
166  NodeContainerPointer m_InsidePoints;
167  NodeContainerPointer m_OutsidePoints;
168 
169  LevelSetConstPointer m_InputLevelSet;
170 
173  NodeContainerPointer m_InputNarrowBand;
174 
176  typename LevelSetImageType::PixelType m_LargeValue;
177 
178  std::vector< NodeType > m_NodesUsed;
179 
181 };
182 } // namespace itk
183 
184 #ifndef ITK_MANUAL_INSTANTIATION
185 #include "itkLevelSetNeighborhoodExtractor.hxx"
186 #endif
187 
188 #endif
Locate pixels of a particular level set.
TLevelSet::PixelType PixelType
Definition: itkLevelSet.h:55
LevelSetImageType::PixelType GetLargeValue() const
LevelSetTypeDefault< TLevelSet > LevelSetType
LevelSetType::LevelSetConstPointer LevelSetConstPointer
LevelSetType::LevelSetImageType LevelSetImageType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes...
Definition: itkArray.h:30
virtual void PrintSelf(std::ostream &os, Indent indent) const override
virtual void GenerateData() override
unsigned long SizeValueType
Definition: itkIntTypes.h:143
const NodeType & GetNodeUsedInCalculation(unsigned int idx) const
LevelSetType::NodeContainerPointer NodeContainerPointer
void operator=(const Self &) ITK_DELETE_FUNCTION
Represent a node in a level set.
TLevelSet::ConstPointer LevelSetConstPointer
Definition: itkLevelSet.h:52
virtual double CalculateDistance(IndexType &index)
void SetInputNarrowBand(NodeContainer *ptr)
Index< itkGetStaticConstMacro(SetDimension) > IndexType
Define a front-end to the STL "vector" 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:57
Level set type information.
Definition: itkLevelSet.h:40
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:71
static const unsigned int SetDimension
Definition: itkLevelSet.h:48
TLevelSet::Pointer LevelSetPointer
Definition: itkLevelSet.h:51