#ifndef _vtkViewImage2DWithTracer_h_ #define _vtkViewImage2DWithTracer_h_ #include #include // vtk includes #include #include #include #include #include class VTK_EXPORT vtkViewImage2DWithTracer: public vtkViewImage2D { public: static vtkViewImage2DWithTracer* New(); vtkTypeRevisionMacro(vtkViewImage2DWithTracer, vtkObject); virtual void SetInteractor (vtkRenderWindowInteractor*); void PrepareForDelete(void); /** Activate the manual tracing interactor */ void SetManualTracingOn (void) { this->TracerWidget->InteractionOn(); } /** De-activate the manual tracing interactor */ void SetManualTracingOff (void) { this->TracerWidget->InteractionOff(); } /** Switch on/off the manual tracing */ void SetManualTracingVisibility (bool a) { if(a) { this->TracerWidget->On(); } else { this->TracerWidget->Off(); } } virtual void SetImage(vtkImageData* image); /** This method takes the polydata generated by the tracing widget and transform it into a binary image, with the label/color specified by the user. */ void ValidateTracing (void); /** Set a new entry in the LUT */ void SetLUTValue (const int&, const double&, const double&, const double&, const double&); void SetCurrentLabel (const double& val) { this->CurrentLabel = val; if( val==0.0 ) { this->CurrentLabel = 255.0; // erase label } } vtkGetMacro (CurrentLabel, double); vtkGetObjectMacro (Tracing, vtkImageData); vtkGetObjectMacro (LUT, vtkLookupTable); vtkGetObjectMacro (TracerWidget, vtkImageTracerWidget); void PrintSelf(ostream& os, vtkIndent indent); protected: vtkViewImage2DWithTracer(); ~vtkViewImage2DWithTracer(); private: // for manual tracing vtkImageTracerWidgetCallback* TracerCbk; vtkImageTracerWidget* TracerWidget; vtkImageData* Tracing; vtkLookupTable* LUT; double CurrentLabel; }; #endif