Orfeo Toolbox  4.0
itkLevelSetFunction.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 __itkLevelSetFunction_h
19 #define __itkLevelSetFunction_h
20 
22 #include "vnl/vnl_matrix_fixed.h"
23 
24 namespace itk
25 {
65 template< typename TImageType >
67  public FiniteDifferenceFunction< TImageType >
68 {
69 public:
75 
77  itkNewMacro(Self);
78 
81 
83  itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
84 
86  typedef double TimeStepType;
87  typedef typename Superclass::ImageType ImageType;
88  typedef typename Superclass::PixelType PixelType;
95 
97  // typedef
99 
109 
111  vnl_matrix_fixed< ScalarValueType,
112  itkGetStaticConstMacro(ImageDimension),
113  itkGetStaticConstMacro(ImageDimension) > m_dxy;
114 
116  ScalarValueType m_dx[itkGetStaticConstMacro(ImageDimension)];
117 
118  ScalarValueType m_dx_forward[itkGetStaticConstMacro(ImageDimension)];
119  ScalarValueType m_dx_backward[itkGetStaticConstMacro(ImageDimension)];
120 
122  };
123 
126  const FloatOffsetType &, GlobalDataStruct * = 0) const
127  { return m_ZeroVectorConstant; }
128 
132  const NeighborhoodType &,
133  const FloatOffsetType &, GlobalDataStruct * = 0) const
135 
139  const FloatOffsetType &, GlobalDataStruct * = 0
140  ) const
142 
146  const NeighborhoodType &,
147  const FloatOffsetType &, GlobalDataStruct * = 0) const
149 
151  virtual void SetAdvectionWeight(const ScalarValueType a)
152  { m_AdvectionWeight = a; }
154  { return m_AdvectionWeight; }
155 
157  virtual void SetPropagationWeight(const ScalarValueType p)
158  { m_PropagationWeight = p; }
160  { return m_PropagationWeight; }
161 
163  virtual void SetCurvatureWeight(const ScalarValueType c)
164  { m_CurvatureWeight = c; }
166  { return m_CurvatureWeight; }
167 
172  { return m_LaplacianSmoothingWeight; }
173 
176  { m_EpsilonMagnitude = e; }
178  { return m_EpsilonMagnitude; }
179 
181  virtual PixelType ComputeUpdate( const NeighborhoodType & neighborhood,
182  void *globalData,
183  const FloatOffsetType & = FloatOffsetType(0.0) );
184 
191  virtual TimeStepType ComputeGlobalTimeStep(void *GlobalData) const;
192 
200  virtual void * GetGlobalDataPointer() const
201  {
202  GlobalDataStruct *ans = new GlobalDataStruct();
203 
207  return ans;
208  }
209 
213  virtual void Initialize(const RadiusType & r);
214 
219  virtual void ReleaseGlobalDataPointer(void *GlobalData) const
220  { delete (GlobalDataStruct *)GlobalData; }
221 
224  const FloatOffsetType &,
225  GlobalDataStruct *gd = 0
226  );
227 
229  const FloatOffsetType &,
230  GlobalDataStruct *gd = 0
231  );
232 
234  const FloatOffsetType &,
235  GlobalDataStruct *gd = 0
236  );
237 
239  const FloatOffsetType &,
240  GlobalDataStruct *gd = 0
241  );
242 
245  {
247  }
248 
250  {
251  return m_UseMinimalCurvature;
252  }
253 
255  {
256  this->SetUseMinimalCurvature(true);
257  }
258 
260  {
261  this->SetUseMinimalCurvature(false);
262  }
263 
268  static void SetMaximumCurvatureTimeStep(double n)
269  {
270  m_DT = n;
271  }
272 
274  {
275  return m_DT;
276  }
277 
282  static void SetMaximumPropagationTimeStep(double n)
283  {
284  m_WaveDT = n;
285  }
286 
288  {
289  return m_WaveDT;
290  }
291 
292 protected:
294  {
295  m_EpsilonMagnitude = static_cast< ScalarValueType >( 1.0e-5 );
299  m_UseMinimalCurvature = false;
300  }
301 
302  virtual ~LevelSetFunction() {}
303  void PrintSelf(std::ostream & s, Indent indent) const;
304 
306  static double m_WaveDT;
307  static double m_DT;
308 
310  std::slice x_slice[itkGetStaticConstMacro(ImageDimension)];
311 
314 
316  OffsetValueType m_xStride[itkGetStaticConstMacro(ImageDimension)];
317 
319 
323 
326 
329 
332 
335 
338 
341 
342 private:
343  LevelSetFunction(const Self &); //purposely not implemented
344  void operator=(const Self &); //purposely not implemented
345 };
346 } // namespace itk
347 
348 #ifndef ITK_MANUAL_INSTANTIATION
349 #include "itkLevelSetFunction.hxx"
350 #endif
351 
352 #endif

Generated at Sat Mar 8 2014 15:08:59 for Orfeo Toolbox with doxygen 1.8.3.1