Page MenuHomePhabricator

QmitkStentBundleView.cpp

Authored By
vonsachsen
Oct 20 2010, 12:36 PM
Size
51 KB
Referenced Files
None
Subscribers
None

QmitkStentBundleView.cpp

This document is not UTF8. It was detected as ISO-8859-1 (Latin 1) and converted to UTF8 for display.
/*=========================================================================
Program: Medical Imaging & Interaction Toolkit
Language: C++
Date: $Date: 2010-03-31 16:40:27 +0200 (Mi, 31 Mrz 2010) $
Version: $Revision: 21975 $
Copyright (c) German Cancer Research Center, Division of Medical and
Biological Informatics. All rights reserved.
See MITKCopyright.txt or http://www.mitk.org/copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
// Blueberry
#include <berryISelectionService.h>
#include <berryIWorkbenchWindow.h>
// Qmitk
#include "QmitkStentBundleView.h"
#include "QmitkStdMultiWidget.h"
// Qt
#include <QMessageBox>
/***********************************************
*
*************************************************/
#include <mitkSTLFileReader.h>
#include <mitkSurface.h>
#include "QmitkRegisterClasses.h"
#include "mitkPicFileReader.h"
/*********************************************
* Histogram
**********************************************/
#include "result_plot.h"
/*********************************************
* 3D calculated model
**********************************************/
#include "ansysFEMresults.h"
#include "vtkDataSetMapper.h"
#include "vtkPolyDataMapper.h"
#include "vtkActor.h"
#include "vtkCamera.h"
#include "vtkDoubleArray.h"
#include "vtkPointData.h"
#include "vtkPoints.h"
#include "vtkProperty.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderer.h"
#include "vtkUnstructuredGrid.h"
#include "vtkPoints.h"
#include "vtkTetra.h"
#include "vtkHexahedron.h"
#include "vtkLookupTable.h"
#include "vtkScalarBarActor.h"
#include "vtkScalarsToColors.h"
#include "vtkCellArray.h"
#include <vtkSmartPointer.h>
//------------------------schsan
#include "vtkSphereSource.h"
#include "vtkPolyData.h"
//------------------------
#include "stdio.h"
#include "time.h"
#include <string>
/*********************************************
* 3D calculated model
**********************************************/
#include "mitkUnstructuredGrid.h"
#include "mitkLookupTable.h"
#include "mitkLookupTableProperty.h"
#include "mitkUnstructuredGridVtkMapper3D.h"
//------------------schsan
#include "mitkMapper.h"
#include "QmitkCommonFunctionality.h"
const std::string QmitkStentBundleView::VIEW_ID = "iwu.mitk.views.stentbundle";
QmitkStentBundleView::QmitkStentBundleView()
: QmitkFunctionality()
, m_Controls( 0 )
, m_MultiWidget( NULL )
{
}
QmitkStentBundleView::~QmitkStentBundleView()
{
}
void QmitkStentBundleView::CreateQtPartControl( QWidget *parent )
{
// build up qt view, unless already done
if ( !m_Controls )
{
// create GUI widgets from the Qt Designer's .ui file
m_Controls = new Ui::QmitkStentBundleViewControls;
m_Controls->setupUi( parent );
m_Controls->retranslateUi(parent);
//set stentlist and posible stents to plugin-ui
changeStentCount(1);
setStentListToUi();
//set connections
QObject::connect(m_Controls->checkBox_3DRenderer, SIGNAL(clicked(bool)), this, SLOT(show3D(bool)));
QObject::connect(m_Controls->checkBox_showCT, SIGNAL(clicked(bool)), this, SLOT(showPlanes(bool)));
QObject::connect(m_Controls->lineEdit_ID, SIGNAL(returnPressed()), this, SLOT(searchPatient()));
QObject::connect(m_Controls->lineEdit_Name, SIGNAL(returnPressed()), this, SLOT(searchPatient()));
QObject::connect(m_Controls->lineEdit_ProducerSearchName, SIGNAL(returnPressed()), this, SLOT(searchProducer()));
QObject::connect(m_Controls->lineEdit_Vorname, SIGNAL(returnPressed()), this, SLOT(searchPatient()));
QObject::connect(m_Controls->pushButton_AddToScene, SIGNAL(clicked()), this, SLOT(addStent()));
QObject::connect(m_Controls->pushButton_SearchPatient, SIGNAL(clicked()), this, SLOT(searchPatient()));
QObject::connect(m_Controls->pushButton_SearchProducer, SIGNAL(clicked()), this, SLOT(searchProducer()));
QObject::connect(m_Controls->pushButton_StartMeasurement, SIGNAL(clicked()), this, SLOT(startMeasurement()));
QObject::connect(m_Controls->pushButton_StartMeshing, SIGNAL(clicked()), this, SLOT(startMeshing()));
QObject::connect(m_Controls->pushButton_StartCalculation, SIGNAL(clicked()), this, SLOT(startCalculation()));
QObject::connect(m_Controls->spinBox_CountStent, SIGNAL(valueChanged(int)), this, SLOT(changeStentCount(int)));
QObject::connect(m_Controls->treeView_stent, SIGNAL(clicked(QModelIndex)), this, SLOT(loadPicture()));
QObject::connect(m_Controls->treeView_stent, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(addStent()));
//load the measurement picture
setMeasurementPictureToUi("Aneurysma");
//hide not used QLineEdit (workflow: measurement)
m_Controls->lineEdit_Measurement_a->hide();
m_Controls->lineEdit_Measurement_b->hide();
m_Controls->lineEdit_Measurement_s->hide();
//set the wide of the treeView
m_Controls->treeView_stent->setColumnWidth(0,180);
m_Controls->treeView_stent->setColumnWidth(3,40);
//set the 3D scene to the main scene
QmitkStdMultiWidget *stdMultiWidget = this->GetActiveStdMultiWidget();
stdMultiWidget->changeLayoutToBig3D();
//hide the QProgressbars
m_Controls->progressBar_WF_Analysis->hide();
m_Controls->progressBar_WF_Patient->hide();
//initialize TableWidget
//Header content
QTableWidgetItem *itemHeader1 = new QTableWidgetItem();
itemHeader1->setText("Hersteller/\nImplantat");
m_Controls->tableWidget_Analysis->setHorizontalHeaderItem(0,itemHeader1);
QTableWidgetItem *itemHeader2 = new QTableWidgetItem();
itemHeader2->setText("Max.Werte\nFixationskraft\t\174\tKontaktzustand");
m_Controls->tableWidget_Analysis->setHorizontalHeaderItem(3,itemHeader2);
m_Controls->tableWidget_Analysis->horizontalHeaderItem(1)->icon().actualSize(QSize(60,70));
//Header width
m_Controls->tableWidget_Analysis->setColumnWidth(0, 180);
m_Controls->tableWidget_Analysis->setColumnWidth(3, 250);
//Icon size
m_Controls->tableWidget_Analysis->setIconSize(QSize(60,70)); //?? funktioniert nicht
m_Controls->tableWidget_Analysis->horizontalHeader()->setIconSize(QSize(60,70));
addRowToTableWidget("Medtronic", 1, 15.0f, 70);
addRowToTableWidget("Vascutek", 2, 9.0f, 85);
addRowToTableWidget("Cook", 1, 7.0f, 80);
addRowToTableWidget("Gore Tex", 3, 12.0f, 55);
addTotalResultToTableWidget("Medtronic", 15, "Vascutek", 85);
}
}
void QmitkStentBundleView::StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget)
{
m_MultiWidget = &stdMultiWidget;
}
void QmitkStentBundleView::StdMultiWidgetNotAvailable()
{
m_MultiWidget = NULL;
}
void QmitkStentBundleView::OnSelectionChanged( std::vector<mitk::DataNode*> nodes )
{
// iterate all selected objects, adjust warning visibility
for( std::vector<mitk::DataNode*>::iterator it = nodes.begin();
it != nodes.end();
++it )
{
mitk::DataNode::Pointer node = *it;
if( node.IsNotNull() && dynamic_cast<mitk::Image*>(node->GetData()) )
{
// m_Controls->lblWarning->setVisible( false );
return;
}
}
// m_Controls->lblWarning->setVisible( true );
}
void QmitkStentBundleView::DoImageProcessing()
{
std::vector<mitk::DataNode*> nodes = this->GetDataManagerSelection(); //node zeigt auf die Selektion des Datamanagers
if (nodes.empty()) return; //keine Selektion -> abbrechen
mitk::DataNode* node = nodes.front();
if (!node)
{
// Nothing selected. Inform the user and return
QMessageBox::information( NULL, "Template", "Please load and select an image before starting image processing.");
return;
}
// here we have a valid mitk::DataNode
// a node itself is not very useful, we need its data item (the image)
mitk::BaseData* data = node->GetData();
if (data)
{
// test if this data item is an image or not (could also be a surface or something totally different)
mitk::Image* image = dynamic_cast<mitk::Image*>( data );
if (image)
{
std::stringstream message;
std::string name;
message << "Performing image processing for image ";
if (node->GetName(name))
{
// a property called "name" was found for this DataNode
message << "'" << name << "'";
}
message << ".";
MITK_INFO << message.str();
// TODO actually do something here...
}
}
}
/*******************************************
* SLOTS and functions
*******************************************/
void QmitkStentBundleView::addRowToTableWidget(QString name, int count3dModels, float maxFixationForce, int maxContact)
{
/****************************************************
* add a row to the QTableWidget (workflow: analysis)
* first column: QLabel with the name
* second column: a number of MyCheckBox(es) (according to 'count3dModels')
* title: 'Variante 1' ... 'Variante n'
* third column: one MyCheckBox without a title
* fourth column: maximum value of the FixationForce (form: 2N) +
maximum value of the Contact (form: 30%)
*****************************************************/
MITK_INFO << "generiere Tabelleneintrag";
MITK_INFO << "Hersteller: " << name.toStdString().c_str();
MITK_INFO << "Anzahl Modelle: " << count3dModels;
MITK_INFO << "Fixationskraft: " << maxFixationForce;
MITK_INFO << "Kontaktzustand: " << maxContact;
QWidget *widgetItem1 = new QWidget();
QWidget *widgetItem2 = new QWidget();
QWidget *widgetItem3 = new QWidget();
QWidget *widgetItem4 = new QWidget();
QVBoxLayout *layoutItem1 = new QVBoxLayout(widgetItem1);
QVBoxLayout *layoutItem2 = new QVBoxLayout(widgetItem2);
QHBoxLayout *layoutItem3 = new QHBoxLayout(widgetItem3);
QHBoxLayout *layoutItem4 = new QHBoxLayout(widgetItem4);
//1. Item
QLabel *labelName = new QLabel(name);
layoutItem1->addWidget(labelName);
//2. Item
for(int i = 0;i<count3dModels; i++)
{
MyCheckBox *checkBox = new MyCheckBox(QObject::tr("Variante %1").arg(i+1), name);
layoutItem2->addWidget(checkBox);
connect(checkBox, SIGNAL(clicked(bool, QString, QString)), this, SLOT(showAnalysis(bool, QString, QString)));
connect(this, SIGNAL(uncheck(QString)), checkBox, SLOT(uncheck(QString)));
}
//3. Item
MyCheckBox *checkBox = new MyCheckBox("", name);
connect(checkBox, SIGNAL(clicked(bool, QString, QString)), this, SLOT(showAnalysis(bool, QString, QString)));
connect(this, SIGNAL(uncheck(QString)), checkBox, SLOT(uncheck(QString)));
layoutItem3->addStretch();
layoutItem3->addWidget(checkBox);
layoutItem3->addStretch();
//4.Item
QLabel *labelFixation = new QLabel(QObject::tr("%1 N").arg(maxFixationForce));
QLabel *labelContact = new QLabel(QObject::tr("%1 \45").arg(maxContact));
layoutItem4->addStretch();
layoutItem4->addWidget(labelFixation);
layoutItem4->addStretch();
layoutItem4->addWidget(labelContact);
layoutItem4->addStretch();
//add Row
int row = m_Controls->tableWidget_Analysis->rowCount();
m_Controls->tableWidget_Analysis->setRowCount(row+1);
//add items
m_Controls->tableWidget_Analysis->setCellWidget(row,0,widgetItem1);
m_Controls->tableWidget_Analysis->setCellWidget(row,1,widgetItem2);
m_Controls->tableWidget_Analysis->setCellWidget(row,2,widgetItem3);
m_Controls->tableWidget_Analysis->setCellWidget(row,3,widgetItem4);
//set row height
m_Controls->tableWidget_Analysis->setRowHeight(row, count3dModels*25);
if(count3dModels ==1 || count3dModels == 0) m_Controls->tableWidget_Analysis->setRowHeight(row, 30);
return;
}
void QmitkStentBundleView::addStent()
{
/***************************************************************
* case something is selected and it is a stent the stentname will be shown in
* the layout
* later should a stent be added to the 3d scene
******************************************************************/
QModelIndex index = m_Controls->treeView_stent->currentIndex();
if (!index.isValid())
return;
if(model->itemFromIndex(index)->hasChildren() || model->itemFromIndex(index)->text()=="")
return;
QString stentname = model->itemFromIndex(index)->parent()->child(index.row(), 0)->text();
setSingleStentToUi(stentname, m_Controls->spinBox_selectedStent->value());
MITK_INFO << "Stentdaten geladen: " << stentname.toStdString() ;
}
void QmitkStentBundleView::addTotalResultToTableWidget(QString nameFixation, float valueFixation, QString nameContact, int valueContact)
{
/****************************************************
* add the toatal result to the QTabeleWidget (workflow: analysis)
* first column: QLabel: "Gesamtauswertung"
* second column: -
* third column: one MyCheckBox without a title
* fourth column: maximum value of the FixationForce (form: 2N) +
the name of the producer and
maximum value of the Contact (form: 30%)+
the name of the producer
*****************************************************/
MITK_INFO << "generiere Gesamtergebnis";
MITK_INFO << "Fixationskraft:\tHersteller: " << nameFixation.toStdString().c_str() << "\tWert: " << valueFixation;
MITK_INFO << "Kontaktzustand:\tHersteller: " << nameContact.toStdString().c_str() << "\tWert: " << valueContact;
QWidget *widgetItem1 = new QWidget();
QWidget *widgetItem2 = new QWidget();
QWidget *widgetItem3 = new QWidget();
QWidget *widgetItem4 = new QWidget();
widgetItem1->setStyleSheet("background-color: rgb(247, 239, 193);");
widgetItem2->setStyleSheet("background-color: rgb(247, 239, 193);");
widgetItem3->setStyleSheet("background-color: rgb(247, 239, 193);");
widgetItem4->setStyleSheet("background-color: rgb(247, 239, 193);");
QGridLayout *layoutItem1 = new QGridLayout(widgetItem1);
//QGridLayout *layoutItem2 = new QGridLayout(widgetItem2);
QHBoxLayout *layoutItem3 = new QHBoxLayout(widgetItem3);
QHBoxLayout *layoutItem4 = new QHBoxLayout(widgetItem4);
//1. item
QLabel *labelItem1 = new QLabel("Gesamtauswertung");
layoutItem1->addWidget(labelItem1);
//2. item
//---------------------
//3. item
MyCheckBox *checkBoxItem3 = new MyCheckBox("","Gesamtauswertung");
connect(checkBoxItem3, SIGNAL(clicked(bool, QString, QString)), this, SLOT(showAnalysis(bool, QString, QString)));
connect(this, SIGNAL(uncheck(QString)), checkBoxItem3, SLOT(uncheck(QString)));
layoutItem3->addStretch();
layoutItem3->addWidget(checkBoxItem3);
layoutItem3->addStretch();
//4. item
QLabel *labelFixationName = new QLabel(nameFixation);
QLabel *labelFixationValue = new QLabel(QObject::tr("%1 N").arg(valueFixation));
QLabel *labelContactName = new QLabel(nameContact);
QLabel *labelContactValue = new QLabel(QObject::tr("%1 \45").arg(valueContact));
labelFixationName->setAlignment(Qt::AlignCenter);
labelFixationValue->setAlignment(Qt::AlignCenter);
labelContactName->setAlignment(Qt::AlignCenter);
labelContactValue->setAlignment(Qt::AlignCenter);
QVBoxLayout *layoutFixation = new QVBoxLayout();
QVBoxLayout *layoutContact = new QVBoxLayout();
layoutFixation->addWidget(labelFixationName);
layoutFixation->addWidget(labelFixationValue);
layoutContact->addWidget(labelContactName);
layoutContact->addWidget(labelContactValue);
layoutItem4->addStretch();
layoutItem4->addLayout(layoutFixation);
layoutItem4->addStretch();
layoutItem4->addLayout(layoutContact);
layoutItem4->addStretch();
//add Row
int row = m_Controls->tableWidget_Analysis->rowCount();
m_Controls->tableWidget_Analysis->setRowCount(row+1);
//add items
m_Controls->tableWidget_Analysis->setCellWidget(row,0,widgetItem1);
m_Controls->tableWidget_Analysis->setCellWidget(row,1,widgetItem2);
m_Controls->tableWidget_Analysis->setCellWidget(row,2,widgetItem3);
m_Controls->tableWidget_Analysis->setCellWidget(row,3,widgetItem4);
//row height
m_Controls->tableWidget_Analysis->setRowHeight(row, 50);
return;
}
void QmitkStentBundleView::changeCountLineEdits(int value)
{
/****************************************************
* set the number of stent labels + lineEdits of the GUI to "value"
* call the function "hideAllStentsButOne()" to hide all stent labels + LineEdits
* according to "value" the labels + lineEdits aer shown
****************************************************/
MITK_INFO << "Anzahl der Stents geaendert: " << value;
hideAllStentsButOne();
if(value >= 2)
{
m_Controls->stent2Label_2->show();
m_Controls->stent2LineEdit->show();
}
if(value >= 3)
{
m_Controls->stent3Label_2->show();
m_Controls->stent3LineEdit->show();
}
if(value >= 4)
{
m_Controls->stent4Label_2->show();
m_Controls->stent4LineEdit->show();
}
if(value >= 5)
{
m_Controls->stent5Label_2->show();
m_Controls->stent5LineEdit->show();
}
if(value >= 6)
{
m_Controls->stent6Label_2->show();
m_Controls->stent6LineEdit->show();
}
return;
}
void QmitkStentBundleView::changeCountSliderPosition(int value)
{
/****************************************************
* set the number of position slider + labes of the GUI to "value"
* first hide all slider + labels
* second show all slider + labels according to "value"
****************************************************/
m_Controls->label_PositionStent2->hide();
m_Controls->verticalSlider_Stent2->hide();
m_Controls->label_PositionStent3->hide();
m_Controls->verticalSlider_Stent3->hide();
m_Controls->label_PositionStent4->hide();
m_Controls->verticalSlider_Stent4->hide();
m_Controls->label_PositionStent5->hide();
m_Controls->verticalSlider_Stent5->hide();
m_Controls->label_PositionStent6->hide();
m_Controls->verticalSlider_Stent6->hide();
if(value >=2)
{
m_Controls->label_PositionStent2->show();
m_Controls->verticalSlider_Stent2->show();
}
if(value >=3)
{
m_Controls->label_PositionStent3->show();
m_Controls->verticalSlider_Stent3->show();
}
if(value >=4)
{
m_Controls->label_PositionStent4->show();
m_Controls->verticalSlider_Stent4->show();
}
if(value >=5)
{
m_Controls->label_PositionStent5->show();
m_Controls->verticalSlider_Stent5->show();
}
if(value >=6)
{
m_Controls->label_PositionStent6->show();
m_Controls->verticalSlider_Stent6->show();
}
return;
}
void QmitkStentBundleView::changeStentCount(int count)
{
/***************************************************************
* controls the variable overview of the stents
* delete the QLabels, which are no more used (number<numberOfCurrentStents)
* create new QLabels, if needed (number>numberOfCurrentStents)
* add the new QLabels to the layout
****************************************************************/
changeCountSliderPosition(count);
changeCountLineEdits(count);
m_Controls->spinBox_selectedStent->setValue(count);
m_Controls->spinBox_selectedStent->setMaximum(count);
}
void QmitkStentBundleView::checkInputDialog()
{
/*******************************************************
* prove the result of the dialog for selecting a patient
* cancal: do nothing
* accept: setPatientToUi(),
setVeinToScene(),
setMeasurementPictureToUi(patient->diagnose),
enable the QPushButtons
* delete the not used patients
********************************************************/
int value = dia->result();
if(value == QDialog::Accepted) //Ok gedrückt
{
//entfernen der überschüssigen patienten
QStringList patientName = dialog.listWidget_SelectingPatient->currentItem()->text().split(", ");
patient = &makePatientList(patientName[0],patientName[1],"");
m_Controls->progressBar_WF_Patient->show();
m_Controls->progressBar_WF_Patient->setValue(1);
setPatientToUi();
m_Controls->progressBar_WF_Patient->setValue(5);
setVeinToScene();
m_Controls->progressBar_WF_Patient->setValue(90);
setMeasurementPictureToUi(patient->Diagnosis);
m_Controls->progressBar_WF_Patient->setValue(98);
//pushbutton wieder aktivieren:
m_Controls->pushButton_StartCalculation->setDisabled(false);
m_Controls->pushButton_StartMeasurement->setDisabled(false);
m_Controls->pushButton_StartMeshing->setDisabled(false);
MITK_INFO << "Patientendaten geladen";
m_Controls->progressBar_WF_Patient->setValue(100);
m_Controls->progressBar_WF_Patient->hide();
}
if(value == QDialog::Rejected) //Abbrechen gedrückt
{
MITK_INFO << "Laden der Patientendaten abgebrochen";
}
}
void QmitkStentBundleView::hideAllStentsButOne()
{
/******************************************
* hide all stent labels and lineEdits of the GUI but one
*******************************************/
int count = 0;
if(!m_Controls->stent2Label_2->isHidden())
count =2;
if(!m_Controls->stent3Label_2->isHidden())
count =3;
if(!m_Controls->stent4Label_2->isHidden())
count =4;
if(!m_Controls->stent5Label_2->isHidden())
count =5;
if(!m_Controls->stent6Label_2->isHidden())
count =6;
m_Controls->stent2Label_2->hide();
m_Controls->stent2LineEdit->hide();
if(count < 2)
m_Controls->stent2LineEdit->setText("");
m_Controls->stent3Label_2->hide();
m_Controls->stent3LineEdit->hide();
if(count < 3)
m_Controls->stent3LineEdit->setText("");
m_Controls->stent4Label_2->hide();
m_Controls->stent4LineEdit->hide();
if(count < 4)
m_Controls->stent4LineEdit->setText("");
m_Controls->stent5Label_2->hide();
m_Controls->stent5LineEdit->hide();
if(count < 5)
m_Controls->stent5LineEdit->setText("");
m_Controls->stent6Label_2->hide();
m_Controls->stent6LineEdit->hide();
if(count < 6)
m_Controls->stent6LineEdit->setText("");
return;
}
void QmitkStentBundleView::loadPicture()
{
/***********************************************************
* create a String with the path of the .png-file
* load the file and add it to the label picture
* if the loading failed a message is shown and then return
**************************************************************/
QModelIndex index = m_Controls->treeView_stent->currentIndex();
if(model->itemFromIndex(index)->hasChildren() || model->itemFromIndex(index)->text()=="")
return;
QString stentname = model->itemFromIndex(index)->parent()->child(index.row(), 0)->text();
QString type = model->itemFromIndex(index)->parent()->text();
QString producer = model->itemFromIndex(index)->parent()->parent()->text();
QString path = "./Resources/Stent/" + producer + "/gif/" + stentname + ".gif";
QString path2 = "./Resources/Stent/" + producer + "/gif/" + stentname + ".png";
QPixmap *pix = new QPixmap;
if(!(pix->load( path)))
{
if(!(pix->load( path2)))
{
m_Controls->label_PictureStent->setText(tr("not available"));
return;
}
}
*pix=pix->scaledToWidth(m_Controls->label_PictureStent->width(),Qt::SmoothTransformation);
m_Controls->label_PictureStent->setPixmap(*pix);
m_Controls->label_PictureStent->setMaximumWidth(200);
m_Controls->label_PictureStent->setMaximumHeight(pix->height());
}
void QmitkStentBundleView::makeFEresult(QString filename, QString nodename)
{
/********************************************************
* create a mitk::DataNode
* the data is a unstructured Grid of the class FEresult
* the FEresult is called with "filename"
* the name of the node is "nodename"
* at the end a global reinit ist called to show the new node
*********************************************************/
//1. u-grid erzeugen
m_Controls->progressBar_WF_Analysis->setValue(20);
//NR Datei öffnen, bei Erfolg den ifstream an das FEresult Objekt übergeben, ansonsten Fehlermeldung und Programmabbruch
ifstream file ("GefaeszP.s4s");
if (!file) {
file.close();
std::cout << "file not found" << std::endl;
return ;
}
FEresult* result = new FEresult(file); //NR Übergabe ifstream
//FEresult *result = new FEresult(filename.toStdString().c_str());
m_Controls->progressBar_WF_Analysis->setValue(40);
result->uGrid->SetPoints(result->nodeCoordinates);
result->uGrid->GetPointData()->SetScalars(result->scalars);
result->buildScalars();
result->nodeCoordinates->Delete();
m_Controls->progressBar_WF_Analysis->setValue(43);
mitk::UnstructuredGrid::Pointer grid = mitk::UnstructuredGrid::New();
grid->SetVtkUnstructuredGrid(result->uGrid);
//1.2 mapper erzeugen
//vtkDataSetMapper *ugridMapper = vtkDataSetMapper::New();
//ugridMapper->SetInput(result->uGrid);
//
//ugridMapper->SetScalarRange(result->uGrid->GetScalarRange());
//ugridMapper->SetLookupTable(result->lut);
//ugridMapper->ScalarVisibilityOn();
//
//mitk::UnstructuredGridVtkMapper3D::Pointer mapper = mitk::UnstructuredGridVtkMapper3D::New();
//mapper->SetVtkMapperImmediateModeRendering(ugridMapper);
m_Controls->progressBar_WF_Analysis->setValue(47);
//1.3 Scalarbar erzeugen
//vtkScalarBarActor *scalarBar = vtkScalarBarActor::New();
//scalarBar->SetOrientationToHorizontal();
//scalarBar->SetPosition(0.1,0.09);
//scalarBar->SetWidth(0.8);
//scalarBar->SetHeight(0.09);
//scalarBar->SetLookupTable(ugridMapper->GetLookupTable());
// m_Controls->progressBar_WF_Analysis->setValue(50);
MITK_INFO << "unstructured Grid erzeugt";
//2. datanode erzeugen
mitk::DataNode::Pointer node = mitk::DataNode::New();
node->SetName(nodename.toStdString().c_str());
node->SetOpacity(1.0f);
m_Controls->progressBar_WF_Analysis->setValue(60);
//2.1 Eigenschaften des Nodes
mitk::LookupTable::Pointer lookupTable = mitk::LookupTable::New();
lookupTable->SetVtkLookupTable(result->lut);
//schsan
//node->SetProperty( "LookupTable", mitk::LookupTableProperty::New(lookupTable) );
node->SetBoolProperty("scalar visibility", true); //scalarBar???
node->SetBoolProperty("color mode", true);
node->SetFloatProperty("ScalarsRangeMaximum", (float)*result->uGrid->GetScalarRange());
node->SetProperty("outline polygons", mitk::BoolProperty::New(false));
node->SetBoolProperty("show points", true);
node->SetBoolProperty("show contour", false);
// node->SetValue
node->Update();
//u_mapper = node->GetMapper(2);
m_Controls->progressBar_WF_Analysis->setValue(70);
//____________
//MITK_INFO << "node + name erzeugt";
//3. grid + mapper an datanode anhängen:
node->SetData(grid);
// node->SetMapper(mitk::BaseRenderer::Standard3D, mapper);
//mapper->SetDataNode(node);
//node->SetMapper(mitk::BaseRenderer::Standard3D, myOwnMapper);
m_Controls->progressBar_WF_Analysis->setValue(80);
//4. datastorage ansprechen
mitk::DataStorage::Pointer m_DataStorage = this->GetDataStorage();
m_DataStorage->Add(node);
//MITK_INFO << "node am ds angehangen";
//5. globales reinit:
m_Controls->progressBar_WF_Analysis->setValue(90);
mitk::RenderingManager::GetInstance()->InitializeViews( m_DataStorage->ComputeBoundingGeometry3D(m_DataStorage->GetAll()));
m_Controls->progressBar_WF_Analysis->setValue(100);
m_Controls->progressBar_WF_Analysis->hide();
MITK_INFO << "Model erfolgreich erzeugt";
return;
}
void QmitkStentBundleView::createVtkObjects()
{
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void QmitkStentBundleView::searchPatient()
{
/***************************************************
* show QDialog for selecting a pation of the searchresults
****************************************************/
MITK_INFO << "Suche Patient '" << m_Controls->lineEdit_Name->text().toStdString() << ", " << m_Controls->lineEdit_Vorname->text().toStdString() << ", " << m_Controls->lineEdit_ID->text().toStdString() <<"'";
dia = new QDialog;
dialog.setupUi(dia);
dialog.retranslateUi(dia);
patient = &makePatientList(m_Controls->lineEdit_Name->text(),m_Controls->lineEdit_Vorname->text(),m_Controls->lineEdit_ID->text());
setPatientListToUi();
if(patient->Name != "")
{
dia->show();
QObject::connect(dia, SIGNAL(accepted()), this, SLOT(checkInputDialog()));
QObject::connect(dia, SIGNAL(rejected()), this, SLOT(checkInputDialog()));
dia->setModal(true);
}
else
{
QMessageBox::information(NULL, "", tr("Keinen Patienten gefunden."),QMessageBox::Ok);
}
}
void QmitkStentBundleView::searchProducer()
{
/*******************************************************
* search in the QTreeView for string of the QLineEdit
* only for searching producers
* at success the producer is selected, and the name of the founded producer is shown
* else a message is shown
********************************************************/
MITK_INFO << "Suche nach Hersteller: '" << m_Controls->lineEdit_ProducerSearchName->text().toStdString() <<"'";
QString content = m_Controls->lineEdit_ProducerSearchName->text();
m_Controls->label_searchResultProducer->setText("");
int j=0;
while(true)
if(model->item(j))
{
if(model->item(j)->text().contains(content, Qt::CaseInsensitive ) )
{ //producer found:
m_Controls->treeView_stent->setCurrentIndex(model->item(j)->index());
m_Controls->label_searchResultProducer->setText(tr("%1 gefunden").arg(model->item(j)->text()));
MITK_INFO << "Hersteller gefunden: '" << model->item(j)->text().toStdString() <<"'";
break;
}
else
j++;
}
else
{ //no more producer
MITK_INFO << "Hersteller nicht gefunden";
m_Controls->label_searchResultProducer->setText(tr("\" %1 \" nicht gefunden").arg(content));
return;
}
}
void QmitkStentBundleView::setCtToUi()
{
/**************************************************
* load the patient CT in the GUI
* CT in PIC-Files
***************************************************/
//CT-Daten werden geladen:
//DataStorage ist der Datenbaum im DataManager
mitk::DataStorage::Pointer m_DataStorage = this->GetDataStorage();
mitk::PicFileReader::Pointer reader=mitk::PicFileReader::New();
try
{
reader->SetFileName("./Resources/CT Abdomen 3D.pic");
reader->Update();
}
catch(...)
{
MITK_INFO << "PIC Datei konnte nicht geladen werden";
}
if ( reader->GetOutput() == NULL );
else
{
//Laden der Daten erfolgreich --> in Szene einfügen
mitk::DataNode::Pointer node = mitk::DataNode::New();
node->SetData(reader->GetOutput());
node->SetName("CT");
m_DataStorage->Add(node);
mitk::RenderingManager::GetInstance()->InitializeViews( m_DataStorage->ComputeBoundingGeometry3D(m_DataStorage->GetAll()));
MITK_INFO << "CT Bilder geladen";
}
m_Controls->checkBox_3DRenderer->setDisabled(false);
return;
}
void QmitkStentBundleView::setMeasurementPictureToUi(QString diagnosis)
{
/*****************************************************
* containing to the diagnosis will be load an other scheme
* therefore a different pixmap is loaded
* and different QLineEdits are shown
******************************************************/
QPixmap *pix = &getPixmap(diagnosis);
if(!(pix))
{
m_Controls->label_PictureSchemeBAA->setText(tr("not available"));
m_Controls->label_PictureSchemeStenose->setText(tr("not available"));
}
else
{
*pix=pix->scaledToHeight(300,Qt::SmoothTransformation);
if(diagnosis.contains("Stenose"))
{
m_Controls->label_PictureSchemeBAA->hide();
m_Controls->lineEdit_Measurement_A->hide();
m_Controls->lineEdit_Measurement_I->hide();
m_Controls->lineEdit_Measurement_H->hide();
m_Controls->lineEdit_Measurement_H1->hide();
m_Controls->lineEdit_Measurement_H2->hide();
m_Controls->label_PictureSchemeStenose->show();
m_Controls->lineEdit_Measurement_a->show();
m_Controls->lineEdit_Measurement_b->show();
m_Controls->lineEdit_Measurement_s->show();
m_Controls->label_PictureSchemeStenose->setPixmap(*pix);
}
else
{
*pix=pix->scaledToWidth(m_Controls->label_PictureSchemeBAA->width(),Qt::SmoothTransformation);
m_Controls->label_PictureSchemeBAA->show();
m_Controls->lineEdit_Measurement_A->show();
m_Controls->lineEdit_Measurement_I->show();
m_Controls->lineEdit_Measurement_H->show();
m_Controls->lineEdit_Measurement_H1->show();
m_Controls->lineEdit_Measurement_H2->show();
m_Controls->label_PictureSchemeStenose->hide();
m_Controls->lineEdit_Measurement_a->hide();
m_Controls->lineEdit_Measurement_b->hide();
m_Controls->lineEdit_Measurement_s->hide();
m_Controls->label_PictureSchemeBAA->setPixmap(*pix);
}
}
return;
}
void QmitkStentBundleView::setPatientToUi()
{
/***********************************************
* set the current patient data to the LineEdits of
* the step of work "selecting patient"
************************************************/
if(patient == NULL)
return;
if(patient->Name == NULL)
return;
QDate today ;
today = QDate::currentDate();
int a = getAge(today.month(), today.year(), patient->Birthday.Month, patient->Birthday.Year);
QString age = tr("%1").arg(a);
m_Controls->LineEdit_ageToShow->setText(age);
m_Controls->LineEdit_birthToShow->setText(tr("%1.%2.%3").arg(patient->Birthday.Day).arg(patient->Birthday.Month).arg(patient->Birthday.Year));
if(patient->Diagnosis != NULL)
m_Controls->lineEdit_DiagnosisToShow->setText(patient->Diagnosis);
if(patient->Firstname != NULL)
m_Controls->LineEdit_nameToShow->setText(patient->Name + ", " + patient->Firstname);
else
m_Controls->LineEdit_nameToShow->setText(patient->Name);
m_Controls->LineEdit_hypertonieToShow->setText(tr("%1").arg(patient->Hypertonie));
m_Controls->LineEdit_patientIDToShow->setText(tr("%1").arg(patient->ID));
if(patient->Kardiovas != NULL)
m_Controls->LineEdit_kardioToShow->setText(patient->Kardiovas);
if(patient->Kidney != NULL)
m_Controls->LineEdit_kidneyToShow->setText(patient->Kidney);
if(patient->Sex != NULL)
m_Controls->LineEdit_sexToShow->setText(patient->Sex);
m_Controls->LineEdit_heightToShow->setText(tr("%1").arg(patient->Size));
if(patient->Smoker != NULL)
m_Controls->LineEdit_smokerToShow->setText(patient->Smoker);
m_Controls->LineEdit_weightToShow->setText(tr("%1").arg(patient->Weight));
return;
}
void QmitkStentBundleView::setPatientListToUi()
{
/*************************************************
* fill the QListWidget of the dialog for the selection of the patients
**************************************************/
while(patient->Name != NULL)
{
QListWidgetItem *item = new QListWidgetItem;
item->setText(patient->Name + ", " + patient->Firstname);
//item->setText("Patient1");
dialog.listWidget_SelectingPatient->addItem(item);
if(patient->next->Name == NULL)
break;
else
patient=patient->next;
dialog.listWidget_SelectingPatient->setSelectionMode(QAbstractItemView::SingleSelection);
dialog.listWidget_SelectingPatient->item(0)->setSelected(true);
dialog.listWidget_SelectingPatient->setCurrentItem(dialog.listWidget_SelectingPatient->item(0));
}
}
void QmitkStentBundleView::setResultAToUi(float value)
{
/***********************************************
* set the value to the QLineEdit (GUI)
* measurement: A (aneurysm)
************************************************/
m_Controls->lineEdit_Measurement_A->setText(QObject::tr("A: %1").arg(value));
return;
}
void QmitkStentBundleView::setResultaToUi(float value)
{
/***********************************************
* set the value to the QLineEdit (GUI)
* measurement: a (stenose)
* call the function "setResultsToUI(float,float)" to update s
************************************************/
m_Controls->lineEdit_Measurement_a->setText(QObject::tr("a: %1").arg(value));
float valueB;
if(m_Controls->lineEdit_Measurement_b->text() == "b:")
valueB = 0.0f;
else
{
QStringList stringListB = m_Controls->lineEdit_Measurement_b->text().split(": ");
valueB = stringListB[1].toFloat();
}
setResultsToUi(value, valueB);
return;
}
void QmitkStentBundleView::setResultbToUi(float value)
{
/***********************************************
* set the value to the QLineEdit (GUI)
* measurement: b (stenose)
* call the function "setResultsToUI(float,float)" to update s
************************************************/
m_Controls->lineEdit_Measurement_b->setText(QObject::tr("b: %1").arg(value));
float valueA;
if(m_Controls->lineEdit_Measurement_a->text() == "a:")
valueA = 0.0f;
else
{
QStringList stringListA = m_Controls->lineEdit_Measurement_a->text().split(": ");
valueA = stringListA[1].toFloat();
}
setResultsToUi(valueA, value);
return;
}
void QmitkStentBundleView::setResultH1ToUi(float value)
{
/***********************************************
* set the value to the QLineEdit (GUI)
* measurement: H1 (aneurysm)
************************************************/
m_Controls->lineEdit_Measurement_H1->setText(QObject::tr("H1: %1").arg(value));
return;
}
void QmitkStentBundleView::setResultH2ToUi(float value)
{
/***********************************************
* set the value to the QLineEdit (GUI)
* measurement: H2 (aneurysm)
************************************************/
m_Controls->lineEdit_Measurement_H2->setText(QObject::tr("H2: %1").arg(value));
return;
}
void QmitkStentBundleView::setResultHToUi(float value)
{
/***********************************************
* set the value to the QLineEdit (GUI)
* measurement: H (aneurysm)
************************************************/
m_Controls->lineEdit_Measurement_H->setText(QObject::tr("H: %1").arg(value));
return;
}
void QmitkStentBundleView::setResultIToUi(float value)
{
/***********************************************
* set the value to the QLineEdit (GUI)
* measurement: I (aneurysm)
************************************************/
m_Controls->lineEdit_Measurement_I->setText(QObject::tr("I: %1").arg(value));
return;
}
void QmitkStentBundleView::setResultsToUi(float valueA, float valueB)
{
/***********************************************
* caluculate: result = (valueA - valueB)/valueA*100
* set the result to the QLineEdit (GUI)
* measurement: s (stenose)
************************************************/
if(valueA == 0.0f)
{
m_Controls->lineEdit_Measurement_s->setText(QObject::tr("s: 0"));
return;
}
float result;
result = (valueA - valueB)/valueA*100;
m_Controls->lineEdit_Measurement_s->setText(QObject::tr("s: %1").arg(result));
return;
}
void QmitkStentBundleView::setSingleStentToUi(QString stentname, int value)
{
/********************************************************
* set the "stentname" to the LineEdit of the stent "value"
*********************************************************/
switch(value)
{
case 1: m_Controls->stent1LineEdit->setText(stentname);
break;
case 2: m_Controls->stent2LineEdit->setText(stentname);
break;
case 3: m_Controls->stent3LineEdit->setText(stentname);
break;
case 4: m_Controls->stent4LineEdit->setText(stentname);
break;
case 5: m_Controls->stent5LineEdit->setText(stentname);
break;
case 6: m_Controls->stent6LineEdit->setText(stentname);
break;
}
return;
}
void QmitkStentBundleView::setStentListToUi()
{
/*************************************************
* takes all stents from makeStentList() ant put it into
* a QStandardItemModel
* hierarchie: producer, type, stent
* set the Model to the QTreeView
**************************************************/
stent = &makeStentList();
Stent *help = stent;
model = new QStandardItemModel;
int j=0;
int b=0;
while(help->next->Material != NULL)
{
QStandardItem *insert0= new QStandardItem(tr("%1").arg(help->Ordernumber));
QStandardItem *insert1= new QStandardItem(tr("%1").arg(help->Proximal));
QStandardItem *insert11= new QStandardItem(tr("%1").arg(help->Distal));
QStandardItem *insert12= new QStandardItem(tr("%1").arg(help->Catheter));
QStandardItem *insert2= new QStandardItem(tr("%1").arg(help->Length));
QStandardItem *insert3= new QStandardItem(tr("%1").arg(help->Material));
bool inserted = false;
while(!inserted)
{
if(model->item(j))
{
if(model->item(j)->text()==help->Producer)
{
if(model->item(j)->child(b))
{
if(model->item(j)->child(b)->text()==help->Type)
{
int index=0;
index=model->item(j)->child(b)->rowCount();
QString c = model->item(j)->child(b)->text();
model->item(j)->child(b)->setChild(index,0, insert0);
model->item(j)->child(b)->setChild(index,1, insert1);
model->item(j)->child(b)->setChild(index,2, insert11);
model->item(j)->child(b)->setChild(index,3, insert2);
model->item(j)->child(b)->setChild(index,4, insert12);
model->item(j)->child(b)->setChild(index,5, insert3);
j=0;
b=0;
inserted=true;
}
else
{
b++;
}
}else
{
QStandardItem *insert01 = new QStandardItem(help->Type);
model->item(j)->setChild(b,insert01);
b=0;
}
}
else
{
j++;
}
}
else
{
QStandardItem *insert00 = new QStandardItem(help->Producer);
model->insertRow(j,insert00);
j=0;
}
}
help = help->next;
}
QStringList *treeheader = new QStringList;
*treeheader << tr("Bestellnr.") << tr("\303\230 Proximal") << tr("\303\230 Distal") << tr("L\303\244nge") << tr("\303\230 Katheter") << tr("Material");
model->setHorizontalHeaderLabels(*treeheader);
model->sort(0,Qt::AscendingOrder);
m_Controls->treeView_stent->setModel(model);
MITK_INFO << "Stent Liste geladen";
return;
}
void QmitkStentBundleView::setVeinToScene()
{
/******************************************************
* display a stl and a pic file in the 3d scene
* reset the checkboxbuttons
* hide the planes by calling "showPlanes";
* call the function "setCtToUi()" (CT)
* use the mitk STLReader
* load Data from source "./Resources/stl"
*******************************************************/
m_Controls->progressBar_WF_Patient->setValue(6);
/******************************************************
* first: CT
* second: vein
*******************************************************/
mitk::STLFileReader::Pointer reader = mitk::STLFileReader::New();
//DataStorage ist der Datenbaum im DataManager
mitk::DataStorage::Pointer m_DataStorage = this->GetDataStorage();
//alle Daten des DataStorage entfernen:
m_DataStorage->Remove(m_DataStorage->GetAll());
/*-->löscht alles scheinbar auch die Planes -->keine Anzeige derer mehr
daher: wiedereinfügen der Planes in die Szene:*/
QmitkStdMultiWidget *stdMultiWidget = this->GetActiveStdMultiWidget();
stdMultiWidget->AddPlanesToDataStorage();
m_Controls->progressBar_WF_Patient->setValue(10);
/*
andere Variante: manuelles rauslöschen, aber! wenn zusätzliche Node da sind werden diese nicht gelöscht:
m_DataStorage->Remove(m_DataStorage->GetNamedNode("Aorta")); /
m_DataStorage->Remove(m_DataStorage->GetNamedNode("Vene"));
m_DataStorage->Remove(m_DataStorage->GetNamedNode("Plaque"));
m_DataStorage->Remove(m_DataStorage->GetNamedNode("CT"));
*/
this->setCtToUi();
m_Controls->progressBar_WF_Patient->setValue(50);
try
{ //laden eines STL-Files mit STLFileReader
reader->SetFileName("./Resources/stl/aorta.stl");
reader->Update();
}
catch(...)
{
MITK_INFO << "STL Daten konnten nicht geladen werden";
}
m_Controls->progressBar_WF_Patient->setValue(75);
if ( reader->GetOutput() == NULL );
else
{ //wenn Laden der Daten erfolgreich:
//DataNode ist ein einzelner Knoten im Datenbaum
mitk::DataNode::Pointer node = mitk::DataNode::New();
//Daten des reader in Knoten laden:
node->SetData(reader->GetOutput());
//Anzeigeoptionen setzen
node->SetBoolProperty("show points", false);
node->SetBoolProperty("show contour", true);
//Farbe und Transparenz:
node->SetColor(0.9f,0.0f,0.0f);
node->SetOpacity(0.7f);
//Name des Knotens festlegen:
m_Controls->progressBar_WF_Patient->setValue(85);
if(patient->Diagnosis == "Stenose")
node->SetName("Vene");
else
node->SetName("Aorta");
//an Datenbaum anhängen
m_DataStorage->Add(node);
//globales Reinit, damit alles sichtbar
//mitk::RenderingManager::GetInstance()->InitializeViews( m_DataStorage->ComputeBoundingGeometry3D(m_DataStorage->GetAll()));
}
/*******************************************************
* plaque
*******************************************************/
mitk::STLFileReader::Pointer reader2 = mitk::STLFileReader::New();
try
{ //laden eines STL-Files mit STLFileReader
reader2->SetFileName("./Resources/stl/plaque.stl");
reader2->Update();
}
catch(...)
{
MITK_INFO << "STL Daten konnten nicht geladen werden";
}
if ( reader2->GetOutput() == NULL );
else
{ //wenn Laden der Daten erfolgreich:
//DataNode ist ein einzelner Knoten im Datenbaum
mitk::DataNode::Pointer node2 = mitk::DataNode::New();
//Daten des reader in Knoten laden:
node2->SetData(reader2->GetOutput());
m_Controls->progressBar_WF_Patient->setValue(88);
//Anzeigeoptionen setzen
node2->SetBoolProperty("show points", false);
node2->SetBoolProperty("show contour", true);
//Name des Knotens festlegen:
node2->SetName("Plaque");
//an Datenbaum anhängen
m_DataStorage->Add(node2);
//globales Reinit, damit alles sichtbar
mitk::RenderingManager::GetInstance()->InitializeViews( m_DataStorage->ComputeBoundingGeometry3D(m_DataStorage->GetAll()));
}
MITK_INFO << "STL Daten geladen";
showPlanes(false);
return;
}
void QmitkStentBundleView::show3D(bool shown)
{
/************************************************
* hide or show the volumerendering of the CT
************************************************/
if(shown)
MITK_INFO << "Volumenrendering eingeblendet";
else
MITK_INFO << "Volumenrendering ausgeblendet";
mitk::DataStorage::Pointer m_DataStorage = this->GetDataStorage();
mitk::DataNode::Pointer node = m_DataStorage->GetNamedNode("CT");
node->SetProperty("volumerendering", mitk::BoolProperty::New(shown));
}
void QmitkStentBundleView::showAnalysis(bool activated, QString text, QString producer)
{
/******************************************************
* controls the MyCheckBoxes of the workflow 'analysis'
* if the text == "" a diagram will be shown
* else a FEresult will be shown
* create a new FEresult if this one doesn't already exists
* name of the new node: 'producer text'
*******************************************************/
if(text == "")
{
emit uncheck(producer);
//show diagramm
if(!activated)
{
QWidget *widget = new QWidget();
m_Controls->scrollArea_histogram->setWidget(widget);
return;
}
if(producer == "Gesamtauswertung")
{//total Result
ifstream in("variants.lis");
int numberOfResults;
//reading the first file entry which represents the number of implants
in>>numberOfResults;
if (numberOfResults > 4) //zu viele
{
QLabel *labelIcon = new QLabel();
labelIcon->setPixmap(QPixmap("./Resources/error_button.png"));
labelIcon->setScaledContents(true);
labelIcon->setMinimumSize(50,50);
labelIcon->setMaximumSize(50,50);
QLabel *labelInformation = new QLabel("Error in InputFile\nThere are more then four results in the input file.\nPlease consider that MAXIMUM four results can be evaluated!");
QFont font;
font.setPointSize(10);
font.setBold(true);
font.setFamily("MS Shell Dlg 2");
labelInformation->setFont(font);
QHBoxLayout *layout = new QHBoxLayout();
layout->addWidget(labelIcon);
layout->addWidget(labelInformation);
QWidget *widget = new QWidget();
widget->setLayout(layout);
m_Controls->scrollArea_histogram->setWidget(widget);
//QMessageBox::information(m_Controls->scrollArea_histogram, tr("Error in InputFile"),
//tr("There are more then four results in the input file. Please consider that MAXIMUM four results can be evaluated!"));
}
else
{
ResultPlot *plot = new ResultPlot;
//plot->setMinimumSize(QSize(750,500));
m_Controls->scrollArea_histogram->setWidget(plot);
plot->showNormal();
}
return;
}
else
{ //single Result
QLabel *labelIcon = new QLabel();
labelIcon->setPixmap(QPixmap("./Resources/information.png"));
labelIcon->setScaledContents(true);
labelIcon->setMinimumSize(50,50);
labelIcon->setMaximumSize(50,50);
QLabel *labelInformation = new QLabel("Comming soon");
QFont font;
font.setPointSize(10);
font.setBold(true);
font.setFamily("MS Shell Dlg 2");
labelInformation->setFont(font);
QHBoxLayout *layout = new QHBoxLayout();
layout->addWidget(labelIcon);
layout->addWidget(labelInformation);
QWidget *widget = new QWidget();
widget->setLayout(layout);
m_Controls->scrollArea_histogram->setWidget(widget);
}
}
else
{
//show FEresult
QString nodename;// = new QString();
nodename += producer + " " + text;
m_Controls->progressBar_WF_Analysis->setValue(0);
m_Controls->progressBar_WF_Analysis->show();
mitk::DataStorage::Pointer m_DataStorage = this->GetDataStorage();
m_Controls->progressBar_WF_Analysis->setValue(10);
if(m_DataStorage->GetNamedNode(nodename.toStdString()))
{
//MITK_INFO <<"node bereits vorhanden";
mitk::DataNode::Pointer node = m_DataStorage->GetNamedNode(nodename.toStdString());
m_Controls->progressBar_WF_Analysis->setValue(40);
node->SetVisibility(activated);
m_Controls->progressBar_WF_Analysis->setValue(80);
MITK_INFO << activated;
m_Controls->progressBar_WF_Analysis->setValue(100);
m_Controls->progressBar_WF_Analysis->hide();
}
else
{
//MITK_INFO << "node noch nicht vorhanden";
makeFEresult("./Resources/FEMResults/GefaeszP.s4s", nodename);
return;
}
}
}
void QmitkStentBundleView::showPlanes(bool shown)
{
/*********************************************
* hide/show the 3 planes of the 3d scene
* load the ct-pictures to the planes
**********************************************/
QmitkStdMultiWidget *stdMultiWidget = this->GetActiveStdMultiWidget();
if(shown)
MITK_INFO << "CT Bilder eingeblendet";
else
MITK_INFO << "CT Bilder ausgeblendet";
stdMultiWidget->SetWidgetPlanesVisibility(shown);
}
void QmitkStentBundleView::startCalculation()
{
/*
*QMessageBox::information(NULL, tr("Hallo"), tr("Slot aktiviert\n\tstartCalculation\n"),QMessageBox::Ok);
* --> OK
*/
calculate();
m_Controls->tableWidget_Analysis->clearContents();
m_Controls->tableWidget_Analysis->setRowCount(0);
//addRowToTableWidget("Vascutek", 2, 9.0f, 85);
addRowToTableWidget("Medtronic", 1, 15.0f, 70);
addRowToTableWidget("Gore Tex", 3, 12.0f, 55);
addTotalResultToTableWidget("Medtronic", 15, "Vascutek", 85);
}
void QmitkStentBundleView::startMeasurement()
{
/*
* QMessageBox::information(NULL, tr("Hallo"), tr("Slot wurde aktiviert\n\tstartMeasurement\n"), QMessageBox::Ok);
* --> OK
*/
if(m_Controls->lineEdit_Measurement_A->isHidden())
{
setResultbToUi(0.99);
setResultaToUi(2.99);
}
else
{
setResultAToUi(9.99);
setResultHToUi(5.99);
setResultH1ToUi(6.99);
setResultH2ToUi(3.99);
setResultIToUi(1.99);
}
}
void QmitkStentBundleView::startMeshing()
{
/*
* QMessageBox::information(NULL, tr("Hallo"), tr("Slot aktiviert\n\tstartMeshing\n"), QMessageBox::Ok);
* --> OK
*/
//meshing();
}

File Metadata

Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
590
Default Alt Text
QmitkStentBundleView.cpp (51 KB)

Event Timeline