MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
QmitkStructureSensorParameterWidget.cpp
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12
14
15const std::string QmitkStructureSensorParameterWidget::VIEW_ID = "org.mitk.views.qmitkStructureSensorparameterwidget";
16
18{
19 m_ToFImageGrabber = nullptr;
20 m_Controls = nullptr;
22}
23
27
29{
30 if (!m_Controls)
31 {
32 // create GUI widgets
33 m_Controls = new Ui::QmitkStructureSensorParameterWidgetControls;
34 m_Controls->setupUi(parent);
35
36 this->CreateConnections();
37 }
38}
39
41{
42 if ( m_Controls )
43 {
44 connect( m_Controls->m_640, SIGNAL(toggled(bool)), this, SLOT(OnResolutionChanged()) );
45 connect( m_Controls->m_320, SIGNAL(toggled(bool)), this, SLOT(OnResolutionChanged()) );
46 }
47}
48
53
55{
56 this->m_ToFImageGrabber = aToFImageGrabber;
57}
58
63
65{
66 if (m_ToFImageGrabber.IsNotNull())
67 {
68 if (!m_ToFImageGrabber->IsCameraConnected())
69 {
70 //for know depth and RGB resolution is the same, but this could be different in future
71 this->m_ToFImageGrabber->SetIntProperty("RGBResolution", GetSelectedResolution());
72 this->m_ToFImageGrabber->SetIntProperty("DepthResolution", GetSelectedResolution());
73 }
74 else
75 {
76 MITK_WARN << "Structure Sensor resolution cannot be changed, if the device is connected. Please disconnect first.";
77 }
78 }
79}
80
82{
83 if(m_Controls->m_640->isChecked())
84 {
85 return 640;
86 }
87 else if(m_Controls->m_320->isChecked())
88 {
89 return 320;
90 }
91 else
92 {
93 MITK_ERROR << "Unsupported structure sensor resolution!";
94 return -1;
95 }
96}
QmitkStructureSensorParameterWidget(QWidget *p=nullptr, Qt::WindowFlags f={})
void SetToFImageGrabber(mitk::ToFImageGrabber *aToFImageGrabber)
sets the ToFImageGrabber
mitk::ToFImageGrabber * GetToFImageGrabber()
returns the ToFImageGrabber
mitk::ToFImageGrabber::Pointer m_ToFImageGrabber
image grabber object to be configured by the widget
void OnResolutionChanged()
OnResolutionChanged called when the resolution combobox is changed.
Ui::QmitkStructureSensorParameterWidgetControls * m_Controls
member holding the UI elements of this widget
void ActivateAllParameters()
activate camera settings according to the parameters from GUI
int GetSelectedResolution()
GetSelectedResolution getter for 640/320 resolution.
Image source providing ToF images. Interface for filters provided in ToFProcessing module.