X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvToolExtractLung.cxx;h=0b29ca956cc6996138639934eba6a9614497fcea;hb=6d4c696c5443af116efb9bb5b7a202bdf0104281;hp=7c78a0aecba73e5d352460843cf13fc01f1dad36;hpb=3e8098373d82c788bd7ca72fe270a6374728e074;p=clitk.git diff --git a/vv/vvToolExtractLung.cxx b/vv/vvToolExtractLung.cxx index 7c78a0a..0b29ca9 100644 --- a/vv/vvToolExtractLung.cxx +++ b/vv/vvToolExtractLung.cxx @@ -23,7 +23,7 @@ #include "vvImageReader.h" #include "vvImageWriter.h" #include "vvLabelImageLoaderWidget.h" -#include "vvProgressDialog.h" +#include "vvThreadedFilter.h" // Qt #include @@ -45,6 +45,7 @@ vvToolExtractLung::vvToolExtractLung(vvMainWindowBase * parent, Qt::WindowFlags Ui_vvToolExtractLung::setupUi(mToolWidget); mMaskLoaderBox->setEnabled(false); mOptionsBox->setEnabled(false); + mPatientMaskInputWidget->SetText("Patient mask"); connect(mPatientMaskInputWidget, SIGNAL(accepted()), this, SLOT(PatientMaskInputIsSelected())); // Default values @@ -54,7 +55,7 @@ vvToolExtractLung::vvToolExtractLung(vvMainWindowBase * parent, Qt::WindowFlags mFilter = FilterType::New(); // Add input selector - AddInputSelector("Select image", mFilter); + AddInputSelector("Select CT thorax image", mFilter); } //------------------------------------------------------------------------------ @@ -137,12 +138,15 @@ void vvToolExtractLung::apply() mFilter->SetArgsInfo(mArgsInfo); DD("mfilter->Update"); - // vvThreadedFilter a; - // a->SetFilter(mFilter) + vvThreadedFilter thread; + // thread.SetFilter((clitk::FilterBase*)&(*mFilter)); + // thread.SetFilter((clitk::FilterBase*)&(*mFilter)); + thread.SetFilter(&(*mFilter)); // connect(a, SIGNAL(rejected()), this, SLOT(FilterHasBeenCanceled())); - // a->Update(); + thread.Update(); // if (a->HasError()) { DD(a->GetError()); return; } - mFilter->Update(); + // mFilter->Update(); + DD("after thread"); // Check error if (mFilter->HasError()) { @@ -155,6 +159,12 @@ void vvToolExtractLung::apply() std::vector output = mFilter->GetOutputVVImages(); DD(output.size()); + if (output.size() == 0) { + std::cerr << "Error : no output ?" << std::endl; + close(); + return; + } + // Set Lung into VV DD("lung"); vvImage::Pointer lung = output[0];