UsTK : Ultrasound ToolKit  version 2.0.1 under development (2024-12-17)

#include <visp3/ustk_gui/us3DSceneWidget.h>

+ Inheritance diagram for us3DSceneWidget:

Public Slots

void updateImageData (vtkImageData *imageData)
 
void updateMatrix1 (vtkMatrix4x4 *matrix)
 
void updateMatrix2 (vtkMatrix4x4 *matrix)
 
void updateMatrix3 (vtkMatrix4x4 *matrix)
 

Signals

void plane1Changed ()
 
void plane2Changed ()
 
void plane3Changed ()
 

Public Member Functions

 us3DSceneWidget (QWidget *parent=NULL, Qt::WindowFlags f=Qt::WindowFlags())
 
 ~us3DSceneWidget ()
 
vtkPolyData * getContour1 ()
 
vtkPolyData * getContour2 ()
 
vtkPolyData * getContour3 ()
 
vtkImageData * getImageData ()
 
vtkPolyData * getMeshInPlane1 ()
 
vtkPolyData * getMeshInPlane2 ()
 
vtkPolyData * getMeshInPlane3 ()
 
vtkPlane * getPlane1 ()
 
vtkPlane * getPlane2 ()
 
vtkPlane * getPlane3 ()
 
void init ()
 
void paintEvent (QPaintEvent *event)
 
void setImageData (vtkImageData *imageData)
 
void setPlane1 (vtkPlane *plane)
 
void setPlane2 (vtkPlane *plane)
 
void setPlane3 (vtkPlane *plane)
 
void setPlanes (vtkPlane *plane1, vtkPlane *plane2, vtkPlane *plane3)
 

Detailed Description

Class used to render a 3D vtk scene containing a vtkImageData in a QWidget (based on QVTKWidget).

Usage :

#include <visp3/ustk_gui/us3DSceneWidget.h>
int main()
{
usImageIo::read(postScan3D, mhd_filename);
//conversion to vtk format
vtkSmartPointer<vtkImageData> vtkImage = vtkSmartPointer<vtkImageData>::New();
usVTKConverter::convert(postScan3D,vtkImage);
//setup view widget
scene.setImageData(vtkImage);
vtkSmartPointer<vtkPlane> planeX = vtkSmartPointer<vtkPlane>::New();
planeX->SetNormal(1,0,0);
planeX->SetOrigin(postScan3D.getDimX()/2,0,0);
vtkSmartPointer<vtkPlane> planeY = vtkSmartPointer<vtkPlane>::New();
planeY->SetNormal(0,1,0);
planeY->SetOrigin(0,postScan3D.getDimY()/2,0);
vtkSmartPointer<vtkPlane> planeZ = vtkSmartPointer<vtkPlane>::New();
planeZ->SetNormal(0,0,1);
planeZ->SetOrigin(0,0,postScan3D.getDimZ()/2);
scene.setPlanes(planeX,planeY,planeZ);
scene.init();
scene.show();
}
Class used to render a 3D vtk scene containing a vtkImageData in a QWidget (based on QVTKWidget).
void setPlanes(vtkPlane *plane1, vtkPlane *plane2, vtkPlane *plane3)
void setImageData(vtkImageData *imageData)
static void read(usImageRF2D< short int > &imageRf2D, const std::string &headerFileName)
Definition: usImageIo.cpp:153
static void convert(const usImagePostScan3D< unsigned char > &postScanImage, vtkSmartPointer< vtkImageData > &vtkPostScanImage, vtkSmartPointer< vtkImageImport > importer=NULL)
Examples
tutorial-ultrasonix-qt-grabbing-pre-scan3D-display.cpp.

Definition at line 119 of file us3DSceneWidget.h.

Constructor & Destructor Documentation

◆ us3DSceneWidget()

us3DSceneWidget::us3DSceneWidget ( QWidget *  parent = NULL,
Qt::WindowFlags  f = Qt::WindowFlags() 
)

Constructor.

