Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
QmitkKinectParameterWidget.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
14 
15 const std::string QmitkKinectParameterWidget::VIEW_ID = "org.mitk.views.qmitkkinectparameterwidget";
16 
17 QmitkKinectParameterWidget::QmitkKinectParameterWidget(QWidget* p, Qt::WindowFlags f): QWidget(p, f)
18 {
19  m_ToFImageGrabber = nullptr;
20  m_Controls = nullptr;
21  CreateQtPartControl(this);
22 }
23 
25 {
26 }
27 
29 {
30  if (!m_Controls)
31  {
32  // create GUI widgets
33  m_Controls = new Ui::QmitkKinectParameterWidgetControls;
34  m_Controls->setupUi(parent);
35 
36  this->CreateConnections();
37  }
38 }
39 
41 {
42  if ( m_Controls )
43  {
44  connect( m_Controls->m_RGB, SIGNAL(toggled(bool)), this, SLOT(OnAcquisitionModeChanged()) );
45  connect( m_Controls->m_IR, SIGNAL(toggled(bool)), this, SLOT(OnAcquisitionModeChanged()) );
46  connect( m_Controls->m_RGB, SIGNAL(toggled(bool)), this, SIGNAL(AcquisitionModeChanged()) );
47  connect( m_Controls->m_IR, SIGNAL(toggled(bool)), this, SIGNAL(AcquisitionModeChanged()) );
48  }
49 }
50 
52 {
53  return this->m_ToFImageGrabber;
54 }
55 
57 {
58  this->m_ToFImageGrabber = aToFImageGrabber;
59 }
60 
62 {
64 }
65 
67 {
68  if (m_ToFImageGrabber.IsNotNull())
69  {
70  if (!m_ToFImageGrabber->IsCameraConnected())
71  {
72  this->m_ToFImageGrabber->SetBoolProperty("RGB", m_Controls->m_RGB->isChecked());
73  this->m_ToFImageGrabber->SetBoolProperty("IR", m_Controls->m_IR->isChecked());
74  }
75  else
76  {
77  MITK_WARN << "Kinect Acquisition mode cannot be changed, if the device is connected. Please disconnect first.";
78  }
79  }
80 }
81 
83 {
84  return m_Controls->m_RGB->isChecked();
85 }
86 
88 {
89  return m_Controls->m_IR->isChecked();
90 }
91 
QmitkKinectParameterWidget(QWidget *p=nullptr, Qt::WindowFlags f=nullptr)
static const std::string VIEW_ID
Ui::QmitkKinectParameterWidgetControls * m_Controls
member holding the UI elements of this widget
virtual void CreateQtPartControl(QWidget *parent)
mitk::ToFImageGrabber * GetToFImageGrabber()
returns the ToFImageGrabber
#define MITK_WARN
Definition: mitkLogMacros.h:19
mitk::ToFImageGrabber::Pointer m_ToFImageGrabber
image grabber object to be configured by the widget
void SetToFImageGrabber(mitk::ToFImageGrabber *aToFImageGrabber)
sets the ToFImageGrabber
Image source providing ToF images. Interface for filters provided in ToFProcessing module...
void ActivateAllParameters()
activate camera settings according to the parameters from GUI