Orfeo Toolbox  3.16
itkNarrowBandLevelSetImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkNarrowBandLevelSetImageFilter.h,v $
5  Language: C++
6  Date: $Date: 2009-01-26 21:45:53 $
7  Version: $Revision: 1.11 $
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 __itkNarrowBandLevelSetImageFilter_h
18 #define __itkNarrowBandLevelSetImageFilter_h
19 
24 
25 namespace itk {
26 
139 template <class TInputImage,
140  class TFeatureImage,
141  class TOutputPixelType = float,
142  class TOutputImage = Image<TOutputPixelType,
145  : public NarrowBandImageFilterBase<TInputImage, TOutputImage>
146 {
147 public:
153 
155  typedef typename Superclass::ValueType ValueType;
156  typedef typename Superclass::IndexType IndexType;
157  typedef typename Superclass::TimeStepType TimeStepType;
158  typedef typename Superclass::InputImageType InputImageType;
159 
161  typedef TOutputImage OutputImageType;
162  typedef TFeatureImage FeatureImageType;
163 
167 
170 
173 
176  virtual void SetFeatureImage(const FeatureImageType *f)
177  {
178  this->ProcessObject::SetNthInput( 1, const_cast< FeatureImageType * >(f) );
179  m_SegmentationFunction->SetFeatureImage(f);
180  }
181  virtual FeatureImageType * GetFeatureImage()
182  {
183  return ( static_cast< FeatureImageType *>(this->ProcessObject::GetInput(1)) );
184  }
185 
188  virtual void SetInitialImage(InputImageType *f)
189  {
190  this->SetInput(f);
191  }
192 
193  virtual const typename SegmentationFunctionType::ImageType *GetSpeedImage() const
194  { return m_SegmentationFunction->GetSpeedImage(); }
195 
196  virtual const typename SegmentationFunctionType::VectorImageType *GetAdvectionImage() const
197  { return m_SegmentationFunction->GetAdvectionImage(); }
198 
202  void SetUseNegativeFeaturesOn()
203  {
204  itkWarningMacro( << "SetUseNegativeFeaturesOn has been deprecated. Please use ReverseExpansionDirectionOn() instead" );
205  this->ReverseExpansionDirectionOn();
206  }
207  void SetUseNegativeFeaturesOff()
208  {
209  itkWarningMacro( << "SetUseNegativeFeaturesOff has been deprecated. Please use ReverseExpansionDirectionOff() instead" );
210  this->ReverseExpansionDirectionOff();
211  }
212 
215  void SetUseNegativeFeatures( bool u )
216  {
217  itkWarningMacro( << "SetUseNegativeFeatures has been deprecated. Please use SetReverseExpansionDirection instead" );
218  if (u == true)
219  {
220  this->SetReverseExpansionDirection(false);
221  }
222  else
223  {
224  this->SetReverseExpansionDirection(true);
225  }
226  }
227  bool GetUseNegativeFeatures() const
228  {
229  itkWarningMacro( << "GetUseNegativeFeatures has been deprecated. Please use GetReverseExpansionDirection() instead" );
230  if ( this->GetReverseExpansionDirection() == false)
231  {
232  return true;
233  }
234  else
235  {
236  return false;
237  }
238  }
239 
248  itkSetMacro(ReverseExpansionDirection, bool);
249  itkGetConstMacro(ReverseExpansionDirection, bool);
250  itkBooleanMacro(ReverseExpansionDirection);
251 
256  void SetFeatureScaling(ValueType v)
257  {
258  if (v != m_SegmentationFunction->GetPropagationWeight())
259  {
260  this->SetPropagationScaling(v);
261  }
262  if (v != m_SegmentationFunction->GetAdvectionWeight())
263  {
264  this->SetAdvectionScaling(v);
265  }
266  }
267 
270  void SetPropagationScaling(ValueType v)
271  {
272  if (v != m_SegmentationFunction->GetPropagationWeight())
273  {
274  m_SegmentationFunction->SetPropagationWeight(v);
275  }
276  }
277  ValueType GetPropagationScaling() const
278  {
279  return m_SegmentationFunction->GetPropagationWeight();
280  }
281 
284  void SetAdvectionScaling(ValueType v)
285  {
286  if (v != m_SegmentationFunction->GetAdvectionWeight())
287  {
288  m_SegmentationFunction->SetAdvectionWeight(v);
289  }
290  }
291  ValueType GetAdvectionScaling() const
292  {
293  return m_SegmentationFunction->GetAdvectionWeight();
294  }
295 
300  void SetCurvatureScaling(ValueType v)
301  {
302  if (v != m_SegmentationFunction->GetCurvatureWeight())
303  {
304  m_SegmentationFunction->SetCurvatureWeight(v);
305  }
306  }
307  ValueType GetCurvatureScaling() const
308  {
309  return m_SegmentationFunction->GetCurvatureWeight();
310  }
311 
314  virtual void SetSegmentationFunction(SegmentationFunctionType *s);
315  virtual SegmentationFunctionType *GetSegmentationFunction()
316  { return m_SegmentationFunction; }
317 
320  void SetMaximumIterations (unsigned int i)
321  {
322  itkWarningMacro("SetMaximumIterations is deprecated. Please use SetNumberOfIterations instead.");
323  this->SetNumberOfIterations(i);
324  }
325  unsigned int GetMaximumIterations()
326  {
327  itkWarningMacro("GetMaximumIterations is deprecated. Please use GetNumberOfIterations instead.");
328  return this->GetNumberOfIterations();
329  }
330 
331  virtual void SetMaximumRMSError(const double)
332  {
333  itkWarningMacro("The current implmentation of this solver does not compute maximum RMS change. The maximum RMS error value will not be set or used.");
334  }
335 
336 #ifdef ITK_USE_CONCEPT_CHECKING
337 
338  itkConceptMacro(OutputHasNumericTraitsCheck,
341 #endif
342 
343 protected:
346  NarrowBandLevelSetImageFilter(const Self &); //purposely not implemented
347 
348  virtual void PrintSelf(std::ostream& os, Indent indent) const;
349  void operator=(const Self&); //purposely not implemented
350 
352  virtual void InitializeIteration()
353  {
354  Superclass::InitializeIteration();
355  // Estimate the progress of the filter
356  this->SetProgress( (float) ((float)this->GetElapsedIterations()
357  / (float)this->GetNumberOfIterations()) );
358  }
359 
363  virtual void CreateNarrowBand ();
364 
367  void GenerateData();
368 
372 
379 
382 
383 private:
385 };
386 
387 } // end namespace itk
388 
389 #ifndef ITK_MANUAL_INSTANTIATION
391 #endif
392 
393 #endif

Generated at Sat Feb 2 2013 23:55:27 for Orfeo Toolbox with doxygen 1.8.1.1