VTK
dox/Filters/Modeling/vtkDijkstraImageGeodesicPath.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkDijkstraImageGeodesicPath.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 =========================================================================*/
00052 #ifndef __vtkDijkstraImageGeodesicPath_h
00053 #define __vtkDijkstraImageGeodesicPath_h
00054 
00055 #include "vtkFiltersModelingModule.h" // For export macro
00056 #include "vtkDijkstraGraphGeodesicPath.h"
00057 
00058 class vtkImageData;
00059 
00060 class VTKFILTERSMODELING_EXPORT vtkDijkstraImageGeodesicPath :
00061                            public vtkDijkstraGraphGeodesicPath
00062 {
00063 public:
00064 
00066   static vtkDijkstraImageGeodesicPath *New();
00067 
00069 
00070   vtkTypeMacro( vtkDijkstraImageGeodesicPath, vtkDijkstraGraphGeodesicPath );
00071   void PrintSelf( ostream& os, vtkIndent indent );
00073 
00075 
00076   void SetInputData( vtkDataObject* );
00077   vtkImageData* GetInputAsImageData();
00079 
00081 
00082   void SetImageWeight( double );
00083   vtkGetMacro( ImageWeight, double );
00085 
00087 
00088   void SetEdgeLengthWeight( double );
00089   vtkGetMacro( EdgeLengthWeight, double );
00091 
00093 
00094   vtkSetClampMacro( CurvatureWeight, double, 0.0, 1.0 );
00095   vtkGetMacro( CurvatureWeight, double );
00097 
00098 protected:
00099   vtkDijkstraImageGeodesicPath();
00100   ~vtkDijkstraImageGeodesicPath();
00101 
00102   virtual int FillInputPortInformation(int port, vtkInformation *info);
00103   virtual int RequestData(vtkInformation *, vtkInformationVector **,
00104                           vtkInformationVector *);
00105 
00106   // Build a graph description of the image
00107   virtual void BuildAdjacency( vtkDataSet *inData );
00108 
00109   // Update static costs without rebuilding adjacencyh when static weights change
00110   void UpdateStaticCosts( vtkImageData *image );
00111 
00112   // Override parent class methods.
00113   virtual double CalculateStaticEdgeCost( vtkDataSet *inData , vtkIdType u, vtkIdType v);
00114   virtual double CalculateDynamicEdgeCost( vtkDataSet *inData , vtkIdType u, vtkIdType v);
00115 
00116   double PixelSize;
00117   double ImageWeight;
00118   double EdgeLengthWeight;
00119   double CurvatureWeight;
00120   bool RebuildStaticCosts;
00121 
00122 private:
00123   vtkDijkstraImageGeodesicPath(const vtkDijkstraImageGeodesicPath&);  // Not implemented.
00124   void operator=(const vtkDijkstraImageGeodesicPath&);  // Not implemented.
00125 
00126 };
00127 
00128 #endif
00129