VivoQuant
Public Slots | Public Member Functions | List of all members
VTKController Class Reference

Object for controling the VTK Viewer. More...

Public Slots

void forceRender ()
 force refresh the VTKViwer if vtk status is not up to date. Example use case: after loading a ROI in 3D ROI operator but ROI in VTKViewer is not shown. More...
 
void rotateZ (float angle)
 rotation VTK object with angle in degree
 
void setEnableGradientBackground (bool toEnable)
 enable or disable gray background
 
void setMIPEnabled (bool toEnable)
 enable or disable MIP volume
 
void setMPREnabled (bool toEnable)
 enable or disable MPR view
 
void setCrosshairMode (bool toEnable)
 enable or disable crosshair
 
void setAutoUpdate (bool toEnable)
 enable autoUpdate, with autoUpdate On. user do not need to call forceRender() or updateVolumeColors() after make changes
 

Public Member Functions

void rotateCamera (int x, int y, int z)
 rotate the camera around the object (focus point). More...
 
void panCamera (double x, double y)
 Pan camera horizontally and vertically. More...
 
void zoomCamera (double z)
 Zoom in or Zoom out camera. More...
 
void setCameraPosition (double x, double y, double z)
 set camera position in carsetian coordinate More...
 
void setCameraSplineMovement (QList< Variant > locations, bool closeSpline=true)
 set camera to move on the spline defined by user parameters More...
 
string getCameraSplineMovement ()
 get camera to move on the spline defined by user parameters More...
 
bool getMIPEnabled ()
 Check if VTK Volume Rendering(Max Intensity Projection) is enabled.
 
bool getMPREnabled ()
 Check if VTK Multiplanar Reconstruction is enabled.
 
bool getAnnotationEnabled ()
 Check if VTK Annottation text is enabled.
 
void setAnnotationEnabled (bool toEnable)
 Enable or disable VTK Annottation text. Enable or disable The image Toggle indicator(before 4.0Invicro1) Use VQ.MainWin().switchShowActive(bool) in later version.
 
bool getOrientEnabled ()
 Check if VTK orientation widget is enabled.
 
void setOrientEnabled (bool toEnable)
 Enable or disable VTK orientation widget.
 
string getRenderSpeed ()
 return rendering quality.
 
string getAnnotationModel ()
 get current orientation widget model name
 
void forceVolumeMapperMode (int mode)
 Sets requested volume rendering mode. Options are: 0: Default, in configuration; 1: CPU 2: GPU.
 
void resetColorControls ()
 Sets all color controls back to their defaults.
 
void setStillUpdateRate (double factor)
 Sets update speed for volume rendering. Factor can be interpreted as "Frames/sec". In summary: larger factor=faster rendering, smaller factor=slower rendering. More...
 
bool getAutoUpdate ()
 returns the state of automatic rendering
 
void setSmoothingIterations (int iter)
 Sets the number of iterations done by vtkWindowedSincPolyDataFilter. More iterations create smoother ROI surfaces. Default value is 15. More...
 
void setFeatureAngle (double angle)
 Sets the feature angle for the vtkWindowedSincPolyDataFilter. A feature edge occurs when the angle between the two surface normals of a polygon sharing an edge is greater than the FeatureAngle. Default value is 120 degrees. More...
 
void setPassBand (double passBand)
 Sets the pass band used by vtkWindowedSincPolyDataFilter. By design, the PassBand is specified as a doubleing point number between 0 and 2. Lower PassBand values produce more smoothing. Default value is 0.001. More...
 
void disableAxes (bool b=true)
 enable or disable Axes in vtk
 
void setMPRPlanes (int planes)
 turn on and off MPR palne 0. all off More...
 
void setScalarOpacityPoints (int imgIdx, QList< Variant > imgRange, QList< Variant > opacityRange)
 setOpacityPoints sets the opacity piece-wise function for the VTK MIP's volume pixel opacities More...
 
void saveVTKViewerStatus (string str)
 save all current VTKViewer status in a text file, including view angle, distance, annotation text, orientation widget, rendering mode ... More...
 
void restoreVTKViewerStatus (string str)
 restore VTKViewer status from a text file More...
 
bool setPreset (Index idx, string name)
 Set the specified color function preset. More...
 
string getPresetName (Index idx)
 Get the secified color function preset name. More...
 
bool createPreset (string name, bool quiet=false)
 Create a preset from the current color function selection. More...
 
bool removePreset (string name)
 Remove the specified preset from the list. More...
 
void setViewAngleRange (int nbSteps)
 Set the range of the view angle slider [0 nbSteps]. More...
 
int getViewAngleRange ()
 Get the range of the view angle slider.
 
void setViewAnglePos (int pos)
 Set the view angle slider position inside to the range. More...
 
int getViewAnglePos ()
 Get the view angle slider positio.
 

Detailed Description

Object for controling the VTK Viewer.

See also ScriptMaster::vtkController() to obtain this object.

Member Function Documentation

◆ createPreset()

bool createPreset ( string  name,
bool  quiet = false 
)

Create a preset from the current color function selection.

Parameters
nameThe name of the preset
quietDo not prompt message box if preset already exist, forces overwrite.

