From 48e744cf9484096891bd44bd74099c82bd238b20 Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Fri, 26 Jul 2013 12:50:07 +0200 Subject: [PATCH] Sort series under Linux --- vv/vvQPacsConnection.cxx | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/vv/vvQPacsConnection.cxx b/vv/vvQPacsConnection.cxx index 905c668..443447d 100644 --- a/vv/vvQPacsConnection.cxx +++ b/vv/vvQPacsConnection.cxx @@ -8,6 +8,8 @@ #include "vvPacsSettingsDialog.h" #include "vvUtils.h" #include +#include +#include vvQPacsConnection::vvQPacsConnection(QWidget *i_parent) @@ -385,8 +387,31 @@ void vvQPacsConnection::on_importButton_clicked() getDicomClientPort(), getDicomClientAETitle().c_str(), m_aetitle.c_str(), path.toStdString().c_str() ); gdcm::Directory theDir; theDir.Load(path.toStdString().c_str()); - m_files = theDir.GetFilenames(); - std::sort (m_files.begin(), m_files.end()); // make sure names are in lexicographical order + //m_files = theDir.GetFilenames(); + + typedef itk::GDCMSeriesFileNames NamesGeneratorType; + NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New(); + nameGenerator->SetUseSeriesDetails(true); + + //ds gérer recursive moi-meme pour progress ... + nameGenerator->SetInputDirectory(path.toStdString()); + + // insert in table + typedef std::vector SeriesIdContainer; + const SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs(); + std::map* > mListOfSeriesFilenames; + + + 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]); + }*/ + + } accept(); setCursor(QCursor(Qt::ArrowCursor)); -- 2.47.1