From: David Sarrut Date: Thu, 12 Jul 2012 08:28:46 +0000 (+0200) Subject: Add progress dialog for binary images X-Git-Tag: v1.4.0~329 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=25a56ab48d76ee540338dcca7df803b20c7d6135;p=clitk.git Add progress dialog for binary images --- 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();