X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FVisualization%2FImageSliceActors.h;h=962c8f2b0cf0b2388981f949b1be19f85d768236;hb=9586180ab9da1ba2778099482b0231b933192719;hp=6322d18ca515df66878d2f3805722c0cdd94c69f;hpb=bb3fccd7f20a919f7058c27dd34ff82be6866ce6;p=cpPlugins.git diff --git a/lib/cpExtensions/Visualization/ImageSliceActors.h b/lib/cpExtensions/Visualization/ImageSliceActors.h index 6322d18..962c8f2 100644 --- a/lib/cpExtensions/Visualization/ImageSliceActors.h +++ b/lib/cpExtensions/Visualization/ImageSliceActors.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -35,21 +36,40 @@ namespace cpExtensions public: typedef ImageSliceActors Self; + typedef void ( *TCursorCommand )( double*, int, void* ); + public: vtkTypeMacro( ImageSliceActors, vtkPropCollection ); + enum LUTType + { + LUTType_None = 0, + LUTType_WindowLevel, + LUTType_Colors + }; + public: // Creation static ImageSliceActors* New( ); - void AddInputConnection( vtkAlgorithmOutput* aout, int axis = 2 ); - void AddInputData( vtkImageData* data, int axis = 2 ); + void AddInputConnection( + vtkAlgorithmOutput* aout, + int axis = 2, + LUTType lut = Self::LUTType_None + ); + void AddInputData( + vtkImageData* data, + int axis = 2, + LUTType lut = Self::LUTType_None ); void Clear( ); + void AssociateSlice( Self* other ); + void SetSlicesCommand( TCursorCommand cmd, void* data ); + vtkInteractorStyle* GetStyle( ); const vtkInteractorStyle* GetStyle( ) const; - void PushActorsInto( vtkRenderWindow* window ); + void PushActorsInto( vtkRenderWindow* window, bool force_style = true ); void PopActorsFrom( vtkRenderWindow* window ); unsigned int GetNumberOfImageActors( ) const; vtkImageActor* GetImageActor( unsigned int id ); @@ -74,11 +94,22 @@ namespace cpExtensions void ResetCursor( ); void SetCursor( double pos[ 3 ] ); + vtkImageMapToColors* GetImageMap( unsigned int id ); + const vtkImageMapToColors* GetImageMap( unsigned int id ) const; + + double GetWindow( unsigned int id ) const; + double GetLevel( unsigned int id ) const; + void SetWindow( unsigned int id, double w ); + void SetLevel( unsigned int id, double l ); + void SetWindowLevel( unsigned int id, double w, double l ); + void ResetWindowLevel( unsigned int id ); + int GetAxis( ) const; int GetSliceNumber( ) const; int GetSliceNumberMinValue( ) const; int GetSliceNumberMaxValue( ) const; void SetSliceNumber( const int& slice ); + void SetSlice( double* pos ); void UpdateText( ); void UpdateText( double pos[ 3 ] ); void UpdateText( const double& w, const double& l ); @@ -87,6 +118,7 @@ namespace cpExtensions ImageSliceActors( ); virtual ~ImageSliceActors( ); + void _ConfigureNewLUT( vtkImageData* data, LUTType lut_t ); void _ConfigureNewInput( int axis ); // Events @@ -123,10 +155,16 @@ namespace cpExtensions vtkSmartPointer< ImageInteractorStyle > Style; // Multiple actors + std::vector< vtkSmartPointer< vtkImageMapToColors > > ImageMaps; std::vector< vtkSmartPointer< vtkImageSliceMapper > > SliceMappers; std::vector< vtkSmartPointer< vtkImageActor > > ImageActors; bool Interpolate; + // Other associated slices + std::vector< vtkSmartPointer< Self > > AssociatedSlices; + TCursorCommand SlicesCommand; + void* SlicesData; + // Other associated actors typedef std::pair< vtkAlgorithm*, vtkActor* > TAssociatedActor; typedef std::vector< TAssociatedActor > TAssociatedActors; @@ -142,6 +180,9 @@ namespace cpExtensions char TextBuffer[ 1024 ]; vtkSmartPointer< vtkTextActor > TextActor; vtkSmartPointer< vtkActor > PlaneActor; + + double StartWindowLevelPos[ 3 ]; + double StartWindowLevel[ 2 ]; }; } // ecapseman