Definition at line 71 of file us3DSceneWidget.cpp.

◆ ~us3DSceneWidget()

us3DSceneWidget::~us3DSceneWidget ( )
inline

Definition at line 125 of file us3DSceneWidget.h.

Member Function Documentation

◆ getContour1()

vtkPolyData * us3DSceneWidget::getContour1 ( )

Contour plane 1 getter.

Returns
Pointer on polydata of plane 1 contour.

Definition at line 337 of file us3DSceneWidget.cpp.

Referenced by usResliceMatrixViewer::usResliceMatrixViewer().

◆ getContour2()

vtkPolyData * us3DSceneWidget::getContour2 ( )

Contour plane 2 getter.

Returns
Pointer on polydata of plane 2 contour.

Definition at line 343 of file us3DSceneWidget.cpp.

Referenced by usResliceMatrixViewer::usResliceMatrixViewer().

◆ getContour3()

vtkPolyData * us3DSceneWidget::getContour3 ( )

Contour plane 3 getter.

Returns
Pointer on polydata of plane 3 contour.

Definition at line 349 of file us3DSceneWidget.cpp.

Referenced by usResliceMatrixViewer::usResliceMatrixViewer().

◆ getImageData()

vtkImageData * us3DSceneWidget::getImageData ( )

Getter for image data pointer

Returns
vtkImageData currently displayed

Definition at line 98 of file us3DSceneWidget.cpp.

◆ getMeshInPlane1()

vtkPolyData * us3DSceneWidget::getMeshInPlane1 ( )

Intersection between plane 1 and mesh.

Returns
Pointer on polydata of 2D mesh represenetation in plane 1.

Definition at line 355 of file us3DSceneWidget.cpp.

Referenced by usResliceMatrixViewer::usResliceMatrixViewer().

◆ getMeshInPlane2()

vtkPolyData * us3DSceneWidget::getMeshInPlane2 ( )

Intersection between plane 2 and mesh.

Returns
Pointer on polydata of 2D mesh represenetation in plane 2.

Definition at line 361 of file us3DSceneWidget.cpp.

Referenced by usResliceMatrixViewer::usResliceMatrixViewer().

◆ getMeshInPlane3()

vtkPolyData * us3DSceneWidget::getMeshInPlane3 ( )

Intersection between plane 3 and mesh.

Returns
Pointer on polydata of 2D mesh represenetation in plane 3.

Definition at line 367 of file us3DSceneWidget.cpp.

Referenced by usResliceMatrixViewer::usResliceMatrixViewer().

◆ getPlane1()

vtkPlane * us3DSceneWidget::getPlane1 ( )

Plane 1 getter.

Returns
Pointer on first vtkPlane.

Definition at line 319 of file us3DSceneWidget.cpp.

◆ getPlane2()

vtkPlane * us3DSceneWidget::getPlane2 ( )

Plane 2 getter.

Returns
Pointer on second vtkPlane.

Definition at line 325 of file us3DSceneWidget.cpp.

◆ getPlane3()

vtkPlane * us3DSceneWidget::getPlane3 ( )

Plane 3 getter.

Returns
Pointer on third vtkPlane.

Definition at line 331 of file us3DSceneWidget.cpp.

◆ init()

void us3DSceneWidget::init ( )

Init method : setup vtk pipeline. Make sure imageData and planes are set before calling init().

Examples
tutorial-ultrasonix-qt-grabbing-pre-scan3D-display.cpp.

Definition at line 103 of file us3DSceneWidget.cpp.

Referenced by us3DSceneSlicing::us3DSceneSlicing(), usMedicalImageViewer::usMedicalImageViewer(), and usResliceMatrixViewer::usResliceMatrixViewer().

◆ paintEvent()

void us3DSceneWidget::paintEvent ( QPaintEvent *  event)

Qt paint event overload if needed to update Qt widget

Parameters
eventQPaintEvent.

Definition at line 92 of file us3DSceneWidget.cpp.

References usViewerWidget::paintEvent().

