From 25a56ab48d76ee540338dcca7df803b20c7d6135 Mon Sep 17 00:00:00 2001 From: David Sarrut Date: Thu, 12 Jul 2012 10:28:46 +0200 Subject: [PATCH] Add progress dialog for binary images --- vv/vvToolROIManager.cxx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/vv/vvToolROIManager.cxx b/vv/vvToolROIManager.cxx index b678400..adaeeb2 100644 --- a/vv/vvToolROIManager.cxx +++ b/vv/vvToolROIManager.cxx @@ -318,17 +318,21 @@ void vvToolROIManager::OpenBinaryImage(QStringList & filename) { if (filename.size() == 0) return; + vvProgressDialog p("Reading ROI ...", true); + p.SetCancelButtonEnabled(false); + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + // For each selected file, open the image - for(int i=0; i filenames; filenames.push_back(filename[i].toStdString()); reader->SetInputFilenames(filenames); reader->Update(vvImageReader::IMAGE); - QApplication::restoreOverrideCursor(); - + if (reader->GetLastError().size() != 0) { std::cerr << "Error while reading " << filename[i].toStdString() << std::endl; QString error = "Cannot open file \n"; @@ -341,6 +345,7 @@ void vvToolROIManager::OpenBinaryImage(QStringList & filename) (!mBGModeCheckBox->isChecked())); mOpenedBinaryImageFilenames.push_back(filename[i]); } + QApplication::restoreOverrideCursor(); // Update the contours UpdateAllContours(); @@ -357,11 +362,10 @@ void vvToolROIManager::OpenDicomImage(std::string filename) vvStructSelector selector; selector.SetStructures(reader.GetROINames()); - if (selector.exec()) { - QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); - + if (selector.exec()) { vvProgressDialog p("Reading ROI...", true); p.SetCancelButtonEnabled(false); + QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); // Read information clitk::DicomRT_StructureSet::Pointer s = clitk::DicomRT_StructureSet::New(); -- 2.45.1