◆ forceRender

void forceRender ( )
slot

force refresh the VTKViwer if vtk status is not up to date. Example use case: after loading a ROI in 3D ROI operator but ROI in VTKViewer is not shown.

Note
example: VQ.vtkController().forceRender();

◆ getCameraSplineMovement()

string getCameraSplineMovement ( )

get camera to move on the spline defined by user parameters

Returns
return spline points defined in string format

◆ getPresetName()

string getPresetName ( Index  idx)

Get the secified color function preset name.

Parameters
nameThe data index to get the preset name from
Returns
The name of the preset

◆ panCamera()

void panCamera ( double  x,
double  y 
)

Pan camera horizontally and vertically.

Parameters
xshift distance along X-Axis (a scale factor: 0 ? 300 in percentage, the base unit distance is DimX * PixelSizeX)
yshift distance along Y-Axis (a scale factor: 0 ? 300 in percentage, the base unit distance is DimY * PixelSizeY)

◆ removePreset()

bool removePreset ( string  name)

Remove the specified preset from the list.

Parameters
nameThe preset name

◆ restoreVTKViewerStatus()

void restoreVTKViewerStatus ( string  str)

restore VTKViewer status from a text file

Parameters
outputfilename and path
Note
example: var path = "C:\status.txt"; VQ.vtkController().restoreVTKViewerStatus( path );

◆ rotateCamera()

void rotateCamera ( int  x,
int  y,
int  z 
)

rotate the camera around the object (focus point).

Parameters
xdegree along X-axis (0-359) degree
ydegree along Y-axis (0-359) degree
zdegree along Z-axis (0-359) degree

◆ saveVTKViewerStatus()

void saveVTKViewerStatus ( string  str)

save all current VTKViewer status in a text file, including view angle, distance, annotation text, orientation widget, rendering mode ...

Parameters
outputfilename and path
Note
example: var path = "C:\status.txt"; VQ.vtkController().saveVTKViewerStatus( path );

◆ setCameraPosition()

void setCameraPosition ( double  x,
double  y,
double  z 
)

set camera position in carsetian coordinate

Parameters
xcoordinate in x axis
ycoordinate in y axis
zcoordinate in z axis

◆ setCameraSplineMovement()

void setCameraSplineMovement ( QList< Variant >  locations,
bool  closeSpline = true 
)

set camera to move on the spline defined by user parameters

Parameters
locationsuser defined camera location, the function will use these points to calculate spline (the points are defined by polar coordination system, the each points consists of 4 parameters, they are degreeX, degreeY, degreeZ, ZoomFactor).
closeSplineclose spline or not

◆ setFeatureAngle()

void setFeatureAngle ( double  angle)

Sets the feature angle for the vtkWindowedSincPolyDataFilter. A feature edge occurs when the angle between the two surface normals of a polygon sharing an edge is greater than the FeatureAngle. Default value is 120 degrees.

Parameters
doubleangle (degrees)

◆ setMPRPlanes()

void setMPRPlanes ( int  planes)

turn on and off MPR palne 0. all off

  1. sagittal
  2. coronal
  3. sagittal & coronal
  4. transverse
  5. transervse & sagittal
  6. transervse & coronal
  7. all on

◆ setPassBand()

void setPassBand ( double  passBand)

Sets the pass band used by vtkWindowedSincPolyDataFilter. By design, the PassBand is specified as a doubleing point number between 0 and 2. Lower PassBand values produce more smoothing. Default value is 0.001.

Parameters
doublepassBand

◆ setPreset()

bool setPreset ( Index  idx,
string  name 
)

Set the specified color function preset.

Parameters
nameThe data index to apply to preset to
nameThe name of the preset

◆ setScalarOpacityPoints()

void setScalarOpacityPoints ( int  imgIdx,
QList< Variant >  imgRange,
QList< Variant >  opacityRange 
)

setOpacityPoints sets the opacity piece-wise function for the VTK MIP's volume pixel opacities

Parameters
imgRangemust be between 0.0 -> 1.0
opacityRangemust be between 0.0 -> 1.0

◆ setSmoothingIterations()

void setSmoothingIterations ( int  iter)

Sets the number of iterations done by vtkWindowedSincPolyDataFilter. More iterations create smoother ROI surfaces. Default value is 15.

Parameters
intnumber of iterations

◆ setStillUpdateRate()

void setStillUpdateRate ( double  factor)

Sets update speed for volume rendering. Factor can be interpreted as "Frames/sec". In summary: larger factor=faster rendering, smaller factor=slower rendering.

Parameters
doublefactor

◆ setViewAnglePos()

void setViewAnglePos ( int  pos)

Set the view angle slider position inside to the range.

Parameters
posThe position

◆ setViewAngleRange()

void setViewAngleRange ( int  nbSteps)

Set the range of the view angle slider [0 nbSteps].

Parameters
nbStepsThe range in steps

◆ zoomCamera()

void zoomCamera ( double  z)

Zoom in or Zoom out camera.

Parameters
zdistance to focus point (a scale factor: 0 ? 300 in percentage, the base unit distance is the default distance