X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvToolExtractLung.cxx;h=59b41331472a7798dea91d9bb3e80c1e0aaa54ed;hb=0d8fa5142465b40d3796e4347f8411fcbe374d4a;hp=c976b8c65570ea767c34c109a7864dc1d5686352;hpb=c5669e2c629b8248e22d8892c6576ada7a14cc25;p=clitk.git diff --git a/vv/vvToolExtractLung.cxx b/vv/vvToolExtractLung.cxx index c976b8c..59b4133 100644 --- a/vv/vvToolExtractLung.cxx +++ b/vv/vvToolExtractLung.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 "vvToolExtractLung.h" @@ -76,7 +76,7 @@ void vvToolExtractLung::Initialize() { SetToolMenuName("Extract lungs"); SetToolIconFilename(":/common/icons/lung-overlay.png"); SetToolTip("Extract lung mask from thorax CT."); - // SetToolExperimental(true); + SetToolExperimental(true); // SetToolInMenu("Segmentation"); } //------------------------------------------------------------------------------ @@ -136,15 +136,15 @@ void vvToolExtractLung::SetGUIFromArgsInfo() //------------------------------------------------------------------------------ void vvToolExtractLung::GetArgsInfoFromGUI() { - mArgsInfo->patientBG_arg = mPatientMaskInputWidget->GetBackgroundValue(); + // mArgsInfo->patientBG_arg = mPatientMaskInputWidget->GetBackgroundValue(); mArgsInfo->verboseOption_flag = true; // DEBUG. TO CHANGE mArgsInfo->verboseStep_flag = true; // DEBUG. TO CHANGE mArgsInfo->writeStep_flag = false; mArgsInfo->input_given = 0; - mArgsInfo->patient_given = 0; + // mArgsInfo->patient_given = 0; mArgsInfo->output_given = 0; mArgsInfo->outputTrachea_given = 0; - mArgsInfo->remove1_given = 0; + // mArgsInfo->remove1_given = 0; mArgsInfo->upper_arg = mAirUpperThresholdSlider->GetValue(); mArgsInfo->lower_arg = mAirLowerThresholdSlider->GetValue(); @@ -174,7 +174,7 @@ void vvToolExtractLung::apply() // Create new filter if (mFilter) delete mFilter; 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 @@ -184,8 +184,13 @@ void vvToolExtractLung::apply() vvThreadedFilter thread; connect(&thread, SIGNAL(ThreadInterrupted()), this, SLOT(ThreadInterrupted())); thread.SetFilter(mFilter); - thread.Update(); + try { + thread.Update(); + } + catch(std::runtime_error e) { + DD("Error exception handling"); + DD(m_IsThreadInterrupted); // Check if the thread has been canceled. In this case, return if (m_IsThreadInterrupted) { m_IsThreadInterrupted = false; @@ -195,11 +200,12 @@ void vvToolExtractLung::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; - } + // } + } // end exception // Get output std::vector output = mFilter->GetOutputVVImages();