VTK
dox/Graphics/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 "vtkDijkstraGraphGeodesicPath.h"
00056 
00057 class vtkImageData;
00058 
00059 class VTK_GRAPHICS_EXPORT vtkDijkstraImageGeodesicPath :
00060                            public vtkDijkstraGraphGeodesicPath
00061 {
00062 public:
00063 
00065   static vtkDijkstraImageGeodesicPath *New();
00066 
00068 
00069   vtkTypeMacro( vtkDijkstraImageGeodesicPath, vtkDijkstraGraphGeodesicPath );
00070   void PrintSelf( ostream& os, vtkIndent indent );
00072   
00074 
00075   void SetInput( vtkDataObject* );
00076   vtkImageData* GetInputAsImageData();
00078 
00080 
00081   void SetImageWeight( double );
00082   vtkGetMacro( ImageWeight, double );
00084 
00086 
00087   void SetEdgeLengthWeight( double );
00088   vtkGetMacro( EdgeLengthWeight, double );
00090 
00092 
00093   vtkSetClampMacro( CurvatureWeight, double, 0.0, 1.0 );
00094   vtkGetMacro( CurvatureWeight, double );
00096 
00097 protected:
00098   vtkDijkstraImageGeodesicPath();
00099   ~vtkDijkstraImageGeodesicPath();
00100 
00101   virtual int FillInputPortInformation(int port, vtkInformation *info);
00102   virtual int RequestData(vtkInformation *, vtkInformationVector **, 
00103                           vtkInformationVector *);
00104 
00105   // Build a graph description of the image
00106   virtual void BuildAdjacency( vtkDataSet *inData );
00107   
00108   // Update static costs without rebuilding adjacencyh when static weights change
00109   void UpdateStaticCosts( vtkImageData *image );
00110 
00111   // Override parent class methods.
00112   virtual double CalculateStaticEdgeCost( vtkDataSet *inData , vtkIdType u, vtkIdType v);
00113   virtual double CalculateDynamicEdgeCost( vtkDataSet *inData , vtkIdType u, vtkIdType v);
00114 
00115   double PixelSize;
00116   double ImageWeight;
00117   double EdgeLengthWeight;
00118   double CurvatureWeight;
00119   bool RebuildStaticCosts;
00120 
00121 private:
00122   vtkDijkstraImageGeodesicPath(const vtkDijkstraImageGeodesicPath&);  // Not implemented.
00123   void operator=(const vtkDijkstraImageGeodesicPath&);  // Not implemented.
00124 
00125 };
00126 
00127 #endif
00128