From e427ac0d54e258bda28d99fbbbe0f5e257b3604f Mon Sep 17 00:00:00 2001 From: cervenansky Date: Wed, 17 Jul 2013 16:26:11 +0200 Subject: [PATCH] add move a single image --- vv/vvDicomServerQueryFactory.cxx | 37 ++++++++++++++++++++++++++++++-- vv/vvDicomServerQueryFactory.h | 4 +++- vv/vvQPacsConnection.cxx | 9 +++++++- vv/vvQPacsConnection.h | 1 + 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/vv/vvDicomServerQueryFactory.cxx b/vv/vvDicomServerQueryFactory.cxx index 9ae656f..1e31f24 100644 --- a/vv/vvDicomServerQueryFactory.cxx +++ b/vv/vvDicomServerQueryFactory.cxx @@ -15,7 +15,7 @@ vvQuery vvDicomServerQueryFactory::getQueryforStudy(const std::string patient_i query.keys = getQueryKeysforStudy( patient_id, bdisplay); query.theRoot = gdcm::ePatientRootType; query.theLevel = gdcm::eStudy; - m_query = query; + m_query = getQueryPatient("",patient_id); return query; } @@ -133,10 +133,43 @@ std::vector< std::pair > vvDicomServerQueryFactory::getS if(!bdisplay) { + //Patient UID + keys.push_back(std::make_pair(gdcm::Tag (0x0010,0x0020), patient_id)); + + //Study UID + keys.push_back(std::make_pair(gdcm::Tag(0x0020,0x000d), study_id)); // Study Instance UID gdcm::Tag tagsid(0x0020,0x1209); - keys.push_back(std::make_pair(tagsid, study_id)); + // keys.push_back(std::make_pair(tagsid, study_id)); } + return keys; +} + +void vvDicomServerQueryFactory::setQueryforImage(const std::string patient_id, const std::string study_id, const std::string series_id,const std::string image_id) +{ + vvQuery query; + query.theRoot = gdcm::ePatientRootType; + query.theLevel = gdcm::eImage; + query.keys = getQueryKeysforImage(patient_id, study_id, series_id, image_id); + m_query = query; +} + +std::vector< std::pair > vvDicomServerQueryFactory::getQueryKeysforImage(const std::string patient_id, const std::string study_id, const std::string series_id,const std::string image_id) +{ + + std::vector< std::pair > keys; + + //Patient UID + keys.push_back(std::make_pair(gdcm::Tag (0x0010,0x0020), patient_id)); + + //Study UID + keys.push_back(std::make_pair(gdcm::Tag(0x0020,0x000d), study_id)); + + //Series UID + keys.push_back(std::make_pair(gdcm::Tag(0x0020,0x000e), series_id)); + + //SOP Instance UID + keys.push_back(std::make_pair(gdcm::Tag(0x0008,0x0018), image_id)); return keys; } \ No newline at end of file diff --git a/vv/vvDicomServerQueryFactory.h b/vv/vvDicomServerQueryFactory.h index b5c86db..1b2f19c 100644 --- a/vv/vvDicomServerQueryFactory.h +++ b/vv/vvDicomServerQueryFactory.h @@ -24,13 +24,15 @@ public: vvQuery getQueryforSeries(const std::string patient_id, const std::string study_id, bool bdisplay); vvQuery getQueryforStudy(const std::string patient_id, bool bdisplay); vvQuery getQueryPatient(const std::string i_patname, const std::string i_patid); - + void setQueryforImage(const std::string patient_id, const std::string study_id,const std::string series_id,const std::string image_id); std::vector< std::pair > getQueryKeysforStudy(const std::string patient_id, bool bdisplay); std::vector< std::pair > getPatientKeys(const std::string , const std::string ); std::vector< std::pair > getSeriesKeys(const std::string patient_id, const std::string study_id, bool bdisplay); std::vector< std::pair > getQueryKeysforImages(const std::string patient_id, const std::string study_id, const std::string series_id,bool bdisplay); + std::vector< std::pair > getQueryKeysforImage(const std::string patient_id, const std::string study_id, const std::string series_id,const std::string image_id); + vvQuery getMoveQuery() { return m_query;} diff --git a/vv/vvQPacsConnection.cxx b/vv/vvQPacsConnection.cxx index ff768af..9208768 100644 --- a/vv/vvQPacsConnection.cxx +++ b/vv/vvQPacsConnection.cxx @@ -169,7 +169,7 @@ void vvQPacsConnection::createTreeView() Seriesmodel->setHorizontalHeaderLabels(Serieslist); ui.seriesTreeView->setModel(Seriesmodel); connect(ui.seriesTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(selectImages(QModelIndex))); - + connect(ui.imagesTreeView, SIGNAL(clicked(QModelIndex)), this, SLOT(selectImage(QModelIndex))); // Images Tree View Imagesmodel = new QStandardItemModel(0,1,this); QStringList Imageslist; @@ -223,6 +223,13 @@ void vvQPacsConnection::selectImages(const QModelIndex &index) } +void vvQPacsConnection::selectImage(const QModelIndex &index) +{ + std::string _image = Imagesmodel->data(index.sibling(index.row(),1)).toString().toStdString(); + mQFactory.setQueryforImage(m_patient,m_study, m_series, _image); + +} + std::vector vvQPacsConnection::findQuery(vvQuery i_query) { diff --git a/vv/vvQPacsConnection.h b/vv/vvQPacsConnection.h index 3e7ce48..e17c3b3 100644 --- a/vv/vvQPacsConnection.h +++ b/vv/vvQPacsConnection.h @@ -32,6 +32,7 @@ public slots: void selectStudies(const QModelIndex &index); void selectSeries(const QModelIndex &index); void selectImages(const QModelIndex &index); + void selectImage(const QModelIndex &index); private slots: void on_scanButton_clicked(); void on_clearButton_clicked(); -- 2.47.1