]> Creatis software - clitk.git/commitdiff
corrections for recent version of gdcm
authorcervenansky <frederic.cervenansky@creatis.insa-lyon.fr>
Mon, 1 Jul 2013 07:36:22 +0000 (09:36 +0200)
committercervenansky <frederic.cervenansky@creatis.insa-lyon.fr>
Mon, 1 Jul 2013 07:36:22 +0000 (09:36 +0200)
vv/qt_ui/vvMainWindow.ui
vv/qt_ui/vvPacsConnection.ui
vv/vvMainWindow.cxx
vv/vvMainWindow.h
vv/vvQPacsConnection.cxx
vv/vvQPacsConnection.h

index 5cf4b33b473fdff99dead3057a7ea2bd0babc21d..c86d6c892ff3a3270ec4c7000be7a6187e9adf29 100644 (file)
      <x>0</x>
      <y>0</y>
      <width>1008</width>
-     <height>20</height>
+     <height>21</height>
     </rect>
    </property>
    <property name="defaultUp">
     <addaction name="actionExit"/>
     <addaction name="separator"/>
     <addaction name="separator"/>
+    <addaction name="actionConnect_Pacs"/>
    </widget>
    <addaction name="menuFile"/>
    <addaction name="menuOverlay"/>
     <bool>true</bool>
    </property>
   </action>
+  <action name="actionConnect_Pacs">
+   <property name="text">
+    <string>Connect Pacs</string>
+   </property>
+  </action>
  </widget>
  <customwidgets>
   <customwidget>
index 086b50a6e181209a83dd4bd5e0aeba8d259e18ac..9e89d0b817c8b6a2928b975f10179ef8e0531f91 100644 (file)
    <property name="title">
     <string>Studies</string>
    </property>
-  </widget>
-  <widget class="QTreeView" name="studyTreeView">
-   <property name="geometry">
-    <rect>
-     <x>410</x>
-     <y>150</y>
-     <width>411</width>
-     <height>231</height>
-    </rect>
-   </property>
+   <widget class="QTreeView" name="studyTreeView">
+    <property name="geometry">
+     <rect>
+      <x>40</x>
+      <y>20</y>
+      <width>411</width>
+      <height>231</height>
+     </rect>
+    </property>
+   </widget>
   </widget>
   <widget class="QTreeView" name="seriesTreeView">
    <property name="geometry">
index 12d8d27f621bde8102a642c14d635e11b98cb55d..d25228c346d79652212c3a7f0db871eb2958cf84 100644 (file)
@@ -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<std::string> 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);
+  }*/
   }
 
-}
+
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
index eee1d64b807eadea3582532b08c898bf21067710..877470fe20b67c274bb4775973cc3ab9646f2550 100644 (file)
@@ -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;
index 0f3f91657f3c3c7e7056bb8bbebb6d6781acd164..6b880ad4f4e08a1ff302c1b412551e986e62d648 100644 (file)
@@ -1,34 +1,37 @@
+#ifndef _VVPACSCONNECTION_CXX
+#define _VVPACSCONNECTION_CXX
 #include "vvQPacsConnection.h"
 #include "gdcmCompositeNetworkFunctions.h"
 #include <QtGui/qlistview.h>
 #include <qfile.h>
 #include <QDate>
+#include <QIcon>
 #include <QDateTime>
 
 
        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();
        }
 
        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;
                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); 
                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
                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;
        {
                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;
        {
                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<gdcm::DataSet> theDataSet;
                std::vector< std::pair<gdcm::Tag, std::string> > keys;
 
        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<gdcm::Tag, std::string> > vvQPacsConnection::getPatientKeys(const std::string i_val)
 
        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
index fbbdbeb3602c67d7743e51500a491235c7cdc6a0..f94818d384188e8821442baf4e3caeaa905dd14c 100644 (file)
@@ -6,19 +6,19 @@
 #include "gdcmCompositeNetworkFunctions.h"
 #include <QtGui/QStandardItemModel.h>
 #include <QtGui/QStringListModel.h>
-
+#include <QFileDialog>
 
   /**
    * \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<gdcm::Tag, std::string> > getKeys();
        std::vector< std::pair<gdcm::Tag, std::string> > getPatientKeys(const std::string );
        std::vector< std::pair<gdcm::Tag, std::string> > getStudyKeys(const std::string);