X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FVisualization%2FMPRActors.h;h=91c0b5089d9e19eca6b90ba7a6bda710ae1f0be2;hb=dbc5b32e13cf4a299ce29a5666a8e0a2ff5e62a8;hp=01066b40d1fd03734199ee24e79c86b23dc70d47;hpb=ec99f46f898bfcd579161f1b2c28f8d9b2c8f333;p=cpPlugins.git diff --git a/lib/cpExtensions/Visualization/MPRActors.h b/lib/cpExtensions/Visualization/MPRActors.h index 01066b4..91c0b50 100644 --- a/lib/cpExtensions/Visualization/MPRActors.h +++ b/lib/cpExtensions/Visualization/MPRActors.h @@ -16,14 +16,18 @@ namespace cpExtensions public: typedef MPRActors Self; - typedef ImageSliceActors::TBaseStyle TBaseStyle; - typedef ImageSliceActors::TStyle TStyle; - typedef ImageSliceActors::TSlicesCommand TSlicesCommand; - typedef ImageSliceActors::TWindowLevelCommand TWindowLevelCommand; - typedef ImageSliceActors::TMouseCommand TMouseCommand; - typedef ImageSliceActors::TMouseWheelCommand TMouseWheelCommand; - typedef ImageSliceActors::TKeyCommand TKeyCommand; - typedef ImageSliceActors::TVoidCommand TVoidCommand; + typedef ImageSliceActors::TStyle TStyle; + typedef ImageSliceActors::TMouseCommand TMouseCommand; + typedef ImageSliceActors::TMouseWheelCommand TMouseWheelCommand; + typedef ImageSliceActors::TKeyCommand TKeyCommand; + typedef ImageSliceActors::TVoidCommand TVoidCommand; + typedef ImageSliceActors::TMouseMoveCommand TMouseMoveCommand; + typedef ImageSliceActors::TMouseClickCommand TMouseClickCommand; + typedef ImageSliceActors::TMouseDoubleClickCommand TMouseDoubleClickCommand; + typedef ImageSliceActors::TExposeCommand TExposeCommand; + typedef ImageSliceActors::TConfigureCommand TConfigureCommand; + typedef ImageSliceActors::TEnterCommand TEnterCommand; + typedef ImageSliceActors::TLeaveCommand TLeaveCommand; public: vtkTypeMacro( MPRActors, vtkPropCollection ); @@ -34,10 +38,27 @@ namespace cpExtensions ImageSliceActors* GetSliceActors( const int& i ) const; - int AddInputConnection( vtkAlgorithmOutput* aout ); - int AddInputData( vtkImageData* new_image ); + void SetInputConnection( vtkAlgorithmOutput* aout ); + void SetInputImage( vtkImageData* data ); + int AddBinaryConnection( + vtkAlgorithmOutput* aout, + const double& r, const double& g, const double& b + ); + int AddBinaryImage( + vtkImageData* data, + const double& r, const double& g, const double& b + ); + void Clear( ); + + vtkImageData* GetInputImage( ); + const vtkImageData* GetInputImage( ) const; + unsigned int GetNumberOfImages( ) const; + void SetInterpolate( bool v ); + void InterpolateOn( ); + void InterpolateOff( ); + void PushActorsInto( vtkRenderWindow* x, vtkRenderWindow* y, @@ -51,26 +72,37 @@ namespace cpExtensions vtkRenderWindow* w ); - // Color lookup table - void SetLookupTableAsColor( - unsigned int i, double r, double g, double b - ); - + double GetMinWindow( ) const; + double GetMaxWindow( ) const; + double GetMinLevel( ) const; + double GetMaxLevel( ) const; double GetWindow( ); double GetLevel( ); + void SetWindow( double w ); + void SetLevel( double l ); + void SetWindowLevel( double w, double l ); + void ResetWindowLevel( ); // Slice access + int GetSliceNumber( const int& axis ) const; int GetSliceNumberMinValue( const int& axis ) const; int GetSliceNumberMaxValue( const int& axis ) const; - int GetSlice( const int& axis ) const; - void SetSlice( const int& axis, const int& slice ); - void SetSlice( const int& axis, const double& slice ); - void ResetSlices( ); + void SetSliceNumber( const int& axis, const int& slice ); + void SetSlice( const int& axis, double* pos ); + void SetAxesCursor( const int& axis, double* pos ); + + // Rendering controls + void Render( const int& axis ); + void Render( ); + void ResetCamera( const int& axis ); + void ResetCameras( ); protected: MPRActors( ); virtual ~MPRActors( ); + void _CreateBoundingBox( ); + static void _SlicesCommand( double* pos, int axis, void* data ); static void _WindowLevelCommand( double window, double level, void* data