Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
18 
19 const std::string QmitkKinectParameterWidget::VIEW_ID = "org.mitk.views.qmitkkinectparameterwidget";
20 
21 QmitkKinectParameterWidget::QmitkKinectParameterWidget(QWidget* p, Qt::WindowFlags f): QWidget(p, f)
22 {
23  m_ToFImageGrabber = NULL;
24  m_Controls = NULL;
25  CreateQtPartControl(this);
26 }
27 
29 {
30 }
31 
33 {
34  if (!m_Controls)
35  {
36  // create GUI widgets
37  m_Controls = new Ui::QmitkKinectParameterWidgetControls;
38  m_Controls->setupUi(parent);
39 
40  this->CreateConnections();
41  }
42 }
43 
45 {
46  if ( m_Controls )
47  {
48  connect( m_Controls->m_RGB, SIGNAL(toggled(bool)), this, SLOT(OnAcquisitionModeChanged()) );
49  connect( m_Controls->m_IR, SIGNAL(toggled(bool)), this, SLOT(OnAcquisitionModeChanged()) );
50  connect( m_Controls->m_RGB, SIGNAL(toggled(bool)), this, SIGNAL(AcquisitionModeChanged()) );
51  connect( m_Controls->m_IR, SIGNAL(toggled(bool)), this, SIGNAL(AcquisitionModeChanged()) );
52  }
53 }
54 
56 {
57  return this->m_ToFImageGrabber;
58 }
59 
61 {
62  this->m_ToFImageGrabber = aToFImageGrabber;
63 }
64 
66 {
68 }
69 
71 {
72  if (m_ToFImageGrabber.IsNotNull())
73  {
74  if (!m_ToFImageGrabber->IsCameraConnected())
75  {
76  this->m_ToFImageGrabber->SetBoolProperty("RGB", m_Controls->m_RGB->isChecked());
77  this->m_ToFImageGrabber->SetBoolProperty("IR", m_Controls->m_IR->isChecked());
78  }
79  else
80  {
81  MITK_WARN << "Kinect Acquisition mode cannot be changed, if the device is connected. Please disconnect first.";
82  }
83  }
84 }
85 
87 {
88  return m_Controls->m_RGB->isChecked();
89 }
90 
92 {
93  return m_Controls->m_IR->isChecked();
94 }
95 
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:23
mitk::ToFImageGrabber::Pointer m_ToFImageGrabber
image grabber object to be configured by the widget
void SetToFImageGrabber(mitk::ToFImageGrabber *aToFImageGrabber)
sets the ToFImageGrabber
QmitkKinectParameterWidget(QWidget *p=0, Qt::WindowFlags f=0)
Image source providing ToF images. Interface for filters provided in ToFProcessing module...
void ActivateAllParameters()
activate camera settings according to the parameters from GUI