From ee318a6de9c515e567f56b84d3f3789ef0881810 Mon Sep 17 00:00:00 2001 From: dsarrut Date: Mon, 12 Jul 2010 06:58:18 +0000 Subject: [PATCH] *** empty log message *** --- vv/qt_ui/vvProgressDialog.ui | 40 +- vv/qt_ui/vvToolConnectedComponentLabeling.ui | 454 +++++++++------ vv/qt_ui/vvToolExtractLung.ui | 14 +- vv/qt_ui/vvToolRigidReg.ui | 582 ++++++++++--------- vv/vvProgressDialog.cxx | 60 ++ vv/vvThreadedFilter.cxx | 105 ++++ vv/vvThreadedFilter.h | 52 ++ 7 files changed, 809 insertions(+), 498 deletions(-) create mode 100644 vv/vvProgressDialog.cxx create mode 100644 vv/vvThreadedFilter.cxx create mode 100644 vv/vvThreadedFilter.h diff --git a/vv/qt_ui/vvProgressDialog.ui b/vv/qt_ui/vvProgressDialog.ui index 2f684e8..b1280ef 100644 --- a/vv/qt_ui/vvProgressDialog.ui +++ b/vv/qt_ui/vvProgressDialog.ui @@ -9,8 +9,8 @@ 0 0 - 267 - 59 + 264 + 120 @@ -20,8 +20,11 @@ :/common/icons/ducky.png:/common/icons/ducky.png - - + + + 3 + + Opening image @@ -31,7 +34,14 @@ - + + + + 24 + + + + Please wait ... @@ -41,10 +51,22 @@ - - - - 24 + + + + + 50 + false + + + + Qt::LeftToRight + + + QDialogButtonBox::Cancel + + + true diff --git a/vv/qt_ui/vvToolConnectedComponentLabeling.ui b/vv/qt_ui/vvToolConnectedComponentLabeling.ui index a12ccf4..9863d3a 100644 --- a/vv/qt_ui/vvToolConnectedComponentLabeling.ui +++ b/vv/qt_ui/vvToolConnectedComponentLabeling.ui @@ -1,204 +1,276 @@ - Form - + vvToolConnectedComponentLabeling + 0 0 - 400 - 300 + 259 + 487 Form - - - - 30 - 20 - 191 - 16 - - - - Connected component labeling - - - - - - 200 - 80 - 131 - 19 - - - - Sort label by size - - - - - - 60 - 50 - 93 - 81 - - - - - - - 6 connectivity - - - - - - - 18 connexity - - - - - - - 26 connexity - - - - - - - 26 connexity - - - - - - - - - 32 - 247 - 16 - 16 - - - - - - - - - - 30 - 160 - 321 - 51 - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::LeftToRight - - - Keep n first greater labels - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - - - - - - - + + + + + + + Connected components labeling + + + + + + + + + + + + + + + + 0 + 0 + + + + Min size + + + + + + + 999999 + + + 100 + + + + + + + + + Full connectivity + + + true + + + true + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + false + + + Labelize + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + false + + + Labels selection + + + + + + true + + + false + + + + 1 + + + + + 2 + + + + + Size + + + + + Keep ? + + + + + + + + ItemIsSelectable|ItemIsDragEnabled|ItemIsEnabled + + + + + + + + Checked + + + + + + + + Unchecked + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + false + + + Apply keep/remove + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + false + + + Done + + + + + + + + + + + - - - - spinBox - valueChanged(int) - horizontalSlider - setValue(int) - - - 319 - 197 - - - 246 - 199 - - - - - horizontalSlider - valueChanged(int) - spinBox - setValue(int) - - - 207 - 202 - - - 332 - 201 - - - - + + + vvIntensityValueSlider + QWidget +
vvIntensityValueSlider.h
+ 1 +
+
+ + + +
diff --git a/vv/qt_ui/vvToolExtractLung.ui b/vv/qt_ui/vvToolExtractLung.ui index 8d02831..70609a1 100644 --- a/vv/qt_ui/vvToolExtractLung.ui +++ b/vv/qt_ui/vvToolExtractLung.ui @@ -6,8 +6,8 @@ 0 0 - 412 - 384 + 349 + 378
@@ -37,14 +37,11 @@ - GroupBox + Choose input patient binary mask - - mOptionsBox - mOptionsBox - + @@ -52,7 +49,7 @@ - GroupBox + Extract Lung Options @@ -115,7 +112,6 @@ false - mPatientMaskInputWidget diff --git a/vv/qt_ui/vvToolRigidReg.ui b/vv/qt_ui/vvToolRigidReg.ui index ab784c7..32dc57c 100644 --- a/vv/qt_ui/vvToolRigidReg.ui +++ b/vv/qt_ui/vvToolRigidReg.ui @@ -6,305 +6,309 @@ 0 0 - 844 - 456 + 740 + 472 Form - - - - 0 - 0 - 851 - 611 - - - - 0 - - - - Manual - - - - - 0 - 0 - 841 - 571 - + + + + + 0 - - - - - - - Rotation Center(X,Y,Z) - - - - - - - - - - - - - - - - Reset - - - - - - - - - - - X Trans - - - - - - - - - - Qt::Horizontal - - - - - - - - - - - - - - Y Rot - - - - - - - - - - Qt::Horizontal - - - - - - - - - - - - - - X Rot - - - - - - - - - - Qt::Horizontal - - - - - - - - - - - - - - Z Rot - - - - - - - - - - Qt::Horizontal - - - - - - - - - - - - - + + + Manual + + + + + + + + + + Rotation Center(X,Y,Z) + + + + + + + + + + + + + + + + Reset + + + + + + + + + + + X Trans + + + + + + + + + + Qt::Horizontal + + + + + + + + + + + + + + Y Rot + + + + + + + + + + Qt::Horizontal + + + + + + + + + + + + + + X Rot + + + + + + + + + + Qt::Horizontal + + + + + + + + + + + + + + Z Rot + + + + + + + + + + Qt::Horizontal + + + + + + + + + + + + + + + 0 + 0 + + + + + + + + Load + + + + + + + Save + + + + + + + + 0 + 0 + + + + + + + + Initial Transform + + + Qt::AlignBottom|Qt::AlignHCenter + + + + + + + Current Transform + + + Qt::AlignCenter + + + + + + + + + + + Z Trans + + + + + + + + + + Qt::Horizontal + + + + + + + + + + + + + + Y Trans + + + + + + + + + + Qt::Horizontal + + + + + + + + + + + + + + + + + + Automatic + + + + + 0 + 0 + 841 + 571 + + + - - - Load - - - - - - - Save - - - - - - - - - - Initial Transform - - - Qt::AlignBottom|Qt::AlignHCenter - - - - - - - Current Transform - - - Qt::AlignCenter - - - - - - - - - - - Z Trans - - - - - - - - - - Qt::Horizontal - - - - - - - - - - - - - - Y Trans - - - - - - - - - - Qt::Horizontal - - - - - - - - - - - - - - - - - Automatic - - - - - 0 - 0 - 841 - 571 - - - - - - - - - - - - - - - - - - Load - - - - - - - Apply - - + + + + + + + + + + + + + + Load + + + + + + + Apply + + + + - - + + - -
+
+
diff --git a/vv/vvProgressDialog.cxx b/vv/vvProgressDialog.cxx new file mode 100644 index 0000000..7288f65 --- /dev/null +++ b/vv/vvProgressDialog.cxx @@ -0,0 +1,60 @@ +/*========================================================================= + Program: vv http://www.creatis.insa-lyon.fr/rio/vv + + Authors belong to: + - University of LYON http://www.universite-lyon.fr/ + - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the copyright notices for more information. + + It is distributed under dual licence + + - BSD See included LICENSE.txt file + - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html + ======================================================================-====*/ + +// vv +#include "vvProgressDialog.h" + +//------------------------------------------------------------------------------ +vvProgressDialog::vvProgressDialog(std::string message, bool show_progress) +{ + setupUi(this); + connect(mCancelButton, SIGNAL(rejected()), this, SLOT(reject())); + textLabel->setText(message.c_str()); + if (show_progress) + progressBar->show(); + else + progressBar->hide(); + this->show(); +} +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +void vvProgressDialog::SetText(std::string message) +{ + textLabel->setText(message.c_str()); +} +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +void vvProgressDialog::AddToText(std::string message) +{ + textLabel->setText(QString("%1\n%2").arg(textLabel->text()).arg(message.c_str())); +} +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +void vvProgressDialog::SetProgress(unsigned int current,unsigned int max) +{ + progressBar->setMaximum(max); + progressBar->setValue(current); +} +//------------------------------------------------------------------------------ + diff --git a/vv/vvThreadedFilter.cxx b/vv/vvThreadedFilter.cxx new file mode 100644 index 0000000..839c4e0 --- /dev/null +++ b/vv/vvThreadedFilter.cxx @@ -0,0 +1,105 @@ +/*========================================================================= + Program: vv http://www.creatis.insa-lyon.fr/rio/vv + + Authors belong to: + - University of LYON http://www.universite-lyon.fr/ + - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the copyright notices for more information. + + It is distributed under dual licence + + - BSD See included LICENSE.txt file + - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html + ======================================================================-====*/ + +// vv +#include "vvThreadedFilter.h" +#include "vvProgressDialog.h" + +// Qt +#include + +//------------------------------------------------------------------------------ +vvThreadedFilter::vvThreadedFilter(): + QThread() +{ + DD("vvThreadedFilter"); + m_Filter = NULL; +} +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +vvThreadedFilter::~vvThreadedFilter() +{ +} +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +void vvThreadedFilter::SetFilter(clitk::ImageToImageGenericFilterBase * f) +{ + DD("SetFilter"); + m_Filter = f; +} +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +void vvThreadedFilter::Update() +{ + assert(m_Filter != NULL); + + // Show a progress bar while computing + vvProgressDialog progress("Computing ...",100); + connect(&progress, SIGNAL(rejected()), this, SLOT(reject())); + this->start(); + this->setTerminationEnabled(true); + std::string temp; + while (this->isRunning()) { + DD(this->isRunning()); + m_FilterBase = m_Filter->GetFilterBase(); // get filterbase only after Update + if (m_FilterBase != NULL) { + progress.SetProgress(m_FilterBase->GetCurrentStepNumber(), + m_FilterBase->GetNumberOfSteps()); + if (temp != m_FilterBase->GetCurrentStepName()) { + progress.AddToText(m_FilterBase->GetCurrentStepName()); + } + temp = m_FilterBase->GetCurrentStepName(); + } + this->wait(200); // in milisecond + qApp->processEvents(); + } + DD("after loop"); +} +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +void vvThreadedFilter::run() +{ + assert(m_Filter != NULL); + m_Filter->Update(); +} +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +void vvThreadedFilter::reject() +{ + DD("vvThreadedFilter::reject"); + this->quit(); + // if (m_Filter != NULL) { +// m_Filter->MustStop(); +// } + DD("after terminate"); +} +//------------------------------------------------------------------------------ + + + + diff --git a/vv/vvThreadedFilter.h b/vv/vvThreadedFilter.h new file mode 100644 index 0000000..ec3974f --- /dev/null +++ b/vv/vvThreadedFilter.h @@ -0,0 +1,52 @@ +/*========================================================================= + Program: vv http://www.creatis.insa-lyon.fr/rio/vv + + Authors belong to: + - University of LYON http://www.universite-lyon.fr/ + - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the copyright notices for more information. + + It is distributed under dual licence + + - BSD See included LICENSE.txt file + - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +======================================================================-====*/ + +#ifndef VVTHREADEDFILTER_H +#define VVTHREADEDFILTER_H + +// clitk +#include "clitkImageToImageGenericFilterBase.h" + +// qt +#include + +//------------------------------------------------------------------------------ +class vvThreadedFilter: public QThread +{ + Q_OBJECT + public: + vvThreadedFilter(); + ~vvThreadedFilter(); + + // Called from the main thread, runs the reader and displays the progress bar + void SetFilter(clitk::ImageToImageGenericFilterBase * f); + void Update(); + +public slots: + void reject(); + +protected: + void run(); + clitk::ImageToImageGenericFilterBase * m_Filter; + clitk::FilterBase * m_FilterBase; + +}; // end class vvThreadedFilter +//------------------------------------------------------------------------------ + +#endif + -- 2.45.1