From f2a8299c90172b676e337ed5ade8ea3e2baa7e5f Mon Sep 17 00:00:00 2001 From: cervenansky Date: Wed, 17 Jul 2013 18:44:45 +0200 Subject: [PATCH] add move directory to store dicom files --- common/clitkConfiguration.h.in | 1 + vv/CMakeLists.txt | 24 ++++++++++++++++-------- vv/vvMainWindow.cxx | 9 +++++---- vv/vvMainWindow.h | 6 +++--- vv/vvQPacsConnection.cxx | 18 +++++++++--------- vv/vvQPacsConnection.h | 1 + 6 files changed, 35 insertions(+), 24 deletions(-) diff --git a/common/clitkConfiguration.h.in b/common/clitkConfiguration.h.in index b6a8e79..8080206 100644 --- a/common/clitkConfiguration.h.in +++ b/common/clitkConfiguration.h.in @@ -25,6 +25,7 @@ #cmakedefine01 CLITK_MEMORY_INFO #cmakedefine01 CLITK_PRIVATE_FEATURES #cmakedefine01 CLITK_USE_SYSTEM_GDCM +#cmakedefine01 CLITK_USE_PACS_CONNECTION // Global environment variables #define OS_NAME "@CMAKE_SYSTEM@" diff --git a/vv/CMakeLists.txt b/vv/CMakeLists.txt index 9c991ff..7075ca1 100644 --- a/vv/CMakeLists.txt +++ b/vv/CMakeLists.txt @@ -6,7 +6,12 @@ if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) #========================================================= - +OPTION(CLITK_USE_PACS_CONNECTION "USE PACS CONNECTION" OFF) +IF (CLITK_USE_PACS_CONNECTION) + SET(CLITK_PACS_MOVE_PATH ${PROJECT_BINARY_DIR}/move) + file(MAKE_DIRECTORY ${CLITK_PACS_MOVE_PATH}) + add_definitions( -DPACS_MOVE_PATH=${LIBINTERFACE_VERSION} ) +ENDIF() #========================================================= #List of vv tools to compile SET(vv_TOOLS @@ -124,22 +129,25 @@ QT4_WRAP_UI(vv_UI_CXX qt_ui/vvDocumentation.ui qt_ui/vvDicomSeriesSelector.ui qt_ui/vvDummyWindow.ui #For testing -qt_ui/vvPacsConnection.ui - qt_ui/vvPacsSettingsDialog.ui +#qt_ui/vvPacsConnection.ui + # qt_ui/vvPacsSettingsDialog.ui ) QT4_ADD_RESOURCES(vv_SRCS vvIcons.qrc) # Add DICOM SERVER gui selector if the adequate GDCM is available -#IF(CLITK_USE_SYSTEM_GDCM) +IF(CLITK_USE_PACS_CONNECTION) SET(vv_SRCS ${vv_SRCS} vvQPacsConnection.cxx - vvPacsSettingsDialog.cxx) + vvPacsSettingsDialog.cxx + vvDicomServerQueryFactory.cxx + ) QT4_WRAP_CPP(vv_SRCS vvQPacsConnection.h vvPacsSettingsDialog.h) - #QT4_WRAP_UI(vv_UI_CXX qt_ui/vvPacsConnection.ui - # qt_ui/vvPacsSettingsDialog.ui) -#ENDIF(CLITK_USE_SYSTEM_GDCM) + QT4_WRAP_UI(vv_UI_CXX + qt_ui/vvPacsConnection.ui + qt_ui/vvPacsSettingsDialog.ui) +ENDIF(CLITK_USE_PACS_CONNECTION) # Add the autotools in the header vvToolsList.h for initialization of the dummy # variables in vv.cxx for the tools contained in vvLib diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 36d42c5..e3e5c99 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -47,7 +47,7 @@ It is distributed under dual licence #include "vvMeshReader.h" #include "vvSaveState.h" #include "vvReadState.h" -#ifdef CLITK_USE_SYSTEM_GDCM +#ifdef CLITK_USE_PACS_CONNECTION #include "vvQPacsConnection.h" #endif #include "clitkConfiguration.h" @@ -238,7 +238,7 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() documentation = new vvDocumentation(); help_dialog = new vvHelpDialog(); dicomSeriesSelector = new vvDicomSeriesSelector(); -#ifdef CLITK_USE_SYSTEM_GDCM +#ifdef CLITK_USE_PACS_CONNECTION PacsConnection = new vvQPacsConnection(); #endif @@ -283,7 +283,7 @@ 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())); - #ifdef CLITK_USE_SYSTEM_GDCM + #ifdef CLITK_USE_PACS_CONNECTION connect(actionConnect_Pacs,SIGNAL(triggered()),this,SLOT(ConnectPacs())); #endif // connect(actionOpen_Dicom_Struct,SIGNAL(triggered()),this,SLOT(OpenDCStructContour())); @@ -754,7 +754,7 @@ void vvMainWindow::OpenDicom() LoadImages(files, vvImageReader::DICOM); } } -#ifdef CLITK_USE_SYSTEM_GDCM +#ifdef CLITK_USE_PACS_CONNECTION void vvMainWindow::ConnectPacs() { std::vector files; @@ -763,6 +763,7 @@ void vvMainWindow::ConnectPacs() if (PacsConnection->exec() == QDialog::Accepted) { files = PacsConnection->getFileNames(); LoadImages(files, vvImageReader::DICOM); + PacsConnection->clearMove(); } } diff --git a/vv/vvMainWindow.h b/vv/vvMainWindow.h index 92d7041..01b53d0 100644 --- a/vv/vvMainWindow.h +++ b/vv/vvMainWindow.h @@ -39,7 +39,7 @@ class vtkImageData; class vtkRenderer; class vtkMatrix4x4; class vvDicomSeriesSelector; -#ifdef CLITK_USE_SYSTEM_GDCM +#ifdef CLITK_USE_PACS_CONNECTION class vvQPacsConnection; #endif class vvSlicer; @@ -94,7 +94,7 @@ public slots: void SliceImages(); void MergeImagesWithTime(); void OpenDicom(); -#ifdef CLITK_USE_SYSTEM_GDCM +#ifdef CLITK_USE_PACS_CONNECTION void ConnectPacs(); #endif ///Open a vtkPolyData surface mesh and display it over the current image @@ -200,7 +200,7 @@ private: vvDocumentation *documentation; vvDicomSeriesSelector *dicomSeriesSelector; -#ifdef CLITK_USE_SYSTEM_GDCM +#ifdef CLITK_USE_PACS_CONNECTION vvQPacsConnection *PacsConnection; #endif diff --git a/vv/vvQPacsConnection.cxx b/vv/vvQPacsConnection.cxx index 9208768..7c7f395 100644 --- a/vv/vvQPacsConnection.cxx +++ b/vv/vvQPacsConnection.cxx @@ -182,10 +182,10 @@ void vvQPacsConnection::createTreeView() // clean the different model Trees void vvQPacsConnection::cleanTree() { - Patientmodel->removeRows(0,Patientmodel->rowCount(),QModelIndex()); - Studymodel->removeRows(0,Patientmodel->rowCount(),QModelIndex()); - Seriesmodel->removeRows(0,Patientmodel->rowCount(),QModelIndex()); - Imagesmodel->removeRows(0,Patientmodel->rowCount(),QModelIndex()); + Patientmodel->removeRows(0,Patientmodel->rowCount()); + Studymodel->removeRows(0,Patientmodel->rowCount()); + Seriesmodel->removeRows(0,Patientmodel->rowCount()); + Imagesmodel->removeRows(0,Patientmodel->rowCount()); } @@ -197,19 +197,20 @@ void vvQPacsConnection::selectStudies(const QModelIndex &index) Seriesmodel->removeRows(0, Seriesmodel->rowCount(),QModelIndex()); Imagesmodel->removeRows(0, Imagesmodel->rowCount(),QModelIndex()); manageSeriesFilter(true); - m_query = mQFactory.getQueryPatient("",m_patient); convertDataSet( findQuery( mQFactory.getQueryforStudy(m_patient, false)) , Studymodel, mQFactory.getQueryKeysforStudy("",true)); } +void vvQPacsConnection::clearMove() +{ +} void vvQPacsConnection::selectSeries(const QModelIndex &index) { m_study= Studymodel->data(index.sibling(index.row(),3)).toString().toStdString(); Seriesmodel->removeRows(0, Seriesmodel->rowCount()); Imagesmodel->removeRows(0, Imagesmodel->rowCount()); - m_query = mQFactory.getQueryforSeries(m_patient,m_study, false); convertDataSet( findQuery( mQFactory.getQueryforSeries(m_patient,m_study, false)), Seriesmodel, mQFactory.getSeriesKeys("","",true)); } @@ -218,7 +219,6 @@ void vvQPacsConnection::selectImages(const QModelIndex &index) { m_series = Seriesmodel->data(index.sibling(index.row(),2)).toString().toStdString(); Imagesmodel->removeRows(0, Imagesmodel->rowCount(),QModelIndex()); - m_query = mQFactory.getQueryforImages(m_patient,m_study, m_series, false); convertDataSet( findQuery( mQFactory.getQueryforImages(m_patient,m_study, m_series, false) ), Imagesmodel, mQFactory.getQueryKeysforImages("","","",true)); } @@ -367,9 +367,9 @@ void vvQPacsConnection::on_importButton_clicked() bool didItWork = gdcm::CompositeNetworkFunctions::CMove(m_adress.c_str(),atoi(m_port.c_str()), gdcm::CompositeNetworkFunctions::ConstructQuery(mQFactory.getMoveQuery().theRoot, mQFactory.getMoveQuery().theLevel ,mQFactory.getMoveQuery().keys,true), - getDicomClientPort(), getDicomClientAETitle().c_str(), m_aetitle.c_str(),"D:\\move" ); + getDicomClientPort(), getDicomClientAETitle().c_str(), m_aetitle.c_str(), gets(CLITK_PACS_MOVE_PATH) ); gdcm::Directory theDir; - theDir.Load("D:\\move"); + theDir.Load(gets(CLITK_PACS_MOVE_PATH)); m_files = theDir.GetFilenames(); accept(); } diff --git a/vv/vvQPacsConnection.h b/vv/vvQPacsConnection.h index e17c3b3..28a3d41 100644 --- a/vv/vvQPacsConnection.h +++ b/vv/vvQPacsConnection.h @@ -27,6 +27,7 @@ ~vvQPacsConnection(){} void refreshNetworks(); std::vector getFileNames(); + void clearMove(); public slots: void selectStudies(const QModelIndex &index); -- 2.45.1