VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkImageAnisotropicDiffusion2D.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00042 #ifndef __vtkImageAnisotropicDiffusion2D_h 00043 #define __vtkImageAnisotropicDiffusion2D_h 00044 00045 00046 #include "vtkImagingGeneralModule.h" // For export macro 00047 #include "vtkImageSpatialAlgorithm.h" 00048 class VTKIMAGINGGENERAL_EXPORT vtkImageAnisotropicDiffusion2D : public vtkImageSpatialAlgorithm 00049 { 00050 public: 00051 static vtkImageAnisotropicDiffusion2D *New(); 00052 vtkTypeMacro(vtkImageAnisotropicDiffusion2D,vtkImageSpatialAlgorithm); 00053 void PrintSelf(ostream& os, vtkIndent indent); 00054 00060 void SetNumberOfIterations(int num); 00061 00063 00064 vtkGetMacro(NumberOfIterations,int); 00066 00068 00073 vtkSetMacro(DiffusionThreshold,double); 00074 vtkGetMacro(DiffusionThreshold,double); 00076 00078 00082 vtkSetMacro(DiffusionFactor,double); 00083 vtkGetMacro(DiffusionFactor,double); 00085 00087 00088 vtkSetMacro(Faces,int); 00089 vtkGetMacro(Faces,int); 00090 vtkBooleanMacro(Faces,int); 00091 vtkSetMacro(Edges,int); 00092 vtkGetMacro(Edges,int); 00093 vtkBooleanMacro(Edges,int); 00094 vtkSetMacro(Corners,int); 00095 vtkGetMacro(Corners,int); 00096 vtkBooleanMacro(Corners,int); 00098 00100 00102 vtkSetMacro(GradientMagnitudeThreshold,int); 00103 vtkGetMacro(GradientMagnitudeThreshold,int); 00104 vtkBooleanMacro(GradientMagnitudeThreshold,int); 00106 00107 protected: 00108 vtkImageAnisotropicDiffusion2D(); 00109 ~vtkImageAnisotropicDiffusion2D() {} 00110 00111 int NumberOfIterations; 00112 double DiffusionThreshold; 00113 double DiffusionFactor; 00114 // to determine which neighbors to diffuse 00115 int Faces; 00116 int Edges; 00117 int Corners; 00118 // What threshold to use 00119 int GradientMagnitudeThreshold; 00120 00121 void ThreadedRequestData(vtkInformation *request, 00122 vtkInformationVector **inputVector, 00123 vtkInformationVector *outputVector, 00124 vtkImageData ***inData, vtkImageData **outData, 00125 int extent[6], int id); 00126 void Iterate(vtkImageData *in, vtkImageData *out, 00127 double ar0, double ar1, int *coreExtent, int count); 00128 private: 00129 vtkImageAnisotropicDiffusion2D(const vtkImageAnisotropicDiffusion2D&); // Not implemented. 00130 void operator=(const vtkImageAnisotropicDiffusion2D&); // Not implemented. 00131 }; 00132 00133 #endif 00134 00135 00136