From 668abd5376f649fba792239768eec55f3783613d Mon Sep 17 00:00:00 2001 From: dsarrut Date: Wed, 30 Jun 2010 06:15:26 +0000 Subject: [PATCH] cosmetic --- tools/clitkBinarizeImage.cxx | 9 --------- vv/vvSlicerManagerCommand.cxx | 8 ++++---- vv/vvToolBase.cxx | 8 -------- vv/vvToolBase.h | 7 +++++-- vv/vvToolBinarize.cxx | 14 +++++++++++++- vv/vvToolBinarize.h | 3 +++ vv/vvToolCreatorBase.txx | 2 +- vv/vvToolCropImage.cxx | 12 +++++++++++- vv/vvToolCropImage.h | 1 + vv/vvToolInputSelectorWidget.cxx | 2 ++ vv/vvToolSimpleInputSelectorWidget.cxx | 9 ++++++++- 11 files changed, 48 insertions(+), 27 deletions(-) diff --git a/tools/clitkBinarizeImage.cxx b/tools/clitkBinarizeImage.cxx index 345959d..0d5b7c2 100644 --- a/tools/clitkBinarizeImage.cxx +++ b/tools/clitkBinarizeImage.cxx @@ -16,15 +16,6 @@ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html ======================================================================-====*/ -/* ================================================= - * @file clitkBinarizeImageGenericFilter.txx - * @author Jef Vandemeulebroucke - * @date 29 June 2009 - * - * @brief Binarize an image - * - ===================================================*/ - // clitk #include "clitkBinarizeImage_ggo.h" #include "clitkBinarizeImageGenericFilter.h" diff --git a/vv/vvSlicerManagerCommand.cxx b/vv/vvSlicerManagerCommand.cxx index b7c2b46..b6fdad1 100644 --- a/vv/vvSlicerManagerCommand.cxx +++ b/vv/vvSlicerManagerCommand.cxx @@ -225,13 +225,13 @@ void vvSlicerManagerCommand::Execute(vtkObject *caller, return; } if (KeyPress == "Up") { - DD("------------ up"); + // DD("------------ up"); this->SM->GetSlicer(VisibleInWindow)->SetSlice(this->SM->GetSlicer(VisibleInWindow)->GetSlice()+1); - DD("------------ after set slice"); + //DD("------------ after set slice"); this->SM->UpdateInfoOnCursorPosition(VisibleInWindow); - DD("------------ after UpdateInfoOnCursorPosition"); + //DD("------------ after UpdateInfoOnCursorPosition"); this->SM->UpdateSlice(VisibleInWindow); - DD("------------ after updateslice"); + //DD("------------ after updateslice"); } if (KeyPress == "Down") { this->SM->GetSlicer(VisibleInWindow)->SetSlice(this->SM->GetSlicer(VisibleInWindow)->GetSlice()-1); diff --git a/vv/vvToolBase.cxx b/vv/vvToolBase.cxx index e9e442b..d182d7d 100644 --- a/vv/vvToolBase.cxx +++ b/vv/vvToolBase.cxx @@ -16,17 +16,9 @@ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html ======================================================================-====*/ - #ifndef VVTOOLBASE_CXX #define VVTOOLBASE_CXX #include "vvToolBase.h" -// //------------------------------------------------------------------------------ -// void vvToolBaseBase::initializeListOfInputImages() { - -// } - - - #endif diff --git a/vv/vvToolBase.h b/vv/vvToolBase.h index f28fc8b..4e825f9 100644 --- a/vv/vvToolBase.h +++ b/vv/vvToolBase.h @@ -35,8 +35,11 @@ public: static void SetToolTip(QString n) { vvToolCreator::GetInstance()->mToolTip = n; } static void SetToolExperimental(bool exp) { vvToolCreator::GetInstance()->mExperimental = exp; } - void AddImage(vvImage::Pointer image,std::string filename) { - CREATOR(ToolType)->GetMainWindow()->AddImage(image,filename); + static QIcon GetToolIcon() { return QIcon(vvToolCreator::GetInstance()->mToolIconFilename); } + static QString & GetToolName() { return vvToolCreator::GetInstance()->mToolName; } + + vvSlicerManager * AddImage(vvImage::Pointer image,std::string filename) { + return CREATOR(ToolType)->GetMainWindow()->AddImage(image,filename); } void setSender(QObject *s) { mSender = s; } diff --git a/vv/vvToolBinarize.cxx b/vv/vvToolBinarize.cxx index 0708973..abadb44 100644 --- a/vv/vvToolBinarize.cxx +++ b/vv/vvToolBinarize.cxx @@ -16,13 +16,16 @@ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html ======================================================================-====*/ +// vv #include "vvToolBinarize.h" #include "vvSlicerManager.h" #include "vvSlicer.h" #include "vvToolInputSelectorWidget.h" +// clitk #include "clitkBinarizeImageGenericFilter.h" +// vtk #include #include #include @@ -52,6 +55,7 @@ vvToolBinarize::vvToolBinarize(vvMainWindowBase * parent, Qt::WindowFlags f) vvToolBase(parent), Ui::vvToolBinarize() { + DD("Const binarize"); // GUI Initialization Ui_vvToolBinarize::setupUi(mToolWidget); mInteractiveDisplayIsEnabled = mCheckBoxInteractiveDisplay->isChecked(); @@ -119,12 +123,20 @@ void vvToolBinarize::RemoveVTKObjects() //------------------------------------------------------------------------------ bool vvToolBinarize::close() { - RemoveVTKObjects(); + // RemoveVTKObjects(); return vvToolWidgetBase::close(); } //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +void vvToolBinarize::closeEvent(QCloseEvent *event) { + RemoveVTKObjects(); + event->accept(); +} +//------------------------------------------------------------------------------ + + //------------------------------------------------------------------------------ void vvToolBinarize::reject() { diff --git a/vv/vvToolBinarize.h b/vv/vvToolBinarize.h index fc042d9..4487ae4 100644 --- a/vv/vvToolBinarize.h +++ b/vv/vvToolBinarize.h @@ -17,12 +17,14 @@ ======================================================================-====*/ #ifndef VVTOOLBINARIZE_H #define VVTOOLBINARIZE_H + #include #include "vvToolBase.h" #include "vvToolWidgetBase.h" #include "vvImageContour.h" #include "ui_vvToolBinarize.h" + #include "clitkBinarizeImage_ggo.h" //------------------------------------------------------------------------------ @@ -56,6 +58,7 @@ class vvToolBinarize: protected: void RemoveVTKObjects(); + virtual void closeEvent(QCloseEvent *event); Ui::vvToolBinarize ui; args_info_clitkBinarizeImage mArgsInfo; std::vector mImageContour; diff --git a/vv/vvToolCreatorBase.txx b/vv/vvToolCreatorBase.txx index 5cd2c50..6497d6a 100644 --- a/vv/vvToolCreatorBase.txx +++ b/vv/vvToolCreatorBase.txx @@ -22,7 +22,7 @@ void vvToolCreatorBase::CreateTool() // Get information on the current image mMainWindow->UpdateCurrentSlicer(); // Create the tool - ToolType * tool = new ToolType(mMainWindow); + ToolType * tool = new ToolType(mMainWindow, Qt::Dialog); tool->setSender(mSender); // Put it in the list of open tools mListOfTool.push_back(tool); diff --git a/vv/vvToolCropImage.cxx b/vv/vvToolCropImage.cxx index 1600e86..ff88e2b 100644 --- a/vv/vvToolCropImage.cxx +++ b/vv/vvToolCropImage.cxx @@ -58,10 +58,20 @@ vvToolCropImage::~vvToolCropImage() //------------------------------------------------------------------------------ -bool vvToolCropImage::close() +void vvToolCropImage::closeEvent(QCloseEvent *event) { for(int i=0; iaccept(); +} +//------------------------------------------------------------------------------ + + +//------------------------------------------------------------------------------ +bool vvToolCropImage::close() +{ + // for(int i=0; iInitialize(); } @@ -90,6 +91,7 @@ void vvToolInputSelectorWidget::Initialize() //------------------------------------------------------------------------------ void vvToolInputSelectorWidget::accept() { + // setWindowModality(Qt::NonModal); // DD("vvToolInputSelectorWidget::accept"); //DD(mNumberOfAcceptedInputs); mNumberOfAcceptedInputs++; diff --git a/vv/vvToolSimpleInputSelectorWidget.cxx b/vv/vvToolSimpleInputSelectorWidget.cxx index 9c948fc..e7c7d0d 100644 --- a/vv/vvToolSimpleInputSelectorWidget.cxx +++ b/vv/vvToolSimpleInputSelectorWidget.cxx @@ -97,6 +97,7 @@ void vvToolSimpleInputSelectorWidget::setEnabled(bool b) QWidget::setEnabled(b); mInputSelectionButtonBox->setEnabled(b); mInputSequenceBox->setEnabled(b); + } //------------------------------------------------------------------------------ @@ -131,10 +132,15 @@ void vvToolSimpleInputSelectorWidget::skip(QAbstractButton* b) //------------------------------------------------------------------------------ void vvToolSimpleInputSelectorWidget::changeInput(int index) { + // DD(index); if (index<0) return; + if (index>=(int)mSlicerManagerList.size()) return; mCurrentIndex = index; vvImage * mCurrentImage = mSlicerManagerList[index]->GetImage(); + if (mCurrentImage == NULL) return; + // DD("la"); unsigned int d = mCurrentImage->GetNumberOfDimensions(); + // DD(d); QString size; QString spacing; for(unsigned int i=0; iGetSize()[d-1])); spacing.append(QString("%1").arg(mCurrentImage->GetSpacing()[d-1])); - mLabelInputInfo->setText(QString("Image: %1D %2 %3 %4") + mLabelInputInfo->setText(QString("%1D %2\n%3\n%4") .arg(d) .arg(mCurrentImage->GetScalarTypeAsString().c_str()) .arg(size) .arg(spacing)); + // DD("fin"); } //------------------------------------------------------------------------------ -- 2.47.1