ITK  4.3.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 
94  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 
121  itkGetObjectMacro(InputNarrowBand, NodeContainer);
122 
125  NodeContainerPointer GetInsidePoints()
126  { return m_InsidePoints; }
127 
130  NodeContainerPointer GetOutsidePoints(void)
131  { return m_OutsidePoints; }
132 
135  void Locate();
136 
137 protected:
140  void PrintSelf(std::ostream & os, Indent indent) const;
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();
153 
154  bool GetLastPointIsInside() const
155  { return m_LastPointIsInside; }
156 
157 private:
158  LevelSetNeighborhoodExtractor(const Self &); //purposely not implemented
159  void operator=(const Self &); //purposely not implemented
160 
161  void GenerateDataFull();
162 
163  void GenerateDataNarrowBand();
164 
166 
169 
171 
175 
176  SizeValueType m_ImageSize[SetDimension];
177  typename LevelSetImageType::PixelType m_LargeValue;
178 
179  std::vector< NodeType > m_NodesUsed;
180 
182 };
183 } // namespace itk
184 
185 #ifndef ITK_MANUAL_INSTANTIATION
186 #include "itkLevelSetNeighborhoodExtractor.hxx"
187 #endif
188 
189 #endif
190