Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkToFPointSetWidget Class Reference

Widget allowing interaction with point sets for measurement and PointSet definition. More...

#include <QmitkToFPointSetWidget.h>

Inheritance diagram for QmitkToFPointSetWidget:
Collaboration diagram for QmitkToFPointSetWidget:

Public Member Functions

 QmitkToFPointSetWidget (QWidget *p=0, Qt::WindowFlags f1=0)
 
virtual ~QmitkToFPointSetWidget ()
 
virtual void CreateQtPartControl (QWidget *parent)
 
virtual void CreateConnections ()
 
void InitializeWidget (QHash< QString, QmitkRenderWindow * > renderWindowHashMap, mitk::DataStorage::Pointer dataStorage, mitk::CameraIntrinsics::Pointer cameraIntrinsics=NULL)
 initializes the widget. Observers to the change events of the point sets are created, text actors are activated to be rendered into the foreground of the render window. More...
 
void CleanUpWidget ()
 cleans up the widget when it's functionality is not used anymore. Removes observers and deletes foreground renderer More...
 
void SetDistanceImage (mitk::Image::Pointer distanceImage)
 set the image holding the distance information used for measuring More...
 
void SetCameraIntrinsics (mitk::CameraIntrinsics::Pointer cameraIntrinsics)
 Set intrinsic parameters of the used device. More...
 

Static Public Attributes

static const std::string VIEW_ID
 

Protected Slots

void OnMeasurement ()
 Activates the interactor for the measurement point set. More...
 
void OnPointSet ()
 Activates the interactor for the point set. More...
 

Protected Member Functions

void MeasurementPointSetChanged ()
 function called when the 2D measurement PointSet has changed More...
 
void PointSetChanged ()
 function called when the 2D PointSet has changed More...
 

Protected Attributes

Ui::QmitkToFPointSetWidgetControls * m_Controls
 member holding the UI elements of this widget More...
 
mitk::DataStorage::Pointer m_DataStorage
 member holding the set DataStorage More...
 
mitk::Image::Pointer m_DistanceImage
 image holding the range data of the ToF camera More...
 
mitk::CameraIntrinsics::Pointer m_CameraIntrinsics
 intrinsic parameters of the camera More...
 
vtkSmartPointer< vtkTextActor > m_VtkTextActor
 actor containing the text of the overlay More...
 
vtkSmartPointer< vtkRenderer > m_ForegroundRenderer1
 renderer responsible for text rendering in the foreground of widget 1 More...
 
vtkSmartPointer< vtkRenderer > m_ForegroundRenderer2
 renderer responsible for text rendering in the foreground of widget 2 More...
 
vtkSmartPointer< vtkRenderer > m_ForegroundRenderer3
 renderer responsible for text rendering in the foreground of widget 3 More...
 
vtkSmartPointer< vtkRenderWindow > m_RenderWindow1
 vtk render window used for showing overlay in widget 1 More...
 
vtkSmartPointer< vtkRenderWindow > m_RenderWindow2
 vtk render window used for showing overlay in widget 2 More...
 
vtkSmartPointer< vtkRenderWindow > m_RenderWindow3
 vtk render window used for showing overlay in widget 3 More...
 
vtkSmartPointer< vtkRenderWindow > m_RenderWindow4
 vtk render window used for showing overlay in widget 3 More...
 
mitk::PointSet::Pointer m_MeasurementPointSet2D
 PointSet holding the 2D ToF image point selection used for measuring. More...
 
mitk::DataNode::Pointer m_MeasurementPointSet3DNode
 DataNode holding the 3D ToF coordinates used for measuring. More...
 
mitk::PointSet::Pointer m_PointSet2D
 PointSet holding the 2D ToF image points. More...
 
mitk::DataNode::Pointer m_PointSet3DNode
 DataNode holding the 3D ToF coordinates. More...
 
