Orfeo Toolbox  3.16
itkSparseFieldFourthOrderLevelSetImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkSparseFieldFourthOrderLevelSetImageFilter.h,v $
5  Language: C++
6  Date: $Date: 2008-10-18 16:11:13 $
7  Version: $Revision: 1.16 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkSparseFieldFourthOrderLevelSetImageFilter_h
18 #define __itkSparseFieldFourthOrderLevelSetImageFilter_h
19 
20 #include "itkSparseImage.h"
25 #include <math.h>
26 
27 namespace itk {
28 
36 template <class TImageType>
38 {
39 public:
41  typedef TImageType LevelSetImageType;
42 
44  typedef typename LevelSetImageType::PixelType NodeValueType;
45 
47  typedef typename LevelSetImageType::IndexType IndexType;
48 
50  typedef Vector <NodeValueType,
53 
56 
59 
62 
67 
70 
74 
78 
81 
85 };
86 
153 template <class TInputImage, class TOutputImage>
155  : public SparseFieldLevelSetImageFilter <TInputImage, TOutputImage>
156 {
157 public:
163 
167 
169  itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
170 
178 
182 
184  typedef SparseImage <NodeType,
185  itkGetStaticConstMacro(ImageDimension)> SparseImageType;
186 
189 
192 
196 
200 
202  //typedef typename NormalVectorFunctionType::RadiusType RadiusType;
203 
207 
208  itkGetConstReferenceMacro(MaxRefitIteration,unsigned int);
209  itkSetMacro(MaxRefitIteration,unsigned int);
210  itkGetConstReferenceMacro(MaxNormalIteration,unsigned int);
211  itkSetMacro(MaxNormalIteration,unsigned int);
212  itkGetConstReferenceMacro(CurvatureBandWidth,ValueType);
213  itkSetMacro(CurvatureBandWidth,ValueType);
214  itkGetConstReferenceMacro(RMSChangeNormalProcessTrigger, ValueType);
215  itkSetMacro(RMSChangeNormalProcessTrigger, ValueType);
216  itkGetConstReferenceMacro(NormalProcessType, int);
217  itkSetMacro(NormalProcessType, int);
218  itkGetConstReferenceMacro(NormalProcessConductance, ValueType);
219  itkSetMacro(NormalProcessConductance, ValueType);
220  itkSetMacro(NormalProcessUnsharpFlag, bool);
221  itkGetConstReferenceMacro(NormalProcessUnsharpFlag, bool);
222  itkSetMacro(NormalProcessUnsharpWeight, ValueType);
223  itkGetConstReferenceMacro(NormalProcessUnsharpWeight, ValueType);
224 
227  void SetLevelSetFunction( LevelSetFunctionType *lsf );
228 
232  unsigned int GetMinimumNumberOfLayers() const
233  {
234  return (int)vcl_ceil(m_CurvatureBandWidth+
235  itkGetStaticConstMacro(ImageDimension));
236  }
237 
240  virtual void SetNumberOfLayers( const unsigned int n )
241  {
242  unsigned int nm = vnl_math_max (this->GetMinimumNumberOfLayers (), n );
243  if (nm != this->GetNumberOfLayers())
244  {
245  Superclass::SetNumberOfLayers (nm);
246  this->Modified();
247  }
248  }
249 
252  virtual void InitializeIteration()
253  {
254  Superclass::InitializeIteration();
255  ValueType rmschange = this->GetRMSChange();
256 
257  if ( ( this->GetElapsedIterations() == 0 ) ||
258  ( m_RefitIteration == m_MaxRefitIteration ) ||
259  ( rmschange <= m_RMSChangeNormalProcessTrigger ) ||
260  ( this->ActiveLayerCheckBand() ) )
261  {
262  if ( ( this->GetElapsedIterations() != 0 ) &&
263  ( rmschange <= m_RMSChangeNormalProcessTrigger ) &&
264  ( m_RefitIteration <= 1) )
265  {
266  m_ConvergenceFlag = true;
267  }
268 
269  m_RefitIteration = 0;
270  ProcessNormals();
271  }
272 
273  m_RefitIteration++;
274  }
275 
276 #ifdef ITK_USE_CONCEPT_CHECKING
277 
278  itkConceptMacro(OutputHasNumericTraitsCheck,
281 #endif
282 
283 protected:
286  virtual void PrintSelf(std::ostream& os, Indent indent) const;
287 
288 
291  ValueType ComputeCurvatureFromSparseImageNeighborhood
292  ( SparseImageIteratorType &neighborhood ) const;
293 
297  void ComputeCurvatureTarget( const OutputImageType *distanceImage,
298  SparseImageType *sparseImage ) const;
299 
301  void ProcessNormals();
302 
307  bool ActiveLayerCheckBand() const;
308 
309 private:
312  unsigned int m_RefitIteration;
313 
317  unsigned int m_MaxRefitIteration;
318 
321  unsigned int m_MaxNormalIteration;
322 
327 
331 
335 
341 
345 
349 
353 
357 
359  static const unsigned long m_NumVertex;
360  static const ValueType m_DimConst;
361 
363  //purposely not implemented
364  void operator=(const Self&); //purposely not implemented
365 };
366 
367 } // end namespace itk
368 
369 #ifndef ITK_MANUAL_INSTANTIATION
371 #endif
372 
373 #endif

Generated at Sun Feb 3 2013 00:07:51 for Orfeo Toolbox with doxygen 1.8.1.1