UsTK : Ultrasound ToolKit
version 2.0.1 under development (2024-11-21)
|
#include <visp3/ustk_gui/us2DSceneWidget.h>
Public Slots | |
void | updateImageData (vtkImageData *imageData) |
void | changeMatrix (vpHomogeneousMatrix matrix) |
void | saveViewSlot () |
void | updateView () |
Signals | |
void | matrixChanged (vtkMatrix4x4 *matrix) |
void | voxelPicked (vpColVector vector) |
Public Member Functions | |
us2DSceneWidget (QWidget *parent=NULL, Qt::WindowFlags f=Qt::WindowFlags()) | |
~us2DSceneWidget () | |
void | drawLine (double u1, double v1, double w1, double u2, double v2, double w2) |
void | getClick (vpColVector &vec) |
void | getCurrentSlice (usImagePostScan2D< unsigned char > &image2D) |
vtkImageData * | getImageData () |
vtkMatrix4x4 * | getResliceMatrix () |
vtkPlane * | getReslicePlane () |
void | init () |
void | keyPressEvent (QKeyEvent *event) |
void | keyReleaseEvent (QKeyEvent *event) |
void | mouseMoveEvent (QMouseEvent *event) |
void | mousePressEvent (QMouseEvent *event) |
void | paintEvent (QPaintEvent *event) |
void | setColor (double r, double g, double b) |
void | setImageData (vtkImageData *imageData) |
void | setResliceMatrix (vtkMatrix4x4 *matrix) |
void | setPolyDataPlaneContour (vtkPolyData *polyData) |
void | setPolyDataMeshContour (vtkPolyData *polyData) |
void | wheelEvent (QWheelEvent *event) |
Class used to render a 2D slice of a vtkImageData in a vtk scene in a QWidget (based on QVTKWidget)
Definition at line 129 of file us2DSceneWidget.h.
us2DSceneWidget::us2DSceneWidget | ( | QWidget * | parent = NULL , |
Qt::WindowFlags | f = Qt::WindowFlags() |
||
) |
Constructor.
parent | The QWidget parent. |
f | Qt window flags. |
Definition at line 52 of file us2DSceneWidget.cpp.
|
inline |
Definition at line 135 of file us2DSceneWidget.h.
|
slot |
Orientation matrix update slot for vpMatrix.
matrix | The new matrix defining rotation and translation in image coordinates system. |
Definition at line 266 of file us2DSceneWidget.cpp.
References usVTKConverter::convert(), and matrixChanged().
void us2DSceneWidget::drawLine | ( | double | u1, |
double | v1, | ||
double | w1, | ||
double | u2, | ||
double | v2, | ||
double | w2 | ||
) |
Draw a red line between (u1,v1,w1) and (u2,v2,w2) over the image.
Definition at line 468 of file us2DSceneWidget.cpp.
References usVTKConverter::convert().
void us2DSceneWidget::getClick | ( | vpColVector & | vec | ) |
Blocking getClick method : waits for user to pick a voxel, and return the voxel coordinates in (u,v,w) coordinates system.
Definition at line 531 of file us2DSceneWidget.cpp.
References voxelPicked().
void us2DSceneWidget::getCurrentSlice | ( | usImagePostScan2D< unsigned char > & | image2D | ) |
Getter for current 2D slice.
[out] | image2D | Slice to extract. |
Definition at line 409 of file us2DSceneWidget.cpp.
References usVTKConverter::convert().
Referenced by usResliceMatrixViewer::getView1Slice().
vtkImageData * us2DSceneWidget::getImageData | ( | ) |
Image data getter.
Definition at line 99 of file us2DSceneWidget.cpp.
vtkMatrix4x4 * us2DSceneWidget::getResliceMatrix | ( | ) |
Homogeneous matrix getter.
Definition at line 105 of file us2DSceneWidget.cpp.
vtkPlane* us2DSceneWidget::getReslicePlane | ( | ) |
void us2DSceneWidget::init | ( | ) |
Init method, to call after image and matrix setters. Initializes the vtk workflow to display the image slice.
Definition at line 110 of file us2DSceneWidget.cpp.
Referenced by usResliceMatrixViewer::usResliceMatrixViewer().
void us2DSceneWidget::keyPressEvent | ( | QKeyEvent * | event | ) |
Key press event catcher. H key to enable rotation mode, P key to pick a voxel.
Definition at line 320 of file us2DSceneWidget.cpp.
void us2DSceneWidget::keyReleaseEvent | ( | QKeyEvent * | event | ) |
Key press event catcher. H key to enable rotation mode, P key to pick a voxel.
Definition at line 333 of file us2DSceneWidget.cpp.
|
signal |
Referenced by changeMatrix(), mouseMoveEvent(), and wheelEvent().
void us2DSceneWidget::mouseMoveEvent | ( | QMouseEvent * | event | ) |
Mouse move event catcher, used to calculate the rotation to apply on reslice view plane.
Definition at line 346 of file us2DSceneWidget.cpp.
References usVTKConverter::convert(), and matrixChanged().
void us2DSceneWidget::mousePressEvent | ( | QMouseEvent * | event | ) |
Mouse press event filter. Used to pick voxels.
Definition at line 427 of file us2DSceneWidget.cpp.
References usVTKConverter::convert(), and voxelPicked().
void us2DSceneWidget::paintEvent | ( | QPaintEvent * | event | ) |
Paint event catcher.
event | The event caught. |
Definition at line 93 of file us2DSceneWidget.cpp.
References usViewerWidget::paintEvent().
|
slot |
Slot to save the current image displayed in the view.
Definition at line 395 of file us2DSceneWidget.cpp.
References us::getDataSetPath().
void us2DSceneWidget::setColor | ( | double | r, |
double | g, | ||
double | b | ||
) |
Definition at line 459 of file us2DSceneWidget.cpp.
Referenced by usResliceMatrixViewer::usResliceMatrixViewer().
void us2DSceneWidget::setImageData | ( | vtkImageData * | imageData | ) |
Image setter.
imageData | The vtkImageData to display. |
Definition at line 170 of file us2DSceneWidget.cpp.
Referenced by usResliceMatrixViewer::usResliceMatrixViewer().
void us2DSceneWidget::setPolyDataMeshContour | ( | vtkPolyData * | polyData | ) |
Polydata mesh contour setter.
polyData | The vtk polydata representing the mesh contour in the plane. |
Definition at line 211 of file us2DSceneWidget.cpp.
References usVTKConverter::convert().
Referenced by usResliceMatrixViewer::usResliceMatrixViewer().
void us2DSceneWidget::setPolyDataPlaneContour | ( | vtkPolyData * | polyData | ) |
Polydata plane contour setter.
polyData | The vtk polydata representing the plane contour (image bounds). |
Definition at line 182 of file us2DSceneWidget.cpp.
References usVTKConverter::convert().
Referenced by usResliceMatrixViewer::usResliceMatrixViewer().
void us2DSceneWidget::setResliceMatrix | ( | vtkMatrix4x4 * | matrix | ) |
Orientation matrix setter.
matrix | The vtk matrix to place the reslice plane in the image coordinate system (rotation and translation). |
Definition at line 176 of file us2DSceneWidget.cpp.
Referenced by usResliceMatrixViewer::ResetViews(), and usResliceMatrixViewer::usResliceMatrixViewer().
|
slot |
Image update slot.
imageData | The new vtkImageData to display. |
Definition at line 240 of file us2DSceneWidget.cpp.
Referenced by usResliceMatrixViewer::openPostScan3D().
|
slot |
Slot used to recompute the view (if something shared changed in another view)
Definition at line 522 of file us2DSceneWidget.cpp.
|
signal |
Referenced by getClick(), and mousePressEvent().
void us2DSceneWidget::wheelEvent | ( | QWheelEvent * | event | ) |
Mouse wheel event catcher. Updates the translation along the plane normal.
Definition at line 276 of file us2DSceneWidget.cpp.
References usVTKConverter::convert(), and matrixChanged().