mitk::PointSetDataInteractor::Pointer m_PointSetInteractor
 PointSetInteractor used for PointSet definition. More...
 
mitk::PointSetDataInteractor::Pointer m_MeasurementPointSetInteractor
 PointSetInteractor used for measurement. More...
 
long m_MeasurementPointSetChangedObserverTag
 observer tag for measurement PointSet observer More...
 
long m_PointSetChangedObserverTag
 observer tag for PointSet observer More...
 
int m_WindowHeight
 Height of the renderWindow. More...
 

Detailed Description

Widget allowing interaction with point sets for measurement and PointSet definition.

The widget allows to

  1. Measure the distance between two points in 3D ToF space by clicking the points in the 2D slices
  2. Defining a ToF PointSet both in 2D and 3D. CameraIntrinsics are used for calculation between 2D and 3D

NOTE: You have to make sure that the widget is initialized at a position in the plugin using it, where the distance image is available. CleanUp has to be called to make sure that all observers and renderers are removed correctly.

Definition at line 52 of file QmitkToFPointSetWidget.h.

Constructor & Destructor Documentation

QmitkToFPointSetWidget::QmitkToFPointSetWidget ( QWidget *  p = 0,
Qt::WindowFlags  f1 = 0 
)

Definition at line 26 of file QmitkToFPointSetWidget.cpp.

References CreateQtPartControl(), and m_Controls.

QmitkToFPointSetWidget::~QmitkToFPointSetWidget ( )
virtual

Definition at line 51 of file QmitkToFPointSetWidget.cpp.

References CleanUpWidget().

Member Function Documentation

void QmitkToFPointSetWidget::CreateConnections ( )
virtual

Definition at line 68 of file QmitkToFPointSetWidget.cpp.

References m_Controls, OnMeasurement(), and OnPointSet().

Referenced by CreateQtPartControl().

void QmitkToFPointSetWidget::CreateQtPartControl ( QWidget *  parent)
virtual

Definition at line 56 of file QmitkToFPointSetWidget.cpp.

References CreateConnections(), and m_Controls.

Referenced by QmitkToFPointSetWidget().

void QmitkToFPointSetWidget::InitializeWidget ( QHash< QString, QmitkRenderWindow * >  renderWindowHashMap,
mitk::DataStorage::Pointer  dataStorage,
mitk::CameraIntrinsics::Pointer  cameraIntrinsics = NULL 
)

initializes the widget. Observers to the change events of the point sets are created, text actors are activated to be rendered into the foreground of the render window.

Parameters
stdMultiWidgetQmitkStdMultiWidget used for painting overlays for measurement
dataStorageDataStorage to add PointSets
distanceImagerange image used to calculate 3D PointSet from 2D index

Definition at line 77 of file QmitkToFPointSetWidget.cpp.

References mitk::VtkLayerController::GetInstance(), mitk::VtkLayerController::InsertForegroundRenderer(), m_CameraIntrinsics, m_Controls, m_DataStorage, m_ForegroundRenderer1, m_ForegroundRenderer2, m_ForegroundRenderer3, m_MeasurementPointSet2D, m_MeasurementPointSet3DNode, m_MeasurementPointSetChangedObserverTag, m_MeasurementPointSetInteractor, m_PointSet2D, m_PointSet3DNode, m_PointSetChangedObserverTag, m_PointSetInteractor, m_RenderWindow1, m_RenderWindow2, m_RenderWindow3, m_RenderWindow4, m_VtkTextActor, m_WindowHeight, MeasurementPointSetChanged(), mitk::New(), mitk::PointSetDataInteractor::New(), mitk::DataNode::New(), mitk::PointSet::New(), and PointSetChanged().

void QmitkToFPointSetWidget::MeasurementPointSetChanged ( )
protected
void QmitkToFPointSetWidget::OnMeasurement ( )
protectedslot

Activates the interactor for the measurement point set.

Definition at line 273 of file QmitkToFPointSetWidget.cpp.

