]> Creatis software - clitk.git/commitdiff
cosmetic
authordsarrut <dsarrut>
Wed, 30 Jun 2010 06:15:26 +0000 (06:15 +0000)
committerdsarrut <dsarrut>
Wed, 30 Jun 2010 06:15:26 +0000 (06:15 +0000)
tools/clitkBinarizeImage.cxx
vv/vvSlicerManagerCommand.cxx
vv/vvToolBase.cxx
vv/vvToolBase.h
vv/vvToolBinarize.cxx
vv/vvToolBinarize.h
vv/vvToolCreatorBase.txx
vv/vvToolCropImage.cxx
vv/vvToolCropImage.h
vv/vvToolInputSelectorWidget.cxx
vv/vvToolSimpleInputSelectorWidget.cxx

index 345959d4d560e7ef0f0ef8714178813426319a88..0d5b7c2cda60fb5c2c39de5fcc97a235474154ba 100644 (file)
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
 ======================================================================-====*/
 
-/* =================================================
- * @file   clitkBinarizeImageGenericFilter.txx
- * @author Jef Vandemeulebroucke <jef@creatis.insa-lyon.fr>
- * @date   29 June 2009
- *
- * @brief Binarize an image
- *
- ===================================================*/
-
 // clitk
 #include "clitkBinarizeImage_ggo.h"
 #include "clitkBinarizeImageGenericFilter.h"
index b7c2b4669fff27f2a2bd4888ecf501b09d88b4d1..b6fdad145815f7c734eedcaa0f927fb3271b0d7c 100644 (file)
@@ -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);
index e9e442be64dcdefefbd996105e861dbf20d5d01f..d182d7d2e9aaca7e5bcc3c0f71aab882a3ee7393 100644 (file)
   - 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
 
index f28fc8bb5aaea4b960d5aa745897c39e3d4ff28f..4e825f9077fed2c4d6d37cbbaf57ec9e360d3347 100644 (file)
@@ -35,8 +35,11 @@ public:
   static void SetToolTip(QString n) { vvToolCreator<ToolType>::GetInstance()->mToolTip = n; }
   static void SetToolExperimental(bool exp) { vvToolCreator<ToolType>::GetInstance()->mExperimental = exp; }
 
-  void AddImage(vvImage::Pointer image,std::string filename) {
-    CREATOR(ToolType)->GetMainWindow()->AddImage(image,filename); 
+  static QIcon GetToolIcon() { return QIcon(vvToolCreator<ToolType>::GetInstance()->mToolIconFilename); }
+  static QString & GetToolName() { return vvToolCreator<ToolType>::GetInstance()->mToolName; }
+
+  vvSlicerManager * AddImage(vvImage::Pointer image,std::string filename) {
+    return CREATOR(ToolType)->GetMainWindow()->AddImage(image,filename); 
   }
 
   void setSender(QObject *s) { mSender = s; }
index 07089739dc6b961cd2777b6cf1e5a9cdfb70b0cc..abadb44f09163138ad244eb4561e857aca4a7081 100644 (file)
   - 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 <vtkImageActor.h>
 #include <vtkCamera.h>
 #include <vtkImageClip.h>
@@ -52,6 +55,7 @@ vvToolBinarize::vvToolBinarize(vvMainWindowBase * parent, Qt::WindowFlags f)
    vvToolBase<vvToolBinarize>(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()
 {
index fc042d95322173ea9663742d53ddd2dee7c424aa..4487ae4d86d550f95e229b50a104fd662411e347 100644 (file)
 ======================================================================-====*/
 #ifndef VVTOOLBINARIZE_H
 #define VVTOOLBINARIZE_H
+
 #include <QtDesigner/QDesignerExportWidget>
 
 #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<vvImageContour*> mImageContour;
index 5cd2c506b05d8529a97b844bac30e9c3540464c9..6497d6a920753a34c59b4de28eae5b1fde878e89 100644 (file)
@@ -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);
index 1600e866f9570fd8ea45619f9f4011b357a78fd4..ff88e2b23a3e01008b89c19574f1a841202ff459 100644 (file)
@@ -58,10 +58,20 @@ vvToolCropImage::~vvToolCropImage()
 
 
 //------------------------------------------------------------------------------
-bool vvToolCropImage::close()
+void vvToolCropImage::closeEvent(QCloseEvent *event)
 {
   for(int i=0; i<mExtentSize; i++) mReducedExtent[i] = mInitialExtent[i];
   UpdateExtent();
+  event->accept();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+bool vvToolCropImage::close()
+{
+  // for(int i=0; i<mExtentSize; i++) mReducedExtent[i] = mInitialExtent[i];
+//   UpdateExtent();
   return vvToolWidgetBase::close();
 }
 //------------------------------------------------------------------------------
index 308396de6c877dc4fe3ecaebbb96fda1f2531c87..b806876d79476639ad8c7db613c18436dc7eb46e 100644 (file)
@@ -66,6 +66,7 @@ public slots:
   int * mInitialExtent;
   int mExtentSize;
   void UpdateExtent();
+  virtual void closeEvent(QCloseEvent *event);
 
 }; // end class vvToolCropImage
 //------------------------------------------------------------------------------
index a8478e4588c3a07be9b1c01738256746256620fa..35de7bfb33c9f01f42393b1156c468c5860347d8 100644 (file)
@@ -81,6 +81,7 @@ void vvToolInputSelectorWidget::AddInputSelector(QString & s,
 //------------------------------------------------------------------------------
 void vvToolInputSelectorWidget::Initialize()
 {
+  // setWindowModality(Qt::WindowModal);
   for(unsigned int i=0; i<mListOfSimpleInputWidget.size(); i++)
     mListOfSimpleInputWidget[i]->Initialize();
 }
@@ -90,6 +91,7 @@ void vvToolInputSelectorWidget::Initialize()
 //------------------------------------------------------------------------------
 void vvToolInputSelectorWidget::accept()
 {
+  // setWindowModality(Qt::NonModal);
   //  DD("vvToolInputSelectorWidget::accept");
   //DD(mNumberOfAcceptedInputs);
   mNumberOfAcceptedInputs++;
index 9c948fcf0fbb2794af5e6314674250ea2a6a072e..e7c7d0db9d00ce812c4a5e13fc6c3e4f538b60a4 100644 (file)
@@ -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; i<d-1; i++) {
@@ -145,11 +151,12 @@ void vvToolSimpleInputSelectorWidget::changeInput(int index)
   }
   size.append(QString("%1").arg(mCurrentImage->GetSize()[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");
 }
 //------------------------------------------------------------------------------