From 86d74c7664c5d6d11637ba376b639aa3c6e0e057 Mon Sep 17 00:00:00 2001 From: cervenansky Date: Fri, 26 Jul 2013 16:45:39 +0200 Subject: [PATCH] Allow to retrieve and display multiple series. Temporary storage directory in settings. --- vv/vvMainWindow.cxx | 7 +++++-- vv/vvQPacsConnection.cxx | 21 ++++++++------------- vv/vvQPacsConnection.h | 4 +++- vv/vvUtils.cxx | 22 ++++++++++++++++++---- vv/vvUtils.h | 3 +++ 5 files changed, 37 insertions(+), 20 deletions(-) diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index c07100d..a566c3a 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -762,8 +762,11 @@ void vvMainWindow::ConnectPacs() //std::cout << "dicomSeriesSelector " << std::endl; if (PacsConnection->exec() == QDialog::Accepted) { - files = PacsConnection->getFileNames(); - LoadImages(files, vvImageReader::DICOM); + for (int i = 0; i < PacsConnection->getSeriesCount(); i++) + { + files = PacsConnection->getFileNames(i); + LoadImages(files, vvImageReader::DICOM); + } PacsConnection->clearMove(); } } diff --git a/vv/vvQPacsConnection.cxx b/vv/vvQPacsConnection.cxx index 443447d..8f40ae6 100644 --- a/vv/vvQPacsConnection.cxx +++ b/vv/vvQPacsConnection.cxx @@ -367,7 +367,7 @@ void vvQPacsConnection::chooseServer(int index) void vvQPacsConnection::on_importButton_clicked() { setCursor(QCursor(Qt::WaitCursor)); - QString path = QDir::homePath() +QString::fromStdString("/.move"); + QString path = QString::fromStdString(getCMoveDirectory()); QDir dirpath (path); if (dirpath.exists()) { @@ -402,16 +402,11 @@ void vvQPacsConnection::on_importButton_clicked() std::map* > mListOfSeriesFilenames; + m_fileseries.clear(); + for (unsigned int i=0; i * filenames = new std::vector; - m_files = nameGenerator->GetFileNames(seriesUID[i]); - /* for (unsigned int j=0; jpush_back(temp[j]); - }*/ - - } + m_fileseries.push_back( nameGenerator->GetFileNames(seriesUID[i])); + } accept(); setCursor(QCursor(Qt::ArrowCursor)); @@ -419,11 +414,11 @@ void vvQPacsConnection::on_importButton_clicked() -std::vector vvQPacsConnection::getFileNames() +std::vector vvQPacsConnection::getFileNames(int i_series) { std::vector filenames; - gdcm::Directory::FilenamesType::iterator it = m_files.begin(); - for (;it != m_files.end(); it++) + gdcm::Directory::FilenamesType::iterator it = m_fileseries[i_series].begin(); + for (;it != m_fileseries[i_series].end(); it++) filenames.push_back(it->c_str()); return filenames; } diff --git a/vv/vvQPacsConnection.h b/vv/vvQPacsConnection.h index bafea83..13ec9f9 100644 --- a/vv/vvQPacsConnection.h +++ b/vv/vvQPacsConnection.h @@ -26,7 +26,8 @@ public: ~vvQPacsConnection(){} void refreshNetworks(); - std::vector getFileNames(); + std::vector getFileNames(int i_series); + int getSeriesCount() { return m_fileseries.size();} void clearMove(); public slots: @@ -75,6 +76,7 @@ public slots: vvQuery m_query; vvQuery f_query; gdcm::Directory::FilenamesType m_files; + std::vector < gdcm::Directory::FilenamesType> m_fileseries; diff --git a/vv/vvUtils.cxx b/vv/vvUtils.cxx index 05f5af1..b787c9f 100644 --- a/vv/vvUtils.cxx +++ b/vv/vvUtils.cxx @@ -52,10 +52,14 @@ FileListType GetRecentlyOpenedImages() void setDicomClient() { QSettings settings(getVVSettingsPath(), getSettingsOptionFormat()); - settings.beginGroup(QString::fromStdString("DICOMCLIENT")); - settings.setValue("AETITLE",QString::fromStdString("VVDICOMSCU")); - settings.setValue("port",QString::number(1234)); - settings.endGroup(); + if (! settings.childGroups().contains("DICOMCLIENT")) + { + settings.beginGroup(QString::fromStdString("DICOMCLIENT")); + settings.setValue("AETITLE",QString::fromStdString("VVDICOMSCU")); + settings.setValue("port",QString::number(1234)); + settings.setValue("directory",QDir::homePath() +QString::fromStdString("/.move")); + settings.endGroup(); + } } // get VV-AETITLE for c-move. parameters @@ -69,6 +73,16 @@ std::string getDicomClientAETitle() return result; } +// get the directory where the dicom files will be stored during c-move action. +std::string getCMoveDirectory() +{ + std::string result =""; + QSettings settings(getVVSettingsPath(), getSettingsOptionFormat()); + settings.beginGroup(QString::fromStdString("DICOMCLIENT")); + result = settings.value("directory").toString().toStdString(); + settings.endGroup(); + return result; +} // get VV-PORT-SCU for c-move. parameters int getDicomClientPort() diff --git a/vv/vvUtils.h b/vv/vvUtils.h index 416af56..4a7ffce 100644 --- a/vv/vvUtils.h +++ b/vv/vvUtils.h @@ -51,5 +51,8 @@ std::string getDicomClientAETitle(); // get VV-PORT-SCU for c-move parameters. int getDicomClientPort(); +// get the directory where the dicom files will be stored during c-move action. +std::string getCMoveDirectory() + std::map getDicomServer(QString nickname); #endif -- 2.47.1