X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvToolExtractPatient.cxx;h=d81b123678fffbe82feeaaf7309448b3b171e835;hb=a595d0ae02a42e1fc87d8cf044243da08e39414c;hp=c38dde5f2551131bfff117681830a92f2b0ffcad;hpb=83dbd9493090be7eba90abb649b562ade6adc576;p=clitk.git diff --git a/vv/vvToolExtractPatient.cxx b/vv/vvToolExtractPatient.cxx index c38dde5..d81b123 100644 --- a/vv/vvToolExtractPatient.cxx +++ b/vv/vvToolExtractPatient.cxx @@ -3,7 +3,7 @@ Authors belong to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr This software is distributed WITHOUT ANY WARRANTY; without even @@ -14,7 +14,7 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html - ======================================================================-====*/ + ===========================================================================**/ // vv #include "vvToolExtractPatient.h" @@ -74,7 +74,7 @@ void vvToolExtractPatient::Initialize() { SetToolMenuName("Extract Patient"); SetToolIconFilename(":/common/icons/Patient-overlay.png"); SetToolTip("Extract Patient mask from thorax CT."); - // SetToolExperimental(true); + SetToolExperimental(true); // SetToolInMenu("Segmentation"); } //------------------------------------------------------------------------------ @@ -174,7 +174,7 @@ void vvToolExtractPatient::apply() //if (mFilter) delete mFilter; DD("new filter"); mFilter = new FilterType; // needed when thread cancel the filter - mFilter->StopOnErrorOff(); + // mFilter->StopOnErrorOff(); // mFilter->SetIOVerbose(true); mFilter->AddInputVVImage(mCurrentImage); // CT // mFilter->AddInputVVImage(mPatient); // patient mask @@ -185,7 +185,11 @@ void vvToolExtractPatient::apply() vvThreadedFilter thread; connect(&thread, SIGNAL(ThreadInterrupted()), this, SLOT(ThreadInterrupted())); thread.SetFilter(mFilter); + + try { thread.Update(); + } + catch(std::runtime_error e) { // Check if the thread has been canceled. In this case, return if (m_IsThreadInterrupted) { @@ -196,10 +200,12 @@ void vvToolExtractPatient::apply() disconnect(&thread, SIGNAL(ThreadInterrupted()), this, SLOT(ThreadInterrupted())); // Check error during filter - if (mFilter->HasError()) { + // if (mFilter->HasError()) { QApplication::restoreOverrideCursor(); - QMessageBox::information(this,tr("Error"), mFilter->GetLastError().c_str()); + QMessageBox::information(this,tr("Error"), e.what());//mFilter->GetLastError().c_str()); return; + // } + } // Get output