ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkNarrowBandLevelSetImageFilter.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 itkNarrowBandLevelSetImageFilter_h
19 #define itkNarrowBandLevelSetImageFilter_h
20 
25 
26 namespace itk
27 {
142 template< typename TInputImage,
143  typename TFeatureImage,
144  typename TOutputPixelType = float,
145  typename TOutputImage = Image< TOutputPixelType,
146  TInputImage::ImageDimension > >
148  public NarrowBandImageFilterBase< TInputImage, TOutputImage >
149 {
150 public:
151 
157 
163 
165  typedef TOutputImage OutputImageType;
166  typedef TFeatureImage FeatureImageType;
167 
171 
174 
177 
180  virtual void SetFeatureImage(const FeatureImageType *f)
181  {
182  this->ProcessObject::SetNthInput( 1, const_cast< FeatureImageType * >( f ) );
184  }
186 
188  {
189  return ( static_cast< FeatureImageType * >( this->ProcessObject::GetInput(1) ) );
190  }
191 
195  {
196  this->SetInput(f);
197  }
198 
199  virtual const typename SegmentationFunctionType::ImageType * GetSpeedImage() const
201 
204 
209  {
210  itkWarningMacro(
211  << "SetUseNegativeFeaturesOn has been deprecated. Please use ReverseExpansionDirectionOn() instead");
213  }
215 
217  {
218  itkWarningMacro(
219  << "SetUseNegativeFeaturesOff has been deprecated. Please use ReverseExpansionDirectionOff() instead");
221  }
222 
226  {
227  itkWarningMacro(<< "SetUseNegativeFeatures has been deprecated. Please use SetReverseExpansionDirection instead");
228  if ( u == true )
229  {
230  this->SetReverseExpansionDirection(false);
231  }
232  else
233  {
234  this->SetReverseExpansionDirection(true);
235  }
236  }
238 
240  {
241  itkWarningMacro(<< "GetUseNegativeFeatures has been deprecated. Please use GetReverseExpansionDirection() instead");
242  if ( this->GetReverseExpansionDirection() == false )
243  {
244  return true;
245  }
246  else
247  {
248  return false;
249  }
250  }
251 
260  itkSetMacro(ReverseExpansionDirection, bool);
261  itkGetConstMacro(ReverseExpansionDirection, bool);
262  itkBooleanMacro(ReverseExpansionDirection);
264 
270  {
272  {
273  this->SetPropagationScaling(v);
274  }
276  {
277  this->SetAdvectionScaling(v);
278  }
279  }
281 
285  {
287  {
289  }
290  }
292 
294  {
296  }
297 
301  {
303  {
305  }
306  }
308 
310  {
312  }
313 
319  {
321  {
323  }
324  }
326 
328  {
330  }
331 
335 
337  { return m_SegmentationFunction; }
338 
341  void SetMaximumIterations(unsigned int i)
342  {
343  itkWarningMacro("SetMaximumIterations is deprecated. Please use SetNumberOfIterations instead.");
344  this->SetNumberOfIterations(i);
345  }
347 
348  unsigned int GetMaximumIterations()
349  {
350  itkWarningMacro("GetMaximumIterations is deprecated. Please use GetNumberOfIterations instead.");
351  return this->GetNumberOfIterations();
352  }
353 
354  virtual void SetMaximumRMSError(const double) ITK_OVERRIDE
355  {
356  itkWarningMacro(
357  "The current implmentation of this solver does not compute maximum RMS change. The maximum RMS error value will not be set or used.");
358  }
359 
360 #ifdef ITK_USE_CONCEPT_CHECKING
361  // Begin concept checking
362  itkConceptMacro( OutputHasNumericTraitsCheck,
364  // End concept checking
365 #endif
366 
367 protected:
370  NarrowBandLevelSetImageFilter(const Self &); //purposely not implemented
371 
372  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
373 
374  void operator=(const Self &); //purposely not implemented
375 
377  virtual void InitializeIteration() ITK_OVERRIDE
378  {
380  // Estimate the progress of the filter
381  this->UpdateProgress( (float)( (float)this->GetElapsedIterations()
382  / (float)this->GetNumberOfIterations() ) );
383  }
385 
389  virtual void CreateNarrowBand() ITK_OVERRIDE;
390 
393  void GenerateData() ITK_OVERRIDE;
394 
398 
404  typedef FastChamferDistanceImageFilter< OutputImageType, OutputImageType >
406 
408 
410 
411 private:
413 };
414 } // end namespace itk
415 
416 #ifndef ITK_MANUAL_INSTANTIATION
417 #include "itkNarrowBandLevelSetImageFilter.hxx"
418 #endif
419 
420 #endif
virtual void SetMaximumRMSError(const double) override
virtual const SegmentationFunctionType::VectorImageType * GetAdvectionImage() const
virtual void PrintSelf(std::ostream &os, Indent indent) const override
virtual void ReverseExpansionDirectionOn()
virtual void SetSegmentationFunction(SegmentationFunctionType *s)
Compute an approximate distance from an interpolated isocontour to the close grid points...
Superclass::InputImageType InputImageType
SegmentationFunctionType::VectorImageType VectorImageType
SegmentationLevelSetFunction< OutputImageType, FeatureImageType > SegmentationFunctionType
virtual const SegmentationFunctionType::ImageType * GetSpeedImage() const
This class compute the signed (positive and negative) chamfer distance in a narrow band...
virtual void SetInput(const InputImageType *image)
virtual void SetPropagationWeight(const ScalarValueType p)
virtual bool GetReverseExpansionDirection() const
NarrowBandImageFilterBase< TInputImage, TOutputImage > Superclass
virtual const IdentifierType & GetNumberOfIterations() const
void UpdateProgress(float progress)
Update the progress of the process object.
virtual void SetNumberOfIterations(IdentifierType _arg)
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
virtual void ReverseExpansionDirectionOff()
virtual void SetFeatureImage(const FeatureImageType *f)
virtual void SetFeatureImage(const FeatureImageType *f)
This class implements a multi-threaded finite difference image to image solver that can be applied to...
virtual void CreateNarrowBand() override
virtual void SetReverseExpansionDirection(bool _arg)
virtual void InitializeIteration() override
A base class which defines the API for implementing a special class of image segmentation filters usi...
Control indentation during Print() invocation.
Definition: itkIndent.h:49
ScalarValueType GetAdvectionWeight() const
typedef(Concept::HasNumericTraits< typename TOutputImage::PixelType >) OutputHasNumericTraitsCheck
virtual void SetNthInput(DataObjectPointerArraySizeType num, DataObject *input)
virtual void SetCurvatureWeight(const ScalarValueType c)
virtual void SetAdvectionWeight(const ScalarValueType a)
virtual VectorImageType * GetAdvectionImage() const
virtual const IdentifierType & GetElapsedIterations() const
ScalarValueType GetCurvatureWeight() const
#define itkConceptMacro(name, concept)
Templated n-dimensional image class.
Definition: itkImage.h:75
ScalarValueType GetPropagationWeight() const
virtual SegmentationFunctionType * GetSegmentationFunction()