VivoQuant
|
Object for controling the VTK Viewer. More...
#include <VTKController.h>
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. | |
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). | |
void | panCamera (double x, double y) |
Pan camera horizontally and vertically. | |
void | zoomCamera (double z) |
Zoom in or Zoom out camera. | |
void | setCameraPosition (double x, double y, double z) |
set camera position in Cartesian coordinates | |
void | setCameraSplineMovement (QList< Variant > locations, bool closeSpline=true) |
Set camera to move on the spline defined by user parameters. | |
string | getCameraSplineMovement () |
get camera to move on the spline defined by user parameters | |
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; 2: RayCastRenderMode 4: GPURenderMode. | |
void | resetColorControls () |
Sets all color controls back to their defaults. | |
void | setActiveVolume (int idx) |
Set the current active volume. | |
int | currentActiveVolume () |
Get the current active volume index. | |
bool | isClippingEnabled () |
Get the status of the volume clipping. | |
bool | isClippingBoundingBoxEnabled () |
Get the status of the clipping bounding boxes. | |
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. | |
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. | |
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. | |
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. | |
void | disableAxes (bool b=true) |
enable or disable Axes in vtk | |
void | setMPRPlanes (int planes) |
turn on and off MPR palne 0. all off | |
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 | |
void | saveVTKViewerStatus (string str) |
save all current VTKViewer status in a text file, including view angle, distance, annotation text, orientation widget, rendering mode ... | |
void | restoreVTKViewerStatus (string str) |
restore VTKViewer status from a text file | |
bool | setPreset (Index idx, string name) |
Set the specified color function preset. | |
string | getPresetName (Index idx) |
Get the secified color function preset name. | |
bool | createPreset (string name, bool quiet=false) |
Create a preset from the current color function selection. | |
bool | removePreset (string name) |
Remove the specified preset from the list. | |
void | setViewAngleRange (int nbSteps) |
Set the range of the view angle slider [0 nbSteps]. | |
int | getViewAngleRange () |
Get the range of the view angle slider. | |
void | setViewAnglePos (int pos) |
Set the view angle slider position inside to the range. | |
int | getViewAnglePos () |
Get the view angle slider positio. | |
void | enableClipping (bool isEnabled) |
Enable or disable the volume clipping. | |
void | enableClippingBoundingBox (bool toEnable) |
Enable or disable the clipping bounding box. | |
Object for controling the VTK Viewer.
See also ScriptMaster::vtkController() to obtain this object.
bool createPreset | ( | string | name, |
bool | quiet = false |
||
) |
Create a preset from the current color function selection.
name | The name of the preset |
quiet | Do not prompt message box if preset already exist, forces overwrite. |
int currentActiveVolume | ( | ) |
Get the current active volume index.
void enableClipping | ( | bool | isEnabled | ) |
Enable or disable the volume clipping.
isEnabled | True if enabled, false otherwise |
void enableClippingBoundingBox | ( | bool | toEnable | ) |
Enable or disable the clipping bounding box.
isEnabled | True if enabled, false otherwise |
|
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.
string getCameraSplineMovement | ( | ) |
get camera to move on the spline defined by user parameters
string getPresetName | ( | Index | idx | ) |
Get the secified color function preset name.
name | The data index to get the preset name from |
bool isClippingBoundingBoxEnabled | ( | ) |
Get the status of the clipping bounding boxes.
bool isClippingEnabled | ( | ) |
Get the status of the volume clipping.
void panCamera | ( | double | x, |
double | y | ||
) |
Pan camera horizontally and vertically.
x | shift distance along X-Axis (a scale factor: 0 ? 300 in percentage, the base unit distance is DimX * PixelSizeX) |
y | shift distance along Y-Axis (a scale factor: 0 ? 300 in percentage, the base unit distance is DimY * PixelSizeY) |
bool removePreset | ( | string | name | ) |
Remove the specified preset from the list.
name | The preset name |
void restoreVTKViewerStatus | ( | string | str | ) |
restore VTKViewer status from a text file
output | filename and path |
void rotateCamera | ( | int | x, |
int | y, | ||
int | z | ||
) |
rotate the camera around the object (focus point).
x | degree along X-axis (0-359) degree |
y | degree along Y-axis (0-359) degree |
z | degree along Z-axis (0-359) degree |
void saveVTKViewerStatus | ( | string | str | ) |
save all current VTKViewer status in a text file, including view angle, distance, annotation text, orientation widget, rendering mode ...
output | filename and path |
void setActiveVolume | ( | int | idx | ) |
Set the current active volume.
idx | The index of the volume. |
void setCameraPosition | ( | double | x, |
double | y, | ||
double | z | ||
) |
set camera position in Cartesian coordinates
x | coordinate in x axis |
y | coordinate in y axis |
z | coordinate in z axis |
void setCameraSplineMovement | ( | QList< Variant > | locations, |
bool | closeSpline = true |
||
) |
Set camera to move on the spline defined by user parameters.
locations | A list of points specifying camera location. The function will use these points to calculate the spline. The points are arrays with either four elements for spherical (theta, phi, roll, radius) coordinates or three elements for Cartesian (x, y, z) coordinates. |
closeSpline | Whether the spine is closed |
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.
angle | The angle in degrees |
void setMPRPlanes | ( | int | planes | ) |
turn on and off MPR palne 0. all off
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.
passBand | The pass band |
bool setPreset | ( | Index | idx, |
string | name | ||
) |
Set the specified color function preset.
name | The data index to apply to preset to |
name | The name of the preset |
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
imgRange | must be between 0.0 -> 1.0 |
opacityRange | must be between 0.0 -> 1.0 |
void setSmoothingIterations | ( | int | iter | ) |
Sets the number of iterations done by vtkWindowedSincPolyDataFilter. More iterations create smoother ROI surfaces. Default value is 15.
iter | The number of iterations |
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.
double | The speed factor |
void setViewAnglePos | ( | int | pos | ) |
Set the view angle slider position inside to the range.
pos | The position |
void setViewAngleRange | ( | int | nbSteps | ) |
Set the range of the view angle slider [0 nbSteps].
nbSteps | The range in steps |
void zoomCamera | ( | double | z | ) |
Zoom in or Zoom out camera.
z | distance to focus point (a scale factor: 0 ? 300 in percentage, the base unit distance is the default distance |