ITK  4.4.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< class 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,
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 
124  NodeContainerPointer GetInsidePoints()
125  { return m_InsidePoints; }
126 
129  NodeContainerPointer GetOutsidePoints(void)
130  { return m_OutsidePoints; }
131 
134  void Locate();
135 
136 protected:
139  void PrintSelf(std::ostream & os, Indent indent) const;
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  void GenerateData();
152 
153  bool GetLastPointIsInside() const
154  { return m_LastPointIsInside; }
155 
156 private:
157  LevelSetNeighborhoodExtractor(const Self &); //purposely not implemented
158  void operator=(const Self &); //purposely not implemented
159 
160  void GenerateDataFull();
161 
162  void GenerateDataNarrowBand();
163 
165 
168 
170 
174 
175  SizeValueType m_ImageSize[SetDimension];
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
189