Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkTensorModelParametersWidget.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 QmitkTensorModelParametersWidget::VIEW_ID = "org.mitk.views.tensormodelparameterswidget";
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::QmitkTensorModelParametersWidgetControls;
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  connect((QObject*) m_Controls->m_D3box, SIGNAL(valueChanged(double)), (QObject*) this, SLOT(DChanged(double)));
45 
46  UpdateUi();
47  }
48 }
49 
51 {
52  itk::DiffusionTensor3D<float> tensor;
53  tensor.Fill(0);
54  tensor.SetElement(0,m_Controls->m_D1box->value());
55  tensor.SetElement(3,m_Controls->m_D2box->value());
56  tensor.SetElement(5,m_Controls->m_D3box->value());
57  m_Controls->m_FaLabel->setText(QString::number(tensor.GetFractionalAnisotropy()));
58 }
59 
61 {
62  UpdateUi();
63 }
QmitkTensorModelParametersWidget(QWidget *parent=nullptr, Qt::WindowFlags f=nullptr)
Ui::QmitkTensorModelParametersWidgetControls * m_Controls