|
VivoQuant 6.0.1
|
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 | setEnableOrthographicProjection (bool toEnable) |
| enable or disable orthographic projection | |
| 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 | resetCamera (camNormal normal=camfront) |
| Reset the camera position to a specified normal direction By default it resets to the front view. | |
| void | resetCameraToCustomPosition () |
| Reset the 3D view camera to the first position in a custom camera position sequence, if defined. Otherwise no orientation change will occur. | |
| void | rotateCamera (double azimuth, double elevation) |
| Rotates the active camera around its focal point using azimuth and elevation. | |
| void | getCameraRotation (double &azimuth, double &elevation) |
| Computes the current camera rotation angles around the focal point. | |
| void | getPanOffset (double &dx, double &dy) |
| Computes the pan offset of the camera relative to a reference camera. | |
| void | setPanOffset (double dx, double dy) |
| Apply pan offsets relative to the reference camera. | |
| 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 | setCameraDistance (double targetDistance) |
| Move the camera to a specified distance from the focal point. | |
| double | getCameraDistance () |
| Get the current distance of the camera from the focal point. | |
| double | getReferenceDefaultDistance () |
| Get the starting default distance of the camera from the focal point. | |
| void | setCameraSplineMovement (QList< Variant > locations, bool closeSpline=true) |
| Set camera to move on the spline defined by user parameters. | |
| void | setCameraSplineMovement (QList< QList< double > > &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 | forceRenderingMode (int mode) |
| Sets the rendering mode for the MIP and related projection methods. CPU should be choosen as a last resort due to it's performance. Most modern GPUs should support GPU mode. Restrictions on GPU memory may force you to have to choose CPU. | |
| 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 | setCornerOrEdgeLabel (string text, int location) |
| Sets corner label on the VTK view Be aware that VQ may overwrite the corner label for it's own status messages to the user. | |
| void | setMPRPlanes (int planes) |
| turn on and off MPR palne | |
| 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.
| void forceRenderingMode | ( | int | mode | ) |
Sets the rendering mode for the MIP and related projection methods. CPU should be choosen as a last resort due to it's performance. Most modern GPUs should support GPU mode. Restrictions on GPU memory may force you to have to choose CPU.
| mode | 0: Default, in configuration, 1: CPU based ray tracing, 2: GPU based ray tracing |
| void getCameraRotation | ( | double & | azimuth, |
| double & | elevation | ||
| ) |
Computes the current camera rotation angles around the focal point.
This function calculates the azimuth and elevation of the active camera relative to its focal point. The azimuth is measured in the XY-plane from the X-axis, and elevation is measured from the XY-plane toward the Z-axis.
| [out] | azimuth | The horizontal rotation angle in degrees [0, 360). |
| [out] | elevation | The vertical rotation angle in degrees [-90, 90]. |
| string getCameraSplineMovement | ( | ) |
get camera to move on the spline defined by user parameters
| void getPanOffset | ( | double & | dx, |
| double & | dy | ||
| ) |
Computes the pan offset of the camera relative to a reference camera.
| dx | [out] offset along the camera's right vector (positive = right) |
| dy | [out] offset along the camera's up vector (positive = up) |
| string getPresetName | ( | Index | idx | ) |
Get the secified color function preset name.
| name | The data index to get the preset name from |
| double getReferenceDefaultDistance | ( | ) |
Get the starting default distance of the camera from the focal point.
| 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 resetCamera | ( | camNormal | normal = camfront | ) |
Reset the camera position to a specified normal direction By default it resets to the front view.
| normal | direction to reset the camera view to |
| void restoreVTKViewerStatus | ( | string | str | ) |
restore VTKViewer status from a text file
| output | filename and path |
| void rotateCamera | ( | double | azimuth, |
| double | elevation | ||
| ) |
Rotates the active camera around its focal point using azimuth and elevation.
This function updates the orientation of the active VTK camera by applying relative azimuth and elevation rotations about the camera's focal point. The provided azimuth and elevation values are treated as absolute target angles; internally, the function computes the required delta rotations and applies them incrementally using vtkCamera::Azimuth() and vtkCamera::Elevation().
The focal point is preserved implicitly by VTK's camera rotation methods. No roll is applied, and the camera's view-up vector is not re-orthogonalized, allowing for stable incremental interaction without introducing axis drift.
| azimuth | Target azimuth angle in degrees. Positive values rotate the camera clockwise around its view-up vector. |
| elevation | Target elevation angle in degrees. Positive values tilt the camera upward about its right vector. |
| 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 setCameraDistance | ( | double | targetDistance | ) |
Move the camera to a specified distance from the focal point.
| targetDistance |
| 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< QList< double > > & | 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 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 setCornerOrEdgeLabel | ( | string | text, |
| int | location | ||
| ) |
Sets corner label on the VTK view Be aware that VQ may overwrite the corner label for it's own status messages to the user.
| The | text to display in the corner |
| The | locaton: 0 - LowerLeft 1 - LowerRight 2 - UpperLeft 3 - UpperRight 4 - LowerEdge 5 - RightEdge 6 - LeftEdge 7 - UpperEdge |
| 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
| The | plane: 0. all off
|
| void setPanOffset | ( | double | dx, |
| double | dy | ||
| ) |
Apply pan offsets relative to the reference camera.
| dx | Horizontal offset along camera's right vector |
| dy | Vertical offset along camera's up vector |
| 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 |