From: cervenansky Date: Fri, 28 Jun 2013 08:24:10 +0000 (+0200) Subject: first developments for PacsConnection X-Git-Tag: v1.4.0~2^2~32 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=3378f6c372da1e07e35c45562749416fcfee6798;p=clitk.git first developments for PacsConnection --- diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 95a1023..ba65d28 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -66,7 +66,8 @@ ENDIF(CLITK_MEMORY_INFO) IF (CLITK_USE_SYSTEM_GDCM) FIND_PACKAGE(GDCM REQUIRED) include(${GDCM_USE_FILE}) - TARGET_LINK_LIBRARIES(clitkCommon vtkgdcm gdcmDICT gdcmMSFF) + TARGET_LINK_LIBRARIES(clitkCommon vtkgdcm) + # gdcmDICT gdcmMSFF) ENDIF() #========================================================= diff --git a/vv/CMakeLists.txt b/vv/CMakeLists.txt index 9895570..c901fab 100644 --- a/vv/CMakeLists.txt +++ b/vv/CMakeLists.txt @@ -71,6 +71,7 @@ SET(vv_COMMON_WITH_UI SET(vv_SRCS vvQProgressDialogITKCommand.cxx vvQDicomSeriesSelector.cxx + vvQPacsConnection.cxx QTreePushButton.cxx vvMainWindowBase.cxx vvImageWarp.cxx @@ -113,6 +114,7 @@ QT4_WRAP_CPP(vv_SRCS vvDocumentation.h vvHelpDialog.h vvQDicomSeriesSelector.h + vvQPacsConnection.h vvSlicerManager.h vvStructureSetActor.h vvROIActor.h @@ -123,6 +125,7 @@ QT4_WRAP_UI(vv_UI_CXX qt_ui/vvHelpDialog.ui qt_ui/vvDocumentation.ui qt_ui/vvDicomSeriesSelector.ui + qt_ui/vvPacsConnection.ui qt_ui/vvDummyWindow.ui #For testing ) diff --git a/vv/icons/basket_download.png b/vv/icons/basket_download.png new file mode 100644 index 0000000..0038c1c Binary files /dev/null and b/vv/icons/basket_download.png differ diff --git a/vv/icons/bullet_info.png b/vv/icons/bullet_info.png new file mode 100644 index 0000000..326cf65 Binary files /dev/null and b/vv/icons/bullet_info.png differ diff --git a/vv/icons/edit.png b/vv/icons/edit.png new file mode 100644 index 0000000..c97e3a3 Binary files /dev/null and b/vv/icons/edit.png differ diff --git a/vv/qt_ui/vvPacsConnection.ui b/vv/qt_ui/vvPacsConnection.ui new file mode 100644 index 0000000..086b50a --- /dev/null +++ b/vv/qt_ui/vvPacsConnection.ui @@ -0,0 +1,759 @@ + + + vvPacsConnection + + + + 0 + 0 + 923 + 783 + + + + + Calibri + 9 + 75 + true + + + + Form + + + + false + + + + 110 + 10 + 91 + 16 + + + + Patient ID + + + + + + 110 + 30 + 101 + 21 + + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + false + + + + + + 10 + 40 + 75 + 23 + + + + SCAN + + + + + + 10 + 70 + 75 + 23 + + + + CLEAR + + + + + + 250 + 30 + 101 + 21 + + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + false + + + + + false + + + + 250 + 10 + 91 + 16 + + + + Patient name + + + + + + 10 + 160 + 51 + 51 + + + + ... + + + + basket_download.pngbasket_download.png + + + + 32 + 32 + + + + + + + 70 + 130 + 311 + 271 + + + + + 11 + + + + Patients + + + + true + + + + 20 + 20 + 281 + 231 + + + + Qt::ScrollBarAlwaysOn + + + true + + + false + + + + + + + 390 + 130 + 451 + 271 + + + + + 11 + + + + Studies + + + + + + 410 + 150 + 411 + 231 + + + + + + + 90 + 440 + 281 + 311 + + + + + + + 410 + 440 + 411 + 311 + + + + + + + 70 + 420 + 321 + 341 + + + + + 11 + + + + Series + + + + + + 380 + 420 + 451 + 341 + + + + + 11 + + + + Images + + + + + false + + + + 110 + 80 + 101 + 21 + + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + false + + + + + false + + + + 110 + 60 + 91 + 16 + + + + Physician Ref. + + + + + false + + + + 250 + 60 + 91 + 16 + + + + Study Description + + + + + false + + + + 250 + 80 + 101 + 21 + + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + false + + + + + + 390 + 0 + 271 + 131 + + + + 1 + + + + false + + + Modalities + + + + + 0 + 10 + 264 + 72 + + + + + + + + + MR + + + + + + + CR + + + + + + + OT + + + + + + + RF + + + + + + + SC + + + + + + + CT + + + + + + + + + + + US + + + + + + + NM + + + + + + + DR + + + + + + + SR + + + + + + + XA + + + + + + + MG + + + + + + + + + All + + + true + + + + + + + + + false + + + Date + + + + + 20 + 20 + 101 + 22 + + + + + Before + + + + + After + + + + + Between + + + + + + + 130 + 20 + 110 + 22 + + + + + + + 130 + 50 + 110 + 22 + + + + + + + + + 680 + 0 + 231 + 131 + + + + 1 + + + + Network + + + + + 10 + 10 + 101 + 17 + + + + HCL Neuro + + + + + + 10 + 40 + 70 + 17 + + + + conquest + + + + + + Network management + + + + + 180 + 40 + 41 + 23 + + + + OK + + + + + + 0 + 0 + 179 + 100 + + + + + + + false + + + Name + + + + + + + + + + false + + + AE Title + + + + + + + + + + false + + + Adress + + + + + + + + + + false + + + Port + + + + + + + + + + + + + true + + + + 10 + 210 + 71 + 16 + + + + Import Data + + + + + true + + + + 10 + 530 + 51 + 20 + + + + Help + + + Qt::AlignCenter + + + + + + 10 + 480 + 51 + 51 + + + + ... + + + + bullet_info.pngbullet_info.png + + + + 32 + 32 + + + + + + + 10 + 400 + 51 + 51 + + + + ... + + + + edit.pngedit.png + + + + 32 + 32 + + + + + + true + + + + 20 + 450 + 41 + 21 + + + + Options + + + + + + + + diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 4210798..12d8d27 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -235,6 +235,7 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() documentation = new vvDocumentation(); help_dialog = new vvHelpDialog(); dicomSeriesSelector = new vvDicomSeriesSelector(); + PacsConnection = new vvPacsConnection(); inverseButton->setEnabled(0); actionAdd_overlay_image_to_current_image->setEnabled(0); @@ -744,6 +745,17 @@ 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()); + LoadImages(files, vvImageReader::DICOM); + } + } //------------------------------------------------------------------------------ diff --git a/vv/vvMainWindow.h b/vv/vvMainWindow.h index e5e3155..eee1d64 100644 --- a/vv/vvMainWindow.h +++ b/vv/vvMainWindow.h @@ -91,6 +91,7 @@ public slots: void SliceImages(); void MergeImagesWithTime(); void OpenDicom(); + void PacsConnection(); ///Open a vtkPolyData surface mesh and display it over the current image void OpenVTKContour(); void SaveAs(); @@ -193,6 +194,7 @@ private: vvHelpDialog *help_dialog; vvDocumentation *documentation; vvDicomSeriesSelector *dicomSeriesSelector; + vvPacsConnection *PacsConnection; bool viewMode; bool playMode; diff --git a/vv/vvQPacsConnection.cxx b/vv/vvQPacsConnection.cxx new file mode 100644 index 0000000..0f3f916 --- /dev/null +++ b/vv/vvQPacsConnection.cxx @@ -0,0 +1,482 @@ +#include "vvQPacsConnection.h" +#include "gdcmCompositeNetworkFunctions.h" +#include +#include +#include +#include + + + vvQPacsConnection::vvQPacsConnection(QWidget *i_parent) + :QWidget(i_parent) + { + setupUi(this); + setWindowTitle(QString::fromUtf8("DCM API PACS")); + createTreeView(); + tabFilter->setTabText(0,QString(tr("Modality"))); + 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); + QIcon icon; + icon.addFile("basket_download.png",QSize(),QIcon::Normal,QIcon::Off); + 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); + icon.addFile("bullet_info.png",QSize(),QIcon::Normal,QIcon::Off); + helpButton->setIcon(icon); + update(); + } + + + void vvQPacsConnection::on_clearButton_clicked() + { + Patientmodel->removeRows(0, Patientmodel->rowCount(),QModelIndex()); + Studymodel->removeRows(0, Studymodel->rowCount(),QModelIndex()); + Seriesmodel->removeRows(0, Seriesmodel->rowCount(),QModelIndex()); + Imagesmodel->removeRows(0, Imagesmodel->rowCount(),QModelIndex()); + } + + void vvQPacsConnection::on_scanButton_clicked() + { + //on_clearButton_clicked(); + manageStudiesFilter(true); + #if defined (USE_GDCM2) + bool didItWork = gdcm::CompositeNetworkFunctions::CEcho( "127.0.0.1", 5678, + "CREATIS", "CONQUESTSRV1" ); + /* tag.SetElement(8); + tag.SetGroup(8);*/ + std::vector< std::pair > keys = getKeys(); + + //std::pair pa; + //pa.first = tag; + //pa.second = ""; + ////keys.push_back(std::make_pair(tag, "")); + gdcm::EQueryLevel theLevel = gdcm::eStudy; + gdcm::ERootType theRoot = gdcm::eStudyRootType;//ePatientRootType; + //gdcm::SmartPointer theQuery = gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys); + + + std::vector theDataSet; + + theLevel = gdcm::ePatient; + theRoot = gdcm::ePatientRootType;//ePatientRootType; + gdcm::SmartPointer theQuery = gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,getPatientKeys("")); + +// +//theDataSet.clear(); +// gdcm::CompositeNetworkFunctions::CFind("127.0.0.1", 5678, theQuery, theDataSet, +// "CREATIS", "CONQUESTSRV1"); +// keys.clear(); +// keys.push_back(std::make_pair(gdcm::Tag(0x0010,0x0010), "")); +// + gdcm::CompositeNetworkFunctions::CFind("127.0.0.1", 5678, theQuery, theDataSet, + "CREATIS", "CONQUESTSRV1"); + std::vector::iterator it_ds = theDataSet.begin(); +// + for(; it_ds != theDataSet.end(); it_ds++) + { + + QList items; + const gdcm::DataSet ds = (*it_ds); + std::vector< std::pair >::iterator it_key = keys.begin(); + int ind = 0; + for(; it_key != keys.end(); it_key++, ind++) + { + gdcm::DataElement de = ds.GetDataElement((*it_key).first); + QStandardItem *item = new QStandardItem; + const gdcm::ByteValue *bv = (de).GetByteValue(); + if( !de.IsEmpty() ) + { + std::string buffer = std::string( bv->GetPointer(), bv->GetLength() ); + item->setText(tr(buffer.c_str())); + } + else + { + item->setText(tr("")); + } + if(ind ==0) + { + item->setCheckable(true); + } + items.push_back(item); + } + Patientmodel->appendRow(items); + } +// gdcm::Tag tagtest(0x0020,0x1208); +// keys.clear(); +// keys.push_back(std::make_pair(gdcm::Tag(0x0010,0x0010), "")); +//// keys.push_back(std::make_pair(tagtest, "")); +// theLevel = gdcm::ePatient; +// theRoot = gdcm::ePatientRootType;//ePatientRootType; +// theQuery = gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys); +// +// +//theDataSet.clear(); +// gdcm::CompositeNetworkFunctions::CFind("127.0.0.1", 5678, theQuery, theDataSet, +// "CREATIS", "CONQUESTSRV1"); +#endif + } + + + void vvQPacsConnection::on_importButton_clicked() + { + QModelIndex index; + QVariant elt= Patientmodel->data(index.sibling(patientTreeView->selectionModel()->selectedRows().first().row(),1)); + + gdcm::EQueryLevel theLevel = gdcm::ePatient; + gdcm::ERootType theRoot = gdcm::ePatientRootType;//ePatientRootType; + std::vector theDataSet; + std::vector< std::pair > keys; + + // Study Description + gdcm::Tag tagsdc(0x0010,0x0020); + keys.push_back(std::make_pair(tagsdc, elt.toString().toStdString())); + gdcm::SmartPointer theQuery = gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys); + gdcm::CompositeNetworkFunctions::CFind("127.0.0.1", 5678, theQuery, theDataSet, "CREATIS", "CONQUESTSRV1"); + + bool didItWork = gdcm::CompositeNetworkFunctions::CMove( "127.0.0.1", 5678, theQuery, 0, + "CREATIS", "CONQUESTSRV1", "d:\\temp_pacs_import\\" ); + } + + void vvQPacsConnection::convertDataSet(std::vector i_ds, QStandardItemModel *i_model, std::vector< std::pair > keys) + { + gdcm::Tag tagdb(0x0008,0x0020); + std::vector::iterator it_ds = i_ds.begin(); + for(; it_ds != i_ds.end(); it_ds++) + { + QList items; + const gdcm::DataSet ds = (*it_ds); + std::vector< std::pair >::iterator it_key = keys.begin(); + int ind = 0; + for(; it_key != keys.end(); it_key++, ind++) + { + gdcm::DataElement de = ds.GetDataElement((*it_key).first); + QStandardItem *item = new QStandardItem; + const gdcm::ByteValue *bv = (de).GetByteValue(); + if( !de.IsEmpty() ) + { + std::string buffer = std::string( bv->GetPointer(), bv->GetLength() ); + /*if((*it_key).first == tagdb) + { + QDate date; + date.fromString(tr(buffer.c_str()),"yyyy'MM'd"); + item->setText(date.toString()); + } + else + {*/ + item->setText(tr(buffer.c_str())); + //} + } + else + { + item->setText(tr("")); + } + if(ind ==0) + { + item->setCheckable(true); + } + items.push_back(item); + } + i_model->appendRow(items); + } + + } + + + void vvQPacsConnection::createTreeView() + { + // Patient Tree View + Patientmodel = new QStandardItemModel(0,2,this); + QStringList Patientlist; + 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))); + + // Study Tree View + Studymodel = new QStandardItemModel(0,3,this); + QStringList Studylist; + Studylist.push_back(tr("DESCRIPTION")); + 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))); + + + // Series Tree View + Seriesmodel = new QStandardItemModel(0,2,this); + QStringList Serieslist; + Serieslist.push_back(tr("MODALITY")); + 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))); + + // Images Tree View + Imagesmodel = new QStandardItemModel(0,1,this); + QStringList Imageslist; + Imageslist.push_back(tr("instance number")); + Imagesmodel->setHorizontalHeaderLabels(Imageslist); + imagesTreeView->setModel(Imagesmodel); + + //model->setHeaderData(0, Qt::Horizontal,tr("test"),Qt::DisplayRole); + /*QFileSystemModel *filemodel = new QFileSystemModel; + filemodel->insertColumn(1); + filemodel->setHeaderData(1, Qt::Horizontal,"test",0);*/ + + } + + void vvQPacsConnection::selectStudies(const QModelIndex &index) + { + Studymodel->removeRows(0, Studymodel->rowCount(),QModelIndex()); + QVariant elt= Patientmodel->data(index.sibling(index.row(),1)); + m_patient=elt.toString().toStdString(); + manageSeriesFilter(true); + gdcm::EQueryLevel theLevel = gdcm::eStudy; + gdcm::ERootType theRoot = gdcm::ePatientRootType;//ePatientRootType; + std::vector theDataSet; + std::vector< std::pair > keys; + + // Study Description + gdcm::Tag tagsd(0x0010,0x0020); + keys.push_back(std::make_pair(tagsd, m_patient)); + // Study Description + gdcm::Tag tagsdc(0x0008,0x1030); + keys.push_back(std::make_pair(tagsdc, "")); + // Study date + gdcm::Tag tagdb(0x0008,0x0020); + keys.push_back(std::make_pair(tagdb, "")); + // Study Hour + gdcm::Tag tagsdh(0x0008,0x0030); + keys.push_back(std::make_pair(tagsdh, "")); + gdcm::SmartPointer theQuery = gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys); + gdcm::CompositeNetworkFunctions::CFind("127.0.0.1", 5678, theQuery, theDataSet, "CREATIS", "CONQUESTSRV1"); + convertDataSet(theDataSet, Studymodel, getStudyKeys("")); + } + + + void vvQPacsConnection::selectSeries(const QModelIndex &index) + { + 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)); + + //manageImagesFilter(true); + gdcm::EQueryLevel theLevel = gdcm::eSeries; + gdcm::ERootType theRoot = gdcm::ePatientRootType;//ePatientRootType; + std::vector theDataSet; + std::vector< std::pair > keys; + + //Patient Unique key + keys.push_back(std::make_pair(gdcm::Tag(0x0010,0x0020), m_patient)); + + //Study Unique Key + keys.push_back(std::make_pair(gdcm::Tag(0x0020,0x000d), elt.toString().toStdString())); + + + // Modality + keys.push_back(std::make_pair(gdcm::Tag(0x0008,0x0060), elt.toString().toStdString())); + // Description + keys.push_back(std::make_pair(gdcm::Tag(0x0008,0x0060), elt.toString().toStdString())); + // Acceptance NUmber???? + keys.push_back(std::make_pair(gdcm::Tag(0x0020,0x000e), elt.toString().toStdString())); + + gdcm::SmartPointer theQuery = gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys); + keys.clear(); + // Modality + keys.push_back(std::make_pair(gdcm::Tag(0x0008,0x0060), elt.toString().toStdString())); + // Description + keys.push_back(std::make_pair(gdcm::Tag(0x0008,0x0060), elt.toString().toStdString())); + // Acceptance NUmber???? + keys.push_back(std::make_pair(gdcm::Tag(0x0020,0x000e), elt.toString().toStdString())); + + + + gdcm::CompositeNetworkFunctions::CFind("127.0.0.1", 5678, theQuery, theDataSet, "CREATIS", "CONQUESTSRV1"); + convertDataSet(theDataSet, Seriesmodel, keys); + } + + void vvQPacsConnection::selectImages(const QModelIndex &index) + { + 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)); + + //manageImagesFilter(true); + gdcm::EQueryLevel theLevel = gdcm::eImageOrFrame; + gdcm::ERootType theRoot = gdcm::ePatientRootType;//ePatientRootType; + std::vector theDataSet; + std::vector< std::pair > keys; + + gdcm::Tag tagsd(0x0010,0x0020); + keys.push_back(std::make_pair(tagsd, m_patient)); + + gdcm::Tag tagss(0x0020,0x000e); + keys.push_back(std::make_pair(tagss, elt.toString().toStdString())); + //= getStudyKeys(elt.toString().toStdString()); + + // Study Description + gdcm::Tag tagsdc(0x0020,0x0013); + keys.push_back(std::make_pair(tagsdc, "")); + + + gdcm::SmartPointer theQuery = gdcm::CompositeNetworkFunctions::ConstructQuery(theRoot, theLevel ,keys); + keys.clear(); + // Study Description + + keys.push_back(std::make_pair(tagsdc, "")); + + + gdcm::CompositeNetworkFunctions::CFind("127.0.0.1", 5678, theQuery, theDataSet, "CREATIS", "CONQUESTSRV1"); + convertDataSet(theDataSet, Seriesmodel, keys); + } + + + void vvQPacsConnection::manageStudiesFilter(bool i_enable) + { + text_PHYS->setEnabled(i_enable); + text_SDESC->setEnabled(i_enable); + dateTab->setEnabled(i_enable); + + } + + void vvQPacsConnection::manageSeriesFilter(bool i_enable) + { + modalityTab->setEnabled(i_enable); + } + + std::vector< std::pair > vvQPacsConnection::getPatientKeys(const std::string i_val) + { + std::vector< std::pair > keys; + // Patient Name + gdcm::Tag tag(0x0010,0x0010); + keys.push_back(std::make_pair(tag, "")); + + //// Patient ID + gdcm::Tag tagpid(0x0010,0x0020); + keys.push_back(std::make_pair(tagpid, i_val)); + return keys; + } + + std::vector< std::pair > vvQPacsConnection::getStudyKeys(const std::string i_val) + { + std::vector< std::pair > keys; + // Study Description + gdcm::Tag tagsdc(0x0008,0x1030); + keys.push_back(std::make_pair(tagsdc, "")); + // Study date + gdcm::Tag tagdb(0x0008,0x0020); + keys.push_back(std::make_pair(tagdb, "")); + // Study Hour + gdcm::Tag tagsdh(0x0008,0x0030); + keys.push_back(std::make_pair(tagsdh, "")); + // Study Instance UID + gdcm::Tag tagsid(0x0020,0x000d); + keys.push_back(std::make_pair(tagsid, i_val)); + + return keys; + } + + + std::vector< std::pair > vvQPacsConnection::getSeriesKeys(const std::string i_val) + { + std::vector< std::pair > keys; + // Modality + gdcm::Tag tagsm(0x0008,0x0060); + keys.push_back(std::make_pair(tagsm, "")); + // Study date + gdcm::Tag tagdb(0x0008,0x103e); + keys.push_back(std::make_pair(tagdb, "")); + // Study Hour + gdcm::Tag tagsdh(0x0020,0x000e); + keys.push_back(std::make_pair(tagsdh, "")); + // Study Instance UID + gdcm::Tag tagsid(0x0020,0x1209); + keys.push_back(std::make_pair(tagsid, i_val)); + + return keys; + } + std::vector< std::pair > vvQPacsConnection::getKeys() + { + std::vector< std::pair > keys; + // Patient Name + gdcm::Tag tag(0x0010,0x0010); + keys.push_back(std::make_pair(tag, "")); + + //// Patient ID + gdcm::Tag tagpid(0x0010,0x0020); + keys.push_back(std::make_pair(tagpid, "")); + + // Modality + gdcm::Tag tagmod(0x0008,0x0061); + keys.push_back(std::make_pair(tagmod, "")); + + // date of birth + gdcm::Tag tagdb(0x0010,0x0030); + keys.push_back(std::make_pair(tagdb, "")); + + // Study Date + gdcm::Tag tagsd(0x0020,0x000D); + keys.push_back(std::make_pair(tagsd, "")); + + //// Study Time + //gdcm::Tag tagst(8,30); + //keys.push_back(std::make_pair(tagst, "")); + + //// Study Description + //gdcm::Tag tagsdc(8,1030); + //keys.push_back(std::make_pair(tagsdc, "")); + + //// Accession n° + //gdcm::Tag tagacc(8,50); + //keys.push_back(std::make_pair(tagacc, "")); + + return keys; + } + + 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); + 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); + } + + } \ No newline at end of file diff --git a/vv/vvQPacsConnection.h b/vv/vvQPacsConnection.h new file mode 100644 index 0000000..fbbdbeb --- /dev/null +++ b/vv/vvQPacsConnection.h @@ -0,0 +1,68 @@ +#ifndef __vvQPacsConnection_h_INCLUDED__ +#define __vvQPacsConnection_h_INCLUDED__ + +#include +#include "ui_vvPacsConnection.h" +#include "gdcmCompositeNetworkFunctions.h" +#include +#include + + + /** + * \ingroup GUI + */ + //===================================================================== + //===================================================================== + class vvQPacsConnection : public QWidget , public Ui_vvPacsConnection + { + Q_OBJECT + public: + vvQPacsConnection(){} + vvQPacsConnection(QWidget *parent); + + ~vvQPacsConnection(){} + ///Queries the PACS + //void OnQueryPACS(wxCommandEvent& event); +public slots: + void selectStudies(const QModelIndex &index); + void selectSeries(const QModelIndex &index); + void selectImages(const QModelIndex &index); + private slots: + void on_scanButton_clicked(); + void on_clearButton_clicked(); + void on_importButton_clicked(); + void on_check_ModAll_clicked(bool state); + + + private : + std::vector< std::pair > getKeys(); + std::vector< std::pair > getPatientKeys(const std::string ); + std::vector< std::pair > getStudyKeys(const std::string); + std::vector< std::pair > getSeriesKeys(const std::string i_val); + std::vector< std::pair > getImageKeys(const std::string i_val); + void manageStudiesFilter(bool i_enable); + void createTreeView(); + QStandardItemModel *Patientmodel; + QStandardItemModel *Studymodel; + QStandardItemModel *Seriesmodel; + QStandardItemModel *Imagesmodel; + void convertDataSet(std::vector i_ds, QStandardItemModel *i_model, std::vector< std::pair > keys); + void manageSeriesFilter(bool i_enable); + std::string m_patient; + std::string m_study; + std::string m_series; + + std::string m_ip; + std::string m_aetitle; + std::string m_adress; + std::string m_name; + //wxDialog* dialog; + + }; // class vvQPacsConnection + //===================================================================== + + + +#endif // __vvQPacsConnection_h_INCLUDED__ + +