#include <vtkSmartPointer.h>
#include <vtkActor.h>
#include <vtkImageActor.h>
+#include <vtkImageMapToColors.h>
#include <vtkImageSliceMapper.h>
#include <vtkPlane.h>
#include <vtkPolyData.h>
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 );
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 );
ImageSliceActors( );
virtual ~ImageSliceActors( );
+ void _ConfigureNewLUT( vtkImageData* data, LUTType lut_t );
void _ConfigureNewInput( int axis );
// Events
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;
char TextBuffer[ 1024 ];
vtkSmartPointer< vtkTextActor > TextActor;
vtkSmartPointer< vtkActor > PlaneActor;
+
+ double StartWindowLevelPos[ 3 ];
+ double StartWindowLevel[ 2 ];
};
} // ecapseman