References m_Controls, m_DataStorage, m_MeasurementPointSetInteractor, m_PointSetInteractor, m_VtkTextActor, and MeasurementPointSetChanged().

Referenced by CleanUpWidget(), and CreateConnections().

void QmitkToFPointSetWidget::OnPointSet ( )
protectedslot

Activates the interactor for the point set.

Definition at line 307 of file QmitkToFPointSetWidget.cpp.

References m_Controls, m_DataStorage, m_MeasurementPointSetInteractor, m_PointSetInteractor, m_VtkTextActor, and PointSetChanged().

Referenced by CleanUpWidget(), and CreateConnections().

void QmitkToFPointSetWidget::PointSetChanged ( )
protected
void QmitkToFPointSetWidget::SetCameraIntrinsics ( mitk::CameraIntrinsics::Pointer  cameraIntrinsics)

Set intrinsic parameters of the used device.

Definition at line 268 of file QmitkToFPointSetWidget.cpp.

References m_CameraIntrinsics.

void QmitkToFPointSetWidget::SetDistanceImage ( mitk::Image::Pointer  distanceImage)

set the image holding the distance information used for measuring

Definition at line 253 of file QmitkToFPointSetWidget.cpp.

References m_DistanceImage.

Member Data Documentation

mitk::CameraIntrinsics::Pointer QmitkToFPointSetWidget::m_CameraIntrinsics
protected

intrinsic parameters of the camera

Definition at line 119 of file QmitkToFPointSetWidget.h.

Referenced by InitializeWidget(), MeasurementPointSetChanged(), PointSetChanged(), and SetCameraIntrinsics().

Ui::QmitkToFPointSetWidgetControls* QmitkToFPointSetWidget::m_Controls
protected

member holding the UI elements of this widget

Definition at line 114 of file QmitkToFPointSetWidget.h.

Referenced by CleanUpWidget(), CreateConnections(), CreateQtPartControl(), InitializeWidget(), OnMeasurement(), OnPointSet(), and QmitkToFPointSetWidget().

mitk::DataStorage::Pointer QmitkToFPointSetWidget::m_DataStorage
protected

member holding the set DataStorage

Definition at line 116 of file QmitkToFPointSetWidget.h.

Referenced by InitializeWidget(), OnMeasurement(), and OnPointSet().

mitk::Image::Pointer QmitkToFPointSetWidget::m_DistanceImage
protected

image holding the range data of the ToF camera

Definition at line 118 of file QmitkToFPointSetWidget.h.

Referenced by MeasurementPointSetChanged(), PointSetChanged(), and SetDistanceImage().

vtkSmartPointer<vtkRenderer> QmitkToFPointSetWidget::m_ForegroundRenderer1
protected

renderer responsible for text rendering in the foreground of widget 1

Definition at line 122 of file QmitkToFPointSetWidget.h.

Referenced by CleanUpWidget(), and InitializeWidget().

vtkSmartPointer<vtkRenderer> QmitkToFPointSetWidget::m_ForegroundRenderer2
protected

renderer responsible for text rendering in the foreground of widget 2

Definition at line 123 of file QmitkToFPointSetWidget.h.

Referenced by CleanUpWidget(), and InitializeWidget().

vtkSmartPointer<vtkRenderer> QmitkToFPointSetWidget::m_ForegroundRenderer3
protected

renderer responsible for text rendering in the foreground of widget 3

Definition at line 124 of file QmitkToFPointSetWidget.h.

Referenced by CleanUpWidget(), and InitializeWidget().

mitk::PointSet::Pointer QmitkToFPointSetWidget::m_MeasurementPointSet2D
protected

PointSet holding the 2D ToF image point selection used for measuring.

Definition at line 130 of file QmitkToFPointSetWidget.h.

Referenced by CleanUpWidget(), InitializeWidget(), and MeasurementPointSetChanged().