◆ plane1Changed

void us3DSceneWidget::plane1Changed ( )
signal

Referenced by updateMatrix1().

◆ plane2Changed

void us3DSceneWidget::plane2Changed ( )
signal

Referenced by updateMatrix2().

◆ plane3Changed

void us3DSceneWidget::plane3Changed ( )
signal

Referenced by updateMatrix3().

◆ setImageData()

void us3DSceneWidget::setImageData ( vtkImageData *  imageData)

Image data setter.

Parameters
imageDataPointer on vtkImageData to display.
Examples
tutorial-ultrasonix-qt-grabbing-pre-scan3D-display.cpp.

Definition at line 280 of file us3DSceneWidget.cpp.

Referenced by us3DSceneSlicing::us3DSceneSlicing(), usMedicalImageViewer::usMedicalImageViewer(), and usResliceMatrixViewer::usResliceMatrixViewer().

◆ setPlane1()

void us3DSceneWidget::setPlane1 ( vtkPlane *  plane)

Plane 1 setter.

Parameters
planePointer on first vtkPlane.

Definition at line 302 of file us3DSceneWidget.cpp.

◆ setPlane2()

void us3DSceneWidget::setPlane2 ( vtkPlane *  plane)

Plane 2 setter.

Parameters
planePointer on second vtkPlane.

Definition at line 308 of file us3DSceneWidget.cpp.

◆ setPlane3()

void us3DSceneWidget::setPlane3 ( vtkPlane *  plane)

Plane 3 setter.

Parameters
planePointer on third vtkPlane.

Definition at line 314 of file us3DSceneWidget.cpp.

◆ setPlanes()

void us3DSceneWidget::setPlanes ( vtkPlane *  plane1,
vtkPlane *  plane2,
vtkPlane *  plane3 
)

All planes setter.

Parameters
plane1Pointer on first vtkPlane.
plane2Pointer on second vtkPlane.
plane3Pointer on third vtkPlane.
Examples
tutorial-ultrasonix-qt-grabbing-pre-scan3D-display.cpp.

Definition at line 375 of file us3DSceneWidget.cpp.

Referenced by us3DSceneSlicing::us3DSceneSlicing(), and usMedicalImageViewer::usMedicalImageViewer().

◆ updateImageData

void us3DSceneWidget::updateImageData ( vtkImageData *  imageData)
slot

Slot called to update image to display

Parameters
imageDataPointer to new image to display

Definition at line 386 of file us3DSceneWidget.cpp.

Referenced by usResliceMatrixViewer::openPostScan3D().

◆ updateMatrix1

void us3DSceneWidget::updateMatrix1 ( vtkMatrix4x4 *  matrix)
slot

Slot called to update plane 1 with new RT matrix

Parameters
matrixPointer to new orientation matrix.

Definition at line 418 of file us3DSceneWidget.cpp.

References usVTKConverter::convert(), and plane1Changed().

Referenced by usResliceMatrixViewer::ResetViews(), and usResliceMatrixViewer::usResliceMatrixViewer().

◆ updateMatrix2

void us3DSceneWidget::updateMatrix2 ( vtkMatrix4x4 *  matrix)
slot

Slot called to update plane 2 with new RT matrix

Parameters
matrixPointer to new orientation matrix.

Definition at line 456 of file us3DSceneWidget.cpp.

References usVTKConverter::convert(), and plane2Changed().

Referenced by usResliceMatrixViewer::ResetViews(), and usResliceMatrixViewer::usResliceMatrixViewer().

◆ updateMatrix3

void us3DSceneWidget::updateMatrix3 ( vtkMatrix4x4 *  matrix)
slot

Slot called to update plane 3 with new RT matrix

Parameters
matrixPointer to new orientation matrix.

Definition at line 494 of file us3DSceneWidget.cpp.

References usVTKConverter::convert(), and plane3Changed().

Referenced by usResliceMatrixViewer::ResetViews(), and usResliceMatrixViewer::usResliceMatrixViewer().