From 99053cb10db94edb40026024221af91ac6864df0 Mon Sep 17 00:00:00 2001 From: cervenansky Date: Mon, 1 Jul 2013 09:36:22 +0200 Subject: [PATCH] corrections for recent version of gdcm --- vv/qt_ui/vvMainWindow.ui | 8 ++- vv/qt_ui/vvPacsConnection.ui | 20 +++--- vv/vvMainWindow.cxx | 14 ++-- vv/vvMainWindow.h | 5 +- vv/vvQPacsConnection.cxx | 122 ++++++++++++++++++----------------- vv/vvQPacsConnection.h | 11 ++-- 6 files changed, 98 insertions(+), 82 deletions(-) diff --git a/vv/qt_ui/vvMainWindow.ui b/vv/qt_ui/vvMainWindow.ui index 5cf4b33..c86d6c8 100644 --- a/vv/qt_ui/vvMainWindow.ui +++ b/vv/qt_ui/vvMainWindow.ui @@ -810,7 +810,7 @@ 0 0 1008 - 20 + 21 @@ -881,6 +881,7 @@ + @@ -1273,6 +1274,11 @@ true + + + Connect Pacs + + diff --git a/vv/qt_ui/vvPacsConnection.ui b/vv/qt_ui/vvPacsConnection.ui index 086b50a..9e89d0b 100644 --- a/vv/qt_ui/vvPacsConnection.ui +++ b/vv/qt_ui/vvPacsConnection.ui @@ -197,16 +197,16 @@ Studies - - - - - 410 - 150 - 411 - 231 - - + + + + 40 + 20 + 411 + 231 + + + diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 12d8d27..d25228c 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -47,6 +47,7 @@ It is distributed under dual licence #include "vvMeshReader.h" #include "vvSaveState.h" #include "vvReadState.h" +#include "vvQPacsConnection.h" #include "clitkConfiguration.h" // ITK include @@ -235,7 +236,7 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() documentation = new vvDocumentation(); help_dialog = new vvHelpDialog(); dicomSeriesSelector = new vvDicomSeriesSelector(); - PacsConnection = new vvPacsConnection(); + pacsconnect = new vvQPacsConnection(this); inverseButton->setEnabled(0); actionAdd_overlay_image_to_current_image->setEnabled(0); @@ -278,6 +279,8 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() connect(actionWarp_image_with_vector_field,SIGNAL(triggered()),this,SLOT(WarpImage())); connect(actionLoad_images,SIGNAL(triggered()),this,SLOT(OpenImages())); connect(actionOpen_Dicom,SIGNAL(triggered()),this,SLOT(OpenDicom())); +connect(actionConnect_Pacs,SIGNAL(triggered()),this,SLOT(ConnectPacs())); + // connect(actionOpen_Dicom_Struct,SIGNAL(triggered()),this,SLOT(OpenDCStructContour())); connect(actionOpen_VTK_contour,SIGNAL(triggered()),this,SLOT(OpenVTKContour())); connect(actionOpen_Multiple_Images_As_One,SIGNAL(triggered()),this,SLOT(MergeImages())); @@ -745,18 +748,19 @@ void vvMainWindow::OpenDicom() files = *(dicomSeriesSelector->GetFilenames()); LoadImages(files, vvImageReader::DICOM); } - +} void vvMainWindow::ConnectPacs() { std::vector files; //std::cout << "dicomSeriesSelector " << std::endl; - if (PacsConnection->exec() == QDialog::Accepted) { - files = *(PacsConnection->GetFilenames()); + /*if (pacsconnect->exec() == QDialog::Accepted) { + files = *(pacsconnect->GetFilenames()); LoadImages(files, vvImageReader::DICOM); + }*/ } -} + //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ diff --git a/vv/vvMainWindow.h b/vv/vvMainWindow.h index eee1d64..877470f 100644 --- a/vv/vvMainWindow.h +++ b/vv/vvMainWindow.h @@ -39,6 +39,7 @@ class vtkImageData; class vtkRenderer; class vtkMatrix4x4; class vvDicomSeriesSelector; +class vvQPacsConnection; class vvSlicer; class QTreeWidget; @@ -91,7 +92,7 @@ public slots: void SliceImages(); void MergeImagesWithTime(); void OpenDicom(); - void PacsConnection(); + void ConnectPacs(); ///Open a vtkPolyData surface mesh and display it over the current image void OpenVTKContour(); void SaveAs(); @@ -194,7 +195,7 @@ private: vvHelpDialog *help_dialog; vvDocumentation *documentation; vvDicomSeriesSelector *dicomSeriesSelector; - vvPacsConnection *PacsConnection; + vvQPacsConnection *pacsconnect; bool viewMode; bool playMode; diff --git a/vv/vvQPacsConnection.cxx b/vv/vvQPacsConnection.cxx index 0f3f916..6b880ad 100644 --- a/vv/vvQPacsConnection.cxx +++ b/vv/vvQPacsConnection.cxx @@ -1,34 +1,37 @@ +#ifndef _VVPACSCONNECTION_CXX +#define _VVPACSCONNECTION_CXX #include "vvQPacsConnection.h" #include "gdcmCompositeNetworkFunctions.h" #include #include #include +#include #include vvQPacsConnection::vvQPacsConnection(QWidget *i_parent) - :QWidget(i_parent) + :QDialog(i_parent) { - setupUi(this); - setWindowTitle(QString::fromUtf8("DCM API PACS")); + ui.setupUi(this); + setWindowTitle(QString::fromUtf8("PACS CONNECTION")); createTreeView(); - tabFilter->setTabText(0,QString(tr("Modality"))); - tabFilter->setTabText(1,QString(tr("Date"))); + ui.tabFilter->setTabText(0,QString(tr("Modality"))); + ui.tabFilter->setTabText(1,QString(tr("Date"))); - tabNetwork->setTabText(0,QString(tr("Network"))); - tabNetwork->setTabText(1,QString(tr("Configuration"))); - check_ModAll->setChecked(true); - on_check_ModAll_clicked(true); + ui. tabNetwork->setTabText(0,QString(tr("Network"))); + ui. tabNetwork->setTabText(1,QString(tr("Configuration"))); + //ui.setChecked(true); + //ui.on_check_ModAll_clicked(true); QIcon icon; icon.addFile("basket_download.png",QSize(),QIcon::Normal,QIcon::Off); - importButton->setIcon(icon); + ui.importButton->setIcon(icon); icon.addFile("file_upload.png",QSize(),QIcon::Normal,QIcon::Off); // exportButton->setIcon(icon); icon.addFile("email_forward.png",QSize(),QIcon::Normal,QIcon::Off); icon.addFile("edit.png",QSize(),QIcon::Normal,QIcon::Off); - optionsButton->setIcon(icon); + ui.optionsButton->setIcon(icon); icon.addFile("bullet_info.png",QSize(),QIcon::Normal,QIcon::Off); - helpButton->setIcon(icon); + ui.helpButton->setIcon(icon); update(); } @@ -126,7 +129,7 @@ void vvQPacsConnection::on_importButton_clicked() { QModelIndex index; - QVariant elt= Patientmodel->data(index.sibling(patientTreeView->selectionModel()->selectedRows().first().row(),1)); + QVariant elt= Patientmodel->data(index.sibling(ui.patientTreeView->selectionModel()->selectedRows().first().row(),1)); gdcm::EQueryLevel theLevel = gdcm::ePatient; gdcm::ERootType theRoot = gdcm::ePatientRootType;//ePatientRootType; @@ -196,9 +199,9 @@ Patientlist.push_back(tr("PATIENT NAME")); Patientlist.push_back(tr("PATIENT ID")); Patientmodel->setHorizontalHeaderLabels(Patientlist); - patientTreeView->setModel(Patientmodel); - patientTreeView->setEnabled(true); - connect(patientTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(selectStudies(QModelIndex))); + ui.patientTreeView->setModel(Patientmodel); + ui.patientTreeView->setEnabled(true); + connect(ui.patientTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(selectStudies(QModelIndex))); // Study Tree View Studymodel = new QStandardItemModel(0,3,this); @@ -207,8 +210,8 @@ Studylist.push_back(tr("DATE")); Studylist.push_back(tr("HOUR")); Studymodel->setHorizontalHeaderLabels(Studylist); - studyTreeView->setModel(Studymodel); - connect(studyTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(selectSeries(QModelIndex))); + ui.studyTreeView->setModel(Studymodel); + connect(ui.studyTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(selectSeries(QModelIndex))); // Series Tree View @@ -218,15 +221,15 @@ Serieslist.push_back(tr("DESCRIPTION")); Serieslist.push_back(tr("no. accept.")); Seriesmodel->setHorizontalHeaderLabels(Serieslist); - seriesTreeView->setModel(Seriesmodel); - connect(seriesTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(selectImages(QModelIndex))); + ui.seriesTreeView->setModel(Seriesmodel); + connect(ui.seriesTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(selectImages(QModelIndex))); // Images Tree View Imagesmodel = new QStandardItemModel(0,1,this); QStringList Imageslist; Imageslist.push_back(tr("instance number")); Imagesmodel->setHorizontalHeaderLabels(Imageslist); - imagesTreeView->setModel(Imagesmodel); + ui.imagesTreeView->setModel(Imagesmodel); //model->setHeaderData(0, Qt::Horizontal,tr("test"),Qt::DisplayRole); /*QFileSystemModel *filemodel = new QFileSystemModel; @@ -268,7 +271,7 @@ { Seriesmodel->removeRows(0, Seriesmodel->rowCount(),QModelIndex()); QVariant elt= Studymodel->data(index.sibling(index.row(),3)); - QVariant elt2= Patientmodel->data(index.sibling(patientTreeView->selectionModel()->selectedRows().first().row(),1)); + QVariant elt2= Patientmodel->data(index.sibling(ui.patientTreeView->selectionModel()->selectedRows().first().row(),1)); //manageImagesFilter(true); gdcm::EQueryLevel theLevel = gdcm::eSeries; @@ -309,10 +312,10 @@ { Imagesmodel->removeRows(0, Imagesmodel->rowCount(),QModelIndex()); QVariant elt= Seriesmodel->data(index.sibling(index.row(),2)); - QVariant elt2= Patientmodel->data(index.sibling(patientTreeView->selectionModel()->selectedRows().first().row(),1)); + QVariant elt2= Patientmodel->data(index.sibling(ui.patientTreeView->selectionModel()->selectedRows().first().row(),1)); //manageImagesFilter(true); - gdcm::EQueryLevel theLevel = gdcm::eImageOrFrame; + gdcm::EQueryLevel theLevel = gdcm::eImage; gdcm::ERootType theRoot = gdcm::ePatientRootType;//ePatientRootType; std::vector theDataSet; std::vector< std::pair > keys; @@ -343,15 +346,15 @@ void vvQPacsConnection::manageStudiesFilter(bool i_enable) { - text_PHYS->setEnabled(i_enable); - text_SDESC->setEnabled(i_enable); - dateTab->setEnabled(i_enable); + ui.text_PHYS->setEnabled(i_enable); + ui.text_SDESC->setEnabled(i_enable); + ui.dateTab->setEnabled(i_enable); } void vvQPacsConnection::manageSeriesFilter(bool i_enable) { - modalityTab->setEnabled(i_enable); + ui.modalityTab->setEnabled(i_enable); } std::vector< std::pair > vvQPacsConnection::getPatientKeys(const std::string i_val) @@ -445,38 +448,39 @@ void vvQPacsConnection::on_check_ModAll_clicked(bool state) { - check_MR->setEnabled(!state); - check_CR->setEnabled(!state); - check_OT->setEnabled(!state); - check_RF->setEnabled(!state); - check_SC->setEnabled(!state); - check_CT->setEnabled(!state); - check_US->setEnabled(!state); - check_NM->setEnabled(!state); - check_DR->setEnabled(!state); - check_US->setEnabled(!state); - check_NM->setEnabled(!state); - check_DR->setEnabled(!state); - check_SR->setEnabled(!state); - check_XA->setEnabled(!state); - check_MG->setEnabled(!state); + ui.check_MR->setEnabled(!state); + ui.check_CR->setEnabled(!state); + ui.check_OT->setEnabled(!state); + ui.check_RF->setEnabled(!state); + ui.check_SC->setEnabled(!state); + ui.check_CT->setEnabled(!state); + ui.check_US->setEnabled(!state); + ui.check_NM->setEnabled(!state); + ui.check_DR->setEnabled(!state); + ui.check_US->setEnabled(!state); + ui.check_NM->setEnabled(!state); + ui.check_DR->setEnabled(!state); + ui.check_SR->setEnabled(!state); + ui.check_XA->setEnabled(!state); + ui.check_MG->setEnabled(!state); if(state) { - check_MR->setChecked(state); - check_CR->setChecked(state); - check_OT->setChecked(state); - check_RF->setChecked(state); - check_SC->setChecked(state); - check_CT->setChecked(state); - check_US->setChecked(state); - check_NM->setChecked(state); - check_DR->setChecked(state); - check_US->setChecked(state); - check_NM->setChecked(state); - check_DR->setChecked(state); - check_SR->setChecked(state); - check_XA->setChecked(state); - check_MG->setChecked(state); + ui.check_MR->setChecked(state); + ui.check_CR->setChecked(state); + ui.check_OT->setChecked(state); + ui.check_RF->setChecked(state); + ui.check_SC->setChecked(state); + ui.check_CT->setChecked(state); + ui.check_US->setChecked(state); + ui.check_NM->setChecked(state); + ui.check_DR->setChecked(state); + ui.check_US->setChecked(state); + ui.check_NM->setChecked(state); + ui.check_DR->setChecked(state); + ui.check_SR->setChecked(state); + ui.check_XA->setChecked(state); + ui.check_MG->setChecked(state); } - } \ No newline at end of file + } +#endif \ No newline at end of file diff --git a/vv/vvQPacsConnection.h b/vv/vvQPacsConnection.h index fbbdbeb..f94818d 100644 --- a/vv/vvQPacsConnection.h +++ b/vv/vvQPacsConnection.h @@ -6,19 +6,19 @@ #include "gdcmCompositeNetworkFunctions.h" #include #include - +#include /** * \ingroup GUI */ //===================================================================== - //===================================================================== - class vvQPacsConnection : public QWidget , public Ui_vvPacsConnection + //====================================================================== + class vvQPacsConnection : public QDialog { Q_OBJECT public: - vvQPacsConnection(){} - vvQPacsConnection(QWidget *parent); + //vvQPacsConnection(){} + vvQPacsConnection(QWidget *parent=0); ~vvQPacsConnection(){} ///Queries the PACS @@ -35,6 +35,7 @@ public slots: private : + Ui::vvPacsConnection ui; std::vector< std::pair > getKeys(); std::vector< std::pair > getPatientKeys(const std::string ); std::vector< std::pair > getStudyKeys(const std::string); -- 2.45.1