]> Creatis software - clitk.git/commitdiff
Allow to retrieve and display multiple series.
authorcervenansky <frederic.cervenansky@creatis.insa-lyon.fr>
Fri, 26 Jul 2013 14:45:39 +0000 (16:45 +0200)
committercervenansky <frederic.cervenansky@creatis.insa-lyon.fr>
Fri, 26 Jul 2013 14:45:39 +0000 (16:45 +0200)
Temporary storage directory in settings.

vv/vvMainWindow.cxx
vv/vvQPacsConnection.cxx
vv/vvQPacsConnection.h
vv/vvUtils.cxx
vv/vvUtils.h

index c07100df0d224d7230864b849bf7f59242f2f5f7..a566c3aa96bed30fa99bb5e958efdb71937b1f26 100644 (file)
@@ -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();
   }
   }
index 443447df970e3ad0bedbfb2aa4b504b27cb14b82..8f40ae6405b839e39cf5ea5d8c26a99cae94e35f 100644 (file)
@@ -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<std::string, std::vector<std::string>* > mListOfSeriesFilenames;
 
 
+          m_fileseries.clear();
+          
      for (unsigned int i=0; i<seriesUID.size(); i++) {
-
-         // store filenames
-         std::vector<std::string> * filenames = new std::vector<std::string>;
-         m_files = nameGenerator->GetFileNames(seriesUID[i]);
-       /*  for (unsigned int j=0; j<temp.size(); j++) {
-           m_files->push_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 <std::string> vvQPacsConnection::getFileNames()
+std::vector <std::string> vvQPacsConnection::getFileNames(int i_series)
 {
        std::vector <std::string> 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;
 }
index bafea832c9ad016a8d585a7a513a9a95bbaa1780..13ec9f935c4954c85d27ed8ae2fdcbb83c0e5721 100644 (file)
@@ -26,7 +26,8 @@ public:
     
          ~vvQPacsConnection(){}
        void refreshNetworks();
-       std::vector <std::string> getFileNames();
+       std::vector <std::string> 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;
 
 
        
index 05f5af1e6297769df876efb83f983c692b10dafd..b787c9f2617276c587d945bb606b377aa1c3701d 100644 (file)
@@ -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()
index 416af5644c601028c74e55db138d843ec4c226de..4a7ffce79713c35e0976970666390c87d4204f94 100644 (file)
@@ -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 <std::string,std::string > getDicomServer(QString nickname);
 #endif