X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvMainWindow.cxx;h=436a89f2ee1ead6b6fb892d1850b6de0d018ddbf;hb=cff13ef732b851bc663de9cb8c6742592179f516;hp=9dbd407e4168aee728bc700f638ca0695bc0bd42;hpb=3fd15028ab81e6746d3af96695526d7d973a26c8;p=clitk.git diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 9dbd407..436a89f 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -2297,6 +2297,27 @@ void vvMainWindow::SaveAs() vvImageWriter::Pointer writer = vvImageWriter::New(); writer->SetOutputFileName(fileName.toStdString()); writer->SetInput(mSlicerManagers[index]->GetImage()); + + // Check on transform and prompt user + writer->SetSaveTransform(false); + bool bId = true; + for(int i=0; i<4; i++) + for(int j=0; j<4; j++) { + double elt = mSlicerManagers[index]->GetImage()->GetTransform()->GetMatrix()->GetElement(i,j); + if(i==j && elt!=1.) + bId = false; + if(i!=j && elt!=0.) + bId = false; + } + if( !bId ) { + QString warning = "The image has an associated linear transform. Do you want to save it along?"; + QMessageBox msgBox(QMessageBox::Warning, tr("Save transform"), warning, 0, this); + msgBox.addButton(tr("Yes"), QMessageBox::AcceptRole); + msgBox.addButton(tr("No"), QMessageBox::RejectRole); + if (msgBox.exec() == QMessageBox::AcceptRole) + writer->SetSaveTransform(true); + } + writer->Update(); QApplication::restoreOverrideCursor(); if (writer->GetLastError().size()) { @@ -2792,13 +2813,13 @@ void vvMainWindow::SaveScreenshot(QVTKWidget *widget) // FPS bool ok; - int fps = QInputDialog::getInt(this, tr("Number of frames per second"), + int fps = QInputDialog::getInteger(this, tr("Number of frames per second"), tr("FPS:"), 5, 0, 1000, 1, &ok); if(ok) gif->SetRate(fps); // Loops - int loops = QInputDialog::getInt(this, tr("Loops"), + int loops = QInputDialog::getInteger(this, tr("Loops"), tr("Number of loops (0 means infinite):"), 0, 0, 1000000000, 1, &ok); if(ok) gif->SetLoops(loops); @@ -2810,7 +2831,7 @@ void vvMainWindow::SaveScreenshot(QVTKWidget *widget) vidwriter = mpg; mpg->SetQuality(2); bool ok; - int fps = QInputDialog::getInt(this, tr("Number of frames per second"), + int fps = QInputDialog::getInteger(this, tr("Number of frames per second"), tr("FPS:"), 5, 0, 1024, 1, &ok); if(!ok) fps = 5; @@ -2823,7 +2844,7 @@ void vvMainWindow::SaveScreenshot(QVTKWidget *widget) vidwriter = mpg; mpg->SetQuality(2); bool ok; - int fps = QInputDialog::getInt(this, tr("Number of frames per second"), + int fps = QInputDialog::getInteger(this, tr("Number of frames per second"), tr("FPS:"), 5, 0, 1024, 1, &ok); if(!ok) fps = 5;