Orfeo Toolbox  4.0
itkSegmentationLevelSetImageFilter.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 __itkSegmentationLevelSetImageFilter_h
19 #define __itkSegmentationLevelSetImageFilter_h
20 
23 
24 namespace itk
25 {
142 template< typename TInputImage,
143  typename TFeatureImage,
144  typename TOutputPixelType = float >
146  public SparseFieldLevelSetImageFilter< TInputImage, Image< TOutputPixelType,
147  TInputImage::ImageDimension > >
148 {
149 public:
152 
153  //itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
154 
157 
162 
168 
170  typedef TFeatureImage FeatureImageType;
171 
175 
179 
182 
185  void SetMaximumIterations(unsigned int i)
186  {
187  itkWarningMacro("SetMaximumIterations is deprecated. Please use SetNumberOfIterations instead.");
188  this->SetNumberOfIterations(i);
189  }
190 
191  unsigned int GetMaximumIterations()
192  {
193  itkWarningMacro("GetMaximumIterations is deprecated. Please use GetNumberOfIterations instead.");
194  return this->GetNumberOfIterations();
195  }
196 
199  virtual void SetFeatureImage(const FeatureImageType *f)
200  {
201  this->ProcessObject::SetNthInput( 1, const_cast< FeatureImageType * >( f ) );
203  }
204 
206  { return ( static_cast< FeatureImageType * >( this->ProcessObject::GetInput(1) ) ); }
207 
211  {
212  this->SetInput(f);
213  }
214 
216  void SetInput2(const FeatureImageType *input)
217  {
218  this->SetFeatureImage(input);
219  }
220 
226 
232 
235  virtual const SpeedImageType * GetSpeedImage() const
237 
240  virtual const VectorImageType * GetAdvectionImage() const
242 
247  {
248  itkWarningMacro(
249  << "SetUseNegativeFeaturesOn has been deprecated. Please use ReverseExpansionDirectionOn() instead");
251  }
252 
254  {
255  itkWarningMacro(
256  << "SetUseNegativeFeaturesOff has been deprecated. Please use ReverseExpansionDirectionOff() instead");
258  }
259 
263  {
264  itkWarningMacro(<< "SetUseNegativeFeatures has been deprecated. Please use SetReverseExpansionDirection instead");
265  if ( u == true )
266  {
267  this->SetReverseExpansionDirection(false);
268  }
269  else
270  {
271  this->SetReverseExpansionDirection(true);
272  }
273  }
274 
276  {
277  itkWarningMacro(<< "GetUseNegativeFeatures has been deprecated. Please use GetReverseExpansionDirection() instead");
278  if ( m_ReverseExpansionDirection == false )
279  {
280  return true;
281  }
282  else
283  {
284  return false;
285  }
286  }
287 
296  itkSetMacro(ReverseExpansionDirection, bool);
297  itkGetConstMacro(ReverseExpansionDirection, bool);
298  itkBooleanMacro(ReverseExpansionDirection);
299 
305  itkSetMacro(AutoGenerateSpeedAdvection, bool);
306  itkGetConstMacro(AutoGenerateSpeedAdvection, bool);
307  itkBooleanMacro(AutoGenerateSpeedAdvection);
308 
314  {
316  {
317  this->SetPropagationScaling(v);
318  }
320  {
321  this->SetAdvectionScaling(v);
322  }
323  }
324 
328  {
330  {
332  this->Modified();
333  }
334  }
335 
337  {
339  }
340 
344  {
346  {
348  this->Modified();
349  }
350  }
351 
353  {
355  }
356 
362  {
364  {
366  this->Modified();
367  }
368  }
369 
371  {
373  }
374 
377  {
379  {
381  this->Modified();
382  }
383  }
384 
386  {
388  }
389 
391  {
392  this->SetUseMinimalCurvature(true);
393  }
394 
396  {
397  this->SetUseMinimalCurvature(false);
398  }
399 
406  {
408 
410  r.Fill(1);
411 
414  this->Modified();
415  }
416 
418  { return m_SegmentationFunction; }
419 
425  {
427  {
429  this->Modified();
430  }
431  }
432 
434  {
436  }
437 
443  {
445  {
447  this->Modified();
448  }
449  }
450 
452  {
454  }
455 
459  void GenerateSpeedImage();
460 
464  void GenerateAdvectionImage();
465 
466 #ifdef ITK_USE_CONCEPT_CHECKING
467  // Begin concept checking
468  itkConceptMacro( OutputHasNumericTraitsCheck,
470  // End concept checking
471 #endif
472 
473 protected:
476 
477  virtual void PrintSelf(std::ostream & os, Indent indent) const;
478 
480  virtual void InitializeIteration()
481  {
483  // Estimate the progress of the filter
484  this->UpdateProgress( (float)( (float)this->GetElapsedIterations()
485  / (float)this->GetNumberOfIterations() ) );
486  }
487 
490  void GenerateData();
491 
495 
501 
502 private:
503  SegmentationLevelSetImageFilter(const Self &); //purposely not implemented
504  void operator=(const Self &); //purposely not implemented
505 
507 };
508 } // end namespace itk
509 
510 #ifndef ITK_MANUAL_INSTANTIATION
512 #endif
513 
514 #endif

Generated at Sat Mar 8 2014 15:30:00 for Orfeo Toolbox with doxygen 1.8.3.1