68 #ifndef _vtkViewImage2D_h_
69 #define _vtkViewImage2D_h_
72 #include "MegaVTK2Configure.h"
77 #include "vtkTransform.h"
78 #include "vtkImageActor.h"
80 #include "vtkSmartPointer.h"
85 class vtkInteractorStyle;
86 class vtkInteractorStyleRubberBandZoom;
88 class vtkPointHandleRepresentation2D;
133 VIEW_ORIENTATION_SAGITTAL = 0,
134 VIEW_ORIENTATION_CORONAL = 1,
135 VIEW_ORIENTATION_AXIAL = 2
143 VIEW_CONVENTION_RADIOLOGICAL = 0,
144 VIEW_CONVENTION_NEUROLOGICAL = 1
154 INTERACTOR_STYLE_NAVIGATION = 0,
155 INTERACTOR_STYLE_RUBBER_ZOOM
209 virtual void SetViewOrientation(
int orientation);
225 virtual void SetViewConvention(
int convention);
231 virtual double * GetWorldCoordinatesForSlice(
int slice);
236 virtual int GetSliceForWorldCoordinates(
double pos[3]);
240 virtual void ResetPosition(
void);
245 virtual void Reset(
void);
266 virtual double *GetWorldCoordinatesFromDisplayPosition(
int xy[2]);
267 virtual double * GetWorldCoordinatesFromDisplayPosition(
const int & x,
284 virtual void SetInterpolate(
const int & val);
291 virtual int GetInterpolate();
308 virtual vtkActor * AddDataSet(vtkPolyData *polydata,
309 vtkProperty *property = NULL,
310 const bool & intersection =
true,
311 const bool & iDataVisibility =
false);
316 vtkSetVector3Macro(CameraMotionVector,
double);
322 vtkGetVector3Macro(CameraMotionVector,
double);
343 void SetCameraFocalAndPosition(
double focal[3],
double pos[3]);
350 void GetCameraFocalAndPosition(
double focal[3],
double pos[3]);
361 vtkGetVector3Macro (ViewCenter,
double);
367 { this->UpdateOrientation(); }
452 template<
class TContourContainer,
453 class TPropertyContainer >
455 TPropertyContainer & iProperty,
456 const bool & iIntersection =
true)
458 if ( iContours.size() != iProperty.size() )
460 vtkWarningMacro(<<
"iContours.size() != iProperty.size()");
464 typedef typename TContourContainer::iterator ContourContainerIterator;
465 typedef typename TPropertyContainer::iterator PropertyContainerIterator;
467 ContourContainerIterator contour_it = iContours.begin();
468 ContourContainerIterator contour_end = iContours.end();
470 PropertyContainerIterator prop_it = iProperty.begin();
471 PropertyContainerIterator prop_end = iProperty.end();
473 while ( contour_it != contour_end )
475 this->AddDataSet(*contour_it, *prop_it, iIntersection);
499 std::map<double, vtkActor *> ExtractActors(
500 vtkPolyData *iDataSet, ORIENTATION iOrientation);
507 virtual void UpdateSlicePlane(
void);
509 virtual void UpdateCenter(
void);
511 virtual void UpdateOrientation();
513 virtual void PostUpdateOrientation(
void);
515 virtual void SetSlicePlaneFromOrientation(
void);
517 virtual int SetCameraFromOrientation(
void);
519 virtual void SetAnnotationsFromOrientation(
void);
528 virtual void SetImplicitPlaneFromOrientation(
void);
537 virtual void UpdateCursor(
void);
546 virtual void InitializeSlicePlane(
void);
552 virtual void InstallPipeline(
void);
554 virtual int SetCameraToConvention(
void);
556 virtual void SetAnnotationToConvention(
void);
558 virtual void SetSlicePlaneToConvention(
unsigned int axis);
605 double ViewCenter[3];
607 char SliceAndWindowInformation[64];
608 char ImageInformation[64];
611 double CameraMotionVector[3];
vtkMatrix4x4 * ConventionMatrix
virtual void SetShowAnnotations(const int &iShowAnnotations)
Change the visibility of the annotations.
vtkSmartPointer< vtkPlane > SliceImplicitPlane
void AddContours(TContourContainer &iContours, TPropertyContainer &iProperty, const bool &iIntersection=true)
Add contours with specific properties to the view.
void SynchronizeViews(bool iSynchronize)
vtkViewImage2DCommand * Command
Access to the command of the viewer. This instance is in charge of observing the interactorstyle (Get...
vtkGetObjectMacro(CornerAnnotation, vtkCornerAnnotation)
Get the corner annotation.
void SynchronizeViews(bool iSynchronize)
void SetDefaultInteractionStyle(void)
Set interaction style to Default mode: Left button: Window level Right button: Zoom Middle button: Pa...
void SetPanInteractionStyle(void)
Set interaction style to Pan mode: All buttons: Pan.
void SetWorldCoordinates(const double &x, const double &y, const double &z)
Set the world coordinates.
Define the interactor behavior withing a vtkImage2D. 4 modes (Default, Zoom, Pan and Pick) ...
vtkPointHandleRepresentation2D * Cursor
Access to the actor corresponding to the cursor. It follows the mouse cursor everywhere it goes...
Text annotation in four corners.
virtual void Update(void)
Update the orientation.
void SetZoomInteractionStyle(void)
Set interaction style to Zoom mode: All buttons: Zoom.
vtkTypeRevisionMacro(vtkViewImage, vtkImageViewer2)
vtkGetMacro(ShowAnnotations, int)
Get the annotation status. 0: annotations are not visible 1: annotations are visible.
void SetPanMode()
Start the Pan Mode.
vtkInteractorStyleRubberBandZoom * InteractorStyleRubberZoom
InteractorStyle used in this view. It is a vtkInteractorStyleImage2D by default but can be set to vtk...
virtual void SetOrientationMatrix(vtkMatrix4x4 *matrix)
vtkOrientationAnnotation * OrientationAnnotation
Get the orientation annotation. This annotation describes the orientation of the slice plane...
This class is a top-level convenience class for displaying a scalar - or RGB image in a 2D or 3D scen...
virtual void Reset(void)
Reset position - zoom - window/level to default.
void SetZoomMode()
Start the Zoom Mode.
void SetPickInteractionStyle(void)
Set interaction style to Zoom mode: The actor the mouse is highlighted in addition to the Default Mod...
virtual void SetSlice(int iSlice)
Set/Get the current slice to display (depending on the orientation this can be in X...
vtkBooleanMacro(ShowAnnotations, int)
Set the annotation status. 0: annotations are not visible 1: annotations are visible.
vtkSetMacro(IntersectionLineWidth, float)
Set the linewidth for added dataset in the scene (when using AddDataSet)
vtkCursor2D * CursorGenerator
Access to the actor corresponding to the cursor. It follows the mouse cursor everywhere it goes...
void SetPickMode()
Start the Pick Mode.
void SetDefaultMode()
Start the Default Mode.
vtkPolyData * SlicePlane
This polydata instance is a square colored (see InitializeSlicePlane()) according to the orientation ...
vtkInteractorStyle * InteractorStyleSwitcher
Manage events occuring in 2D view.
Basic class to handle 2D/3D items such as images and polydatas visualization in 2D.
virtual void ResetCamera(void)
Reset the camera.