#ifndef _vtk_TensorManager_h_ #define _vtk_TensorManager_h_ #include #include #include #include #include #include #include #include "vtkTensorVisuManager.h" class VTK_EXPORT vtkTensorManager: public vtkObject { public: static vtkTensorManager *New(); vtkTypeRevisionMacro (vtkTensorManager, vtkObject); vtkSetObjectMacro (RenderWindowInteractor, vtkRenderWindowInteractor); vtkGetObjectMacro (RenderWindowInteractor, vtkRenderWindowInteractor); vtkSetObjectMacro (Input, vtkStructuredPoints); vtkGetObjectMacro (Input, vtkStructuredPoints); vtkGetObjectMacro (TensorVisuManagerAxial, vtkTensorVisuManager); vtkGetObjectMacro (TensorVisuManagerSagittal, vtkTensorVisuManager); vtkGetObjectMacro (TensorVisuManagerCoronal, vtkTensorVisuManager); /** Set the glyph shape */ void SetGlyphShape (int i); /** Set a specific glyph shape */ void SetGlyphShapeToLine (void); /** Set a specific glyph shape */ void SetGlyphShapeToDisk (void); /** Set a specific glyph shape */ void SetGlyphShapeToArrow (void); /** Set a specific glyph shape */ void SetGlyphShapeToCube (void); /** Set a specific glyph shape */ void SetGlyphShapeToCylinder (void); /** Set a specific glyph shape */ void SetGlyphShapeToSphere (void); /** Set a specific glyph shape */ void SetGlyphShapeToSuperquadric (void); /** Set a scaling factor for the glyhs. */ void SetGlyphScale(const float& f); /** Set a maximum size for the glyphs. The size is clamped to the maximum if it is over this value. */ void SetMaxGlyphSize(const float& f); /** Set the sample rate. 1 over n tensors will be displaid.*/ void SetSampleRate(const int&,const int&,const int&); /** Set the glyph resolution */ void SetGlyphResolution (int res); /** Set the scalar range for the LUT */ void SetScalarRange(const float&, const float&); /** Set the colormode to map the ith eigenvector. */ void SetColorModeToEigenvector( const int& ); /** Set the colormode to map the ith eigenvalue. */ void SetColorModeToEigenvalue( const int& ); /** Set the colormode to map the volume. */ void SetColorModeToVolume( void ); /** Set the colormode to map the trace. */ void SetColorModeToTrace( void ); /** Set the colormode to map the distance to the identity. */ void SetColorModeToDistanceToIdentity( void ); /** Set the colormode. */ void SetColorMode( const int& ); /** Flip tensors along the X axis */ void FlipX (bool a); /** Flip tensors along the Y axis */ void FlipY (bool a); /** Flip tensors along the Z axis */ void FlipZ (bool a); /** Set a user-defined LUT. */ void SetLookupTable (vtkLookupTable* lut); /** Set a scalar array to color the glyph with. */ void SetScalars (vtkDataArray* scalars); /** Generate the glyph and add them to the RenderWindowInteractor */ void Update (void); /** Remove the actors from the renderer. */ void Initialize (void); /** Set the current position in voxel coordinates. */ void SetCurrentPosition (const int&, const int&, const int&); /** Set the current position in voxel coordinates. */ void SetCurrentPosition (int pos[3]); /** Get the current position. */ const int* GetCurrentPosition (void) const { return this->CurrentPosition; } /** Get the current position. */ void GetCurrentPosition (int pos[3]) const { for( int i=0; i<3; i++) pos[i] = this->CurrentPosition[i]; } /** Reset the position to the center of the dataset. */ void ResetPosition (void); /** Set the Axial/Coronal/Sagittal slice visibility on or off. */ void SetAxialSliceVisibility (int); /** Set the Axial/Coronal/Sagittal slice visibility on or off. */ void SetSagittalSliceVisibility (int); /** Set the Axial/Coronal/Sagittal slice visibility on or off. */ void SetCoronalSliceVisibility (int); protected: vtkTensorManager(); ~vtkTensorManager(); private: vtkRenderWindowInteractor* RenderWindowInteractor; vtkStructuredPoints* Input; vtkTensorVisuManager* TensorVisuManagerAxial; vtkTensorVisuManager* TensorVisuManagerSagittal; vtkTensorVisuManager* TensorVisuManagerCoronal; int CurrentPosition[3]; }; #endif