mitk::DataNode::Pointer QmitkToFPointSetWidget::m_MeasurementPointSet3DNode
protected

DataNode holding the 3D ToF coordinates used for measuring.

Definition at line 131 of file QmitkToFPointSetWidget.h.

Referenced by InitializeWidget(), and MeasurementPointSetChanged().

long QmitkToFPointSetWidget::m_MeasurementPointSetChangedObserverTag
protected

observer tag for measurement PointSet observer

Definition at line 138 of file QmitkToFPointSetWidget.h.

Referenced by CleanUpWidget(), and InitializeWidget().

mitk::PointSetDataInteractor::Pointer QmitkToFPointSetWidget::m_MeasurementPointSetInteractor
protected

PointSetInteractor used for measurement.

Definition at line 136 of file QmitkToFPointSetWidget.h.

Referenced by InitializeWidget(), OnMeasurement(), and OnPointSet().

mitk::PointSet::Pointer QmitkToFPointSetWidget::m_PointSet2D
protected

PointSet holding the 2D ToF image points.

Definition at line 132 of file QmitkToFPointSetWidget.h.

Referenced by CleanUpWidget(), InitializeWidget(), and PointSetChanged().

mitk::DataNode::Pointer QmitkToFPointSetWidget::m_PointSet3DNode
protected

DataNode holding the 3D ToF coordinates.

Definition at line 133 of file QmitkToFPointSetWidget.h.

Referenced by InitializeWidget(), and PointSetChanged().

long QmitkToFPointSetWidget::m_PointSetChangedObserverTag
protected

observer tag for PointSet observer

Definition at line 139 of file QmitkToFPointSetWidget.h.

Referenced by CleanUpWidget(), and InitializeWidget().

mitk::PointSetDataInteractor::Pointer QmitkToFPointSetWidget::m_PointSetInteractor
protected

PointSetInteractor used for PointSet definition.

Definition at line 135 of file QmitkToFPointSetWidget.h.

Referenced by InitializeWidget(), OnMeasurement(), and OnPointSet().

vtkSmartPointer<vtkRenderWindow> QmitkToFPointSetWidget::m_RenderWindow1
protected

vtk render window used for showing overlay in widget 1

Definition at line 125 of file QmitkToFPointSetWidget.h.

Referenced by CleanUpWidget(), and InitializeWidget().

vtkSmartPointer<vtkRenderWindow> QmitkToFPointSetWidget::m_RenderWindow2
protected

vtk render window used for showing overlay in widget 2

Definition at line 126 of file QmitkToFPointSetWidget.h.

Referenced by CleanUpWidget(), and InitializeWidget().

vtkSmartPointer<vtkRenderWindow> QmitkToFPointSetWidget::m_RenderWindow3
protected

vtk render window used for showing overlay in widget 3

Definition at line 127 of file QmitkToFPointSetWidget.h.

Referenced by CleanUpWidget(), and InitializeWidget().

vtkSmartPointer<vtkRenderWindow> QmitkToFPointSetWidget::m_RenderWindow4
protected

vtk render window used for showing overlay in widget 3

Definition at line 128 of file QmitkToFPointSetWidget.h.

Referenced by InitializeWidget().

vtkSmartPointer<vtkTextActor> QmitkToFPointSetWidget::m_VtkTextActor
protected

actor containing the text of the overlay

Definition at line 121 of file QmitkToFPointSetWidget.h.

Referenced by InitializeWidget(), MeasurementPointSetChanged(), OnMeasurement(), OnPointSet(), and PointSetChanged().

int QmitkToFPointSetWidget::m_WindowHeight
protected

Height of the renderWindow.

Definition at line 142 of file QmitkToFPointSetWidget.h.

Referenced by InitializeWidget(), and MeasurementPointSetChanged().

const std::string QmitkToFPointSetWidget::VIEW_ID
static

Definition at line 59 of file QmitkToFPointSetWidget.h.


The documentation for this class was generated from the following files: