68 #ifndef _vtkViewImage_h_
69 #define _vtkViewImage_h_
71 #include "MegaVTK2Configure.h"
72 #include "vtkImageViewer2.h"
74 #include <vtkRenderer.h>
75 #include <vtkTextProperty.h>
76 #include <vtkCornerAnnotation.h>
78 #include <vtkDataSet.h>
89 #define vtkSetObjectMacro2Body(object, type, _arg) \
90 if ( this->object == _arg ) { return; } \
93 this->object->UnRegister(this); \
95 this->object = _arg; \
97 if ( this->object != NULL ) \
99 this->object->Register(this); \
112 #define vtkSetObjectMacro2(object, type) \
113 virtual void Set ## object (type * _arg) \
115 vtkSetObjectMacro2Body (object, type, _arg); \
121 class vtkScalarBarActor;
122 class vtkLookupTable;
123 class vtkTextProperty;
124 class vtkCornerAnnotation;
131 class vtkMatrixToLinearTransform;
132 class vtkRenderWindowInteractor;
134 class vtkInteractorStyle;
135 class vtkColorTransferFunction;
139 class vtkScalarsToColors;
188 virtual void SetInput(vtkImageData *input);
192 virtual void Render(
void);
197 virtual vtkRenderWindowInteractor * GetInteractor();
199 virtual vtkRenderWindowInteractor * GetRenderWindowInteractor();
206 vtkGetObjectMacro(CornerAnnotation, vtkCornerAnnotation);
211 vtkGetObjectMacro(ScalarBarActor, vtkScalarBarActor);
229 vtkGetObjectMacro(OrientationMatrix, vtkMatrix4x4);
230 virtual void SetOrientationMatrix(vtkMatrix4x4 *matrix);
237 vtkGetObjectMacro(LookupTable, vtkLookupTable);
238 virtual void SetLookupTable(vtkLookupTable *lookuptable);
247 vtkGetObjectMacro(TextProperty, vtkTextProperty);
248 virtual void SetTextProperty(vtkTextProperty *textproperty);
262 void SetWorldCoordinates(
const double & x,
263 const double & y,
const double & z);
265 virtual void SetWorldCoordinates(
double pos[3]) = 0;
278 int *range = this->GetSliceRange();
281 if (iSlice < range[0])
285 else if (iSlice > range[1])
291 if (this->Slice == iSlice)
296 this->Slice = iSlice;
299 this->UpdateDisplayExtent();
308 virtual double *GetWorldCoordinatesFromImageCoordinates(
int indices[3]);
312 virtual int *GetImageCoordinatesFromWorldCoordinates(
double position[3]);
317 virtual double GetValueAtPosition(
double worldcoordinates[3],
323 virtual void SetBackground(
double rgb[3]);
324 virtual void SetBackground(
const double & r,
328 virtual double * GetBackground(
void);
333 virtual void ResetCamera(
void);
339 void SetCameraPosition(
double *arg);
345 double * GetCameraPosition(
void);
352 void SetCameraFocalPoint(
double *arg);
359 double * GetCameraFocalPoint(
void);
366 void SetCameraViewUp(
double *arg);
373 double * GetCameraViewUp(
void);
379 void SetCameraParallelScale(
double arg);
385 double GetCameraParallelScale(
void);
390 virtual void Reset(
void);
397 vtkBooleanMacro (ShowAnnotations,
int);
404 vtkGetMacro (ShowAnnotations,
int);
411 virtual void SetShowAnnotations(
const int & iShowAnnotations);
416 virtual void Enable(
void);
421 virtual void Disable(
void);
426 virtual bool GetEnabled(
void);
433 vtkBooleanMacro(ShowScalarBar,
int);
440 vtkGetMacro(ShowScalarBar,
int);
444 virtual void SetShowScalarBar(
const bool &);
447 virtual void SetColorWindow(
double s);
449 virtual void SetColorLevel(
double s);
454 virtual void ResetWindowLevel(
void);
456 void UpdateWindowLevel();
466 {
return this->CurrentPoint; }
477 point[0] = this->CurrentPoint[0];
478 point[1] = this->CurrentPoint[1];
479 point[2] = this->CurrentPoint[2];
487 vtkGetMacro(IsColor,
bool);
490 vtkSetMacro( IntersectionLineWidth,
float );
493 vtkGetMacro( IntersectionLineWidth,
float );
495 void SetWindow(
double iWindow);
498 void SetLevel(
double iLevel);
552 std::string DirectionAnnotationMatrix[3][2];
566 double CurrentPoint[3];
float IntersectionLineWidth
vtkTextProperty * TextProperty
Text annotation in four corners.
vtkScalarBarActor * ScalarBarActor
void GetCurrentPoint(double point[3])
Get the current position in world coordinate.
This class is a top-level convenience class for displaying a scalar - or RGB image in a 2D or 3D scen...
virtual void Update(void)
vtkMatrix4x4 * OrientationMatrix
vtkMatrixToLinearTransform * OrientationTransform
vtkCornerAnnotation * CornerAnnotation
virtual void SetSlice(int iSlice)
Set/Get the current slice to display (depending on the orientation this can be in X...
double * GetCurrentPoint(void)
Get the current position in world coordinate.
vtkLookupTable * LookupTable