Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkZeppelinModelParametersWidget.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 
17 //Qmitk headers
19 #include <itkDiffusionTensor3D.h>
20 
21 const std::string QmitkZeppelinModelParametersWidget::VIEW_ID = "org.mitk.views.ZeppelinModelParameterswidget";
22 
24  : QWidget(parent)
25 {
26  m_Controls = nullptr;
27  this->CreateQtPartControl(this);
28 }
29 
31 {
32 }
33 
35 {
36  if (!m_Controls)
37  {
38  // create GUI widgets
39  m_Controls = new Ui::QmitkZeppelinModelParametersWidgetControls;
40  m_Controls->setupUi(parent);
41 
42  connect((QObject*) m_Controls->m_D1box, SIGNAL(valueChanged(double)), (QObject*) this, SLOT(DChanged(double)));
43  connect((QObject*) m_Controls->m_D2box, SIGNAL(valueChanged(double)), (QObject*) this, SLOT(DChanged(double)));
44 
45  UpdateUi();
46  }
47 }
48 
50 {
51  itk::DiffusionTensor3D<float> tensor;
52  tensor.Fill(0);
53  tensor.SetElement(0,m_Controls->m_D1box->value());
54  tensor.SetElement(3,m_Controls->m_D2box->value());
55  tensor.SetElement(5,m_Controls->m_D2box->value());
56  m_Controls->m_FaLabel->setText(QString::number(tensor.GetFractionalAnisotropy()));
57 }
58 
60 {
61  UpdateUi();
62 }
Ui::QmitkZeppelinModelParametersWidgetControls * m_Controls
QmitkZeppelinModelParametersWidget(QWidget *parent=nullptr, Qt::WindowFlags f=nullptr)