]> Creatis software - clitk.git/commitdiff
- autotool
authordsarrut <dsarrut>
Mon, 1 Mar 2010 15:37:41 +0000 (15:37 +0000)
committerdsarrut <dsarrut>
Mon, 1 Mar 2010 15:37:41 +0000 (15:37 +0000)
14 files changed:
common/clitkCommon.h
common/clitkImageToImageGenericFilter.txx
filters/clitkBinarizeImageGenericFilter.txx
vv/CMakeLists.txt
vv/vvMainWindow.cxx
vv/vvMainWindow.h
vv/vvSlicer.cxx
vv/vvSlicer.h
vv/vvToolBinarize.cxx
vv/vvToolCropImage.cxx
vv/vvToolCropImage.h
vv/vvToolInputSelectorWidget.cxx
vv/vvToolInputSelectorWidget.h
vv/vvToolWidgetBase.cxx

index c4d772d97aab121258d2a8c33eaf6fa77b444952..3a12a001bad6d1c7ee80ed75cab83d40ebff0095 100644 (file)
 // clitk include
 #include "clitkPortability.h"
 
-// std include
-//#include <config.h>
-//#include <cstdlib>
-//#include <algorithm>
-//#include <iostream>
-//#include <string>
-//#include <fstream>
-//#include <sstream>
-//#include <vector>
-//#include <math.h>
-//#include <typeinfo>
-//#include <utility>
-//#include <algorithm>
-
 // itk include (include std)
 #include <itkContinuousIndex.h>
 #include <itkMacro.h>
index 7959ba36eaa6e157a2fc623763860b32df5171dc..6febe19f9440d515c27f2e527eee2e82b3d781b8 100644 (file)
@@ -3,10 +3,10 @@
   Program:   vv
   Module:    $RCSfile: clitkImageToImageGenericFilter.txx,v $
   Language:  C++
-  Date:      $Date: 2010/02/18 14:47:20 $
-  Version:   $Revision: 1.6 $
+  Date:      $Date: 2010/03/01 15:37:41 $
+  Version:   $Revision: 1.7 $
   Author :   Joel Schaerer <joel.schaerer@creatis.insa-lyon.fr>
-             David Sarrut <david.sarrut@creatis.insa-lyon.fr>
+  David Sarrut <david.sarrut@creatis.insa-lyon.fr>
 
   Copyright (C) 2008
   Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
@@ -49,10 +49,10 @@ typename ImageType::Pointer clitk::ImageToImageGenericFilterBase::GetInput(unsig
   else if (mInputVVImages.size() > n)
     return typename ImageType::Pointer(const_cast<ImageType*>(vvImageToITK<ImageType>(mInputVVImages[n]).GetPointer()));
   else
-  {
-    assert(false); //No input, this shouldn't happen
-    return typename ImageType::Pointer(NULL);
-  }
+    {
+      assert(false); //No input, this shouldn't happen
+      return typename ImageType::Pointer(NULL);
+    }
 }
 //--------------------------------------------------------------------
 
@@ -60,8 +60,8 @@ typename ImageType::Pointer clitk::ImageToImageGenericFilterBase::GetInput(unsig
 //--------------------------------------------------------------------
 template<class FilterType>
 clitk::ImageToImageGenericFilter<FilterType>::ImageToImageGenericFilter(std::string filterName) :
-    ImageToImageGenericFilterBase(filterName), 
-    mImageTypesManager(static_cast<FilterType*>(this))
+  ImageToImageGenericFilterBase(filterName), 
+  mImageTypesManager(static_cast<FilterType*>(this))
 {
 }
 //--------------------------------------------------------------------
@@ -83,39 +83,47 @@ bool clitk::ImageToImageGenericFilter<FilterType>::Update() {
   mImageTypesManager.DoIt(mDim, mNbOfComponents, mPixelTypeName);
   return true;
 }
+//--------------------------------------------------------------------
+
 //--------------------------------------------------------------------
 template<class FilterType>
 bool clitk::ImageToImageGenericFilter<FilterType>::CheckImageType(unsigned int dim,unsigned int ncomp, std::string pixeltype)
 {
-    return static_cast<bool>(mImageTypesManager.mMapOfImageTypeToFunction[dim][ncomp][pixeltype]);
+  return static_cast<bool>(mImageTypesManager.mMapOfImageTypeToFunction[dim][ncomp][pixeltype]);
 }
+//--------------------------------------------------------------------
 
+
+//--------------------------------------------------------------------
 template<class FilterType>
 bool clitk::ImageToImageGenericFilter<FilterType>::CheckImageType()
 {
-    return static_cast<bool>(mImageTypesManager.mMapOfImageTypeToFunction[mDim][mNbOfComponents][mPixelTypeName]);
+  return static_cast<bool>(mImageTypesManager.mMapOfImageTypeToFunction[mDim][mNbOfComponents][mPixelTypeName]);
 }
+//--------------------------------------------------------------------
 
+
+//--------------------------------------------------------------------
 template<class FilterType>
 std::string clitk::ImageToImageGenericFilter<FilterType>::GetAvailableImageTypes() {
-    std::ostringstream oss;
-    oss << "The filter <" << mFilterName << "> manages:" << std::endl;
+  std::ostringstream oss;
+  oss << "The filter <" << mFilterName << "> manages:" << std::endl;
     
-    typedef typename ImageTypesManager<FilterType>::MapOfImageComponentsToFunctionType::const_iterator MCompItType;
-    typedef typename ImageTypesManager<FilterType>::MapOfImageDimensionToFunctionType::const_iterator MDimItType;
-    typedef typename ImageTypesManager<FilterType>::MapOfPixelTypeToFunctionType::const_iterator MPixelItType;
-    for (MDimItType i=mImageTypesManager.mMapOfImageTypeToFunction.begin();
-            i!=mImageTypesManager.mMapOfImageTypeToFunction.end();
-            i++) {
-        for (MCompItType j=(*i).second.begin(); j!= (*i).second.end(); j++) {
-            for (MPixelItType k=(*j).second.begin(); k!= (*j).second.end(); k++) {
-                oss << "Dim: " << (*i).first 
-                    << ", Components: " << (*j).first 
-                    << ", Type: " << (*k).first << std::endl;
-            }
-        }
+  typedef typename ImageTypesManager<FilterType>::MapOfImageComponentsToFunctionType::const_iterator MCompItType;
+  typedef typename ImageTypesManager<FilterType>::MapOfImageDimensionToFunctionType::const_iterator MDimItType;
+  typedef typename ImageTypesManager<FilterType>::MapOfPixelTypeToFunctionType::const_iterator MPixelItType;
+  for (MDimItType i=mImageTypesManager.mMapOfImageTypeToFunction.begin();
+       i!=mImageTypesManager.mMapOfImageTypeToFunction.end();
+       i++) {
+    for (MCompItType j=(*i).second.begin(); j!= (*i).second.end(); j++) {
+      for (MPixelItType k=(*j).second.begin(); k!= (*j).second.end(); k++) {
+        oss << "Dim: " << (*i).first 
+            << ", Components: " << (*j).first 
+            << ", Type: " << (*k).first << std::endl;
+      }
     }
-    return oss.str();
+  }
+  return oss.str();
 }
 //--------------------------------------------------------------------
 
index 206b1431380bf14a54f1c4cbf30e4dba093b6bfe..cb4e7b929fda8e99d94617f45112f7027aff9f93 100644 (file)
@@ -46,7 +46,6 @@ namespace clitk
   void BinarizeImageGenericFilter<args_info_type>::SetArgsInfo(const args_info_type & a) {
     mArgsInfo=a;
     SetIOVerbose(mArgsInfo.verbose_flag);
-
     if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes();
 
     if (mArgsInfo.input_given) {
@@ -83,15 +82,15 @@ namespace clitk
     if (mArgsInfo.lower_given) thresholdFilter->SetLowerThreshold(static_cast<PixelType>(mArgsInfo.lower_arg));
     if (mArgsInfo.upper_given) thresholdFilter->SetUpperThreshold(static_cast<PixelType>(mArgsInfo.upper_arg));
 
-    DD(mArgsInfo.lower_given);
-    DD(mArgsInfo.upper_given);
-    DD(mArgsInfo.lower_arg);
-    DD(mArgsInfo.upper_arg);
-    DD(mArgsInfo.fg_arg);
-    DD(mArgsInfo.bg_arg);
-    DD(mArgsInfo.fg_given);
-    DD(mArgsInfo.bg_given);
-    DD(mArgsInfo.mode_arg);
+    // DD(mArgsInfo.lower_given);
+    // DD(mArgsInfo.upper_given);
+    // DD(mArgsInfo.lower_arg);
+    // DD(mArgsInfo.upper_arg);
+    // DD(mArgsInfo.fg_arg);
+    // DD(mArgsInfo.bg_arg);
+    // DD(mArgsInfo.fg_given);
+    // DD(mArgsInfo.bg_given);
+    // DD(mArgsInfo.mode_arg);
 
 // <<<<<<< clitkBinarizeImageGenericFilter.txx
 //     DD(mArgsInfo.useFG_flag);
index d704adc84b3eb60b5ce56024bb844b17ed3027c7..2f6eb0e89893cc0686575562da2d0216e3b6d30b 100644 (file)
@@ -97,15 +97,14 @@ SET(vv_SRCS
   vvMeshActor.cxx
   vvMeshReader.cxx
   vvStructSelector.cxx
-  vvCropDialog.cxx
   vvMidPosition.cxx
   vvImageMapToWLColors.cxx
   vvIntensityValueSlider.cxx
   vvToolManager.cxx
   vvToolCreatorBase.cxx
   vvToolWidgetBase.cxx
-  vvToolFoo.cxx
-  vvToolFooWithWidgetBase.cxx
+#  vvToolFoo.cxx
+#  vvToolFooWithWidgetBase.cxx
   vvToolCropImage.cxx
   vvToolBinarize.cxx
   vvToolInputSelectorWidget.cxx
@@ -130,11 +129,10 @@ QT4_WRAP_CPP(vv_SRCS
   vvDeformationDialog.h
   vvSlicerManager.h
   vvStructSelector.h
-  vvCropDialog.h
   vvIntensityValueSlider.h
   vvToolCreatorBase.h
-  vvToolFoo.h
-  vvToolFooWithWidgetBase.h
+#  vvToolFoo.h
+#  vvToolFooWithWidgetBase.h
   vvToolBinarize.h
   vvToolInputSelectorWidget.h
   vvToolWidgetBase.h
@@ -156,12 +154,11 @@ QT4_WRAP_UI(vv_UI_CXX
   qt_ui/vvResamplerDialog.ui
   qt_ui/vvDeformationDialog.ui
   qt_ui/vvStructSelector.ui
-  qt_ui/vvCropDialog.ui
   qt_ui/vvDummyWindow.ui #For testing
   qt_ui/vvIntensityValueSlider.ui
   qt_ui/vvToolWidgetBase.ui
-  qt_ui/vvToolFoo.ui
-  qt_ui/vvToolCropImage.ui
+#  qt_ui/vvToolFoo.ui
+#  qt_ui/vvToolCropImage.ui
   qt_ui/vvToolBinarize.ui
   qt_ui/vvToolInputSelectorWidget.ui
   )
index 9d179e3304a9ce48bce07ce0b37d5d50a86b59b1..89319bc17f4aca000f4d05c19f1eaab0ae9507e8 100644 (file)
@@ -3,8 +3,8 @@
   Program:   vv
   Module:    $RCSfile: vvMainWindow.cxx,v $
   Language:  C++
-  Date:      $Date: 2010/03/01 07:37:25 $
-  Version:   $Revision: 1.13 $
+  Date:      $Date: 2010/03/01 15:38:09 $
+  Version:   $Revision: 1.14 $
   Author :   Pierre Seroul (pierre.seroul@gmail.com)
 
   Copyright (C) 200COLUMN_IMAGE_NAME
@@ -54,7 +54,6 @@
 #include "vvMesh.h"
 #include "vvStructSelector.h"
 #include "vvMeshReader.h"
-#include "vvCropDialog.h"
 #include "vvConstants.h"
 
 #ifdef CLITK_VV_USE_BDCM
@@ -142,10 +141,10 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() {
 
   contextMenu.addSeparator();
 
-  QAction* actionCrop_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/new/prefix1/icons/crop.png")),
-                                                    tr("Crop Current Image"));
-  connect(actionCrop_image,SIGNAL(triggered()),this,SLOT(CropImage()));
-  contextActions.push_back(actionCrop_image);
+  // QAction* actionCrop_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/new/prefix1/icons/crop.png")),
+  //                                                   tr("Crop Current Image"));
+  // connect(actionCrop_image,SIGNAL(triggered()),this,SLOT(CropImage()));
+  // contextActions.push_back(actionCrop_image);
 
   QAction* actionSplit_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/new/prefix1/icons/cut.png")),
                                                      tr("Split Current Image"));
@@ -1088,8 +1087,8 @@ void vvMainWindow::ImageInfoChanged() {
       }
     windowSpinBox->setValue(mSlicerManagers[index]->GetColorWindow());
     levelSpinBox->setValue(mSlicerManagers[index]->GetColorLevel());
-    DD(mSlicerManagers[index]->GetColorMap());
-    DD(mSlicerManagers[index]->GetPreset());
+    // DD(mSlicerManagers[index]->GetColorMap());
+    // DD(mSlicerManagers[index]->GetPreset());
     presetComboBox->setCurrentIndex(mSlicerManagers[index]->GetPreset());
     colorMapComboBox->setCurrentIndex(mSlicerManagers[index]->GetColorMap());
 
@@ -1552,13 +1551,13 @@ void vvMainWindow::ReloadImage(QTreeWidgetItem* item, int column) {
 }
 //------------------------------------------------------------------------------
 
-void vvMainWindow::CropImage()
-{
-  int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
-  vvCropDialog crop(mSlicerManagers,index);
-  if(crop.exec())
-    AddImage(crop.GetOutput(),"cropped.mhd");
-}
+// void vvMainWindow::CropImage()
+// {
+//   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
+//   vvCropDialog crop(mSlicerManagers,index);
+//   if(crop.exec())
+//     AddImage(crop.GetOutput(),"cropped.mhd");
+// }
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SplitImage() {
@@ -2772,13 +2771,9 @@ void vvMainWindow::AddImage(vvSlicerManager * slicer_manager) {
 
 //------------------------------------------------------------------------------
 void vvMainWindow::UpdateCurrentSlicer() {
-  DD("UpdateCurrentSlicer");
   int index = -1;
-  DD(DataTree->selectedItems().size());
   if (DataTree->selectedItems().size() > 0) {
     index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
-    DD(DataTree->selectedItems()[0]);
-    DD(index);
   }
   mSlicerManagerCurrentIndex = index;    
 }
index d92937408231ce15e2dc9f0c77d3bdf6ebd56125..df525fc1020a54b4f59442de68246d13aae4da25 100644 (file)
@@ -131,7 +131,7 @@ public slots:
   void SaveSOScreenshot();
 
   void ShowContextMenu(QPoint point);
-  void CropImage();
+  //  void CropImage();
   void SplitImage();
   void CloseImage();
   void ReloadImage();
index 66a62ed2372729986119b3b812996027bae76188..60ff1e4ebf594bfb7edae79d88ce2cb210abdcff 100644 (file)
@@ -74,6 +74,7 @@
 vtkCxxRevisionMacro(vvSlicer, "DummyRevision");
 vtkStandardNewMacro(vvSlicer);
 
+//------------------------------------------------------------------------------
 vvSlicer::vvSlicer()
 {
   mImage = NULL;
@@ -145,26 +146,50 @@ vvSlicer::vvSlicer()
   this->WindowLevel = vvImageMapToWLColors::New();
   this->InstallPipeline();
 }
+//------------------------------------------------------------------------------
 
+
+//------------------------------------------------------------------------------
 vtkImageMapToWindowLevelColors* vvSlicer::GetOverlayMapper() {
   return mOverlayMapper.GetPointer();
 }
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
 vtkImageActor* vvSlicer::GetOverlayActor() {
   return mOverlayActor.GetPointer();
 }
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
 vtkImageMapToWindowLevelColors* vvSlicer::GetFusionMapper() {
   return mFusionMapper.GetPointer();
 }
+//------------------------------------------------------------------------------
+
     
+//------------------------------------------------------------------------------
 vtkImageActor* vvSlicer::GetFusionActor() {
   return mFusionActor.GetPointer();
 }
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
 vtkActor* vvSlicer::GetVFActor() {
   return mVFActor.GetPointer();
 }
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
 vtkCornerAnnotation* vvSlicer::GetAnnotation() {
   return ca.GetPointer();
 }
+//------------------------------------------------------------------------------
+
 
 //------------------------------------------------------------------------------
 void vvSlicer::EnableReducedExtent(bool b) {
@@ -194,34 +219,54 @@ void vvSlicer::AddContour(vvMesh::Pointer contour,bool propagate)
 
   SetContourSlice();
 }
+//------------------------------------------------------------------------------
+
 
+//------------------------------------------------------------------------------
 void vvSlicer::ToggleContourSuperposition()
 {
   for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
        i!=mSurfaceCutActors.end();i++)
     (*i)->ToggleSuperposition();
 }
+//------------------------------------------------------------------------------
+
 
+//------------------------------------------------------------------------------
 void vvSlicer::SetCursorColor(int r,int g, int b)
 {
   pdmA->GetProperty()->SetColor(r,g,b);
 }
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
 void vvSlicer::SetCursorVisibility(bool s)
 {
   pdmA->SetVisibility(s);
 }
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
 bool vvSlicer::GetCursorVisibility()
 {
   return pdmA->GetVisibility();
 }
+//------------------------------------------------------------------------------
+
 
+//------------------------------------------------------------------------------
 vvSlicer::~vvSlicer()
 {
   for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
        i!=mSurfaceCutActors.end();i++)
     delete (*i);
 }
+//------------------------------------------------------------------------------
+
 
+//------------------------------------------------------------------------------
 void vvSlicer::SetCurrentPosition(double x, double y, double z, int t)
 {
   mCurrent[0] = x;
@@ -229,7 +274,10 @@ void vvSlicer::SetCurrentPosition(double x, double y, double z, int t)
   mCurrent[2] = z;
   mCurrentTSlice = t;
 }
+//------------------------------------------------------------------------------
 
+
+//------------------------------------------------------------------------------
 void vvSlicer::SetImage(vvImage::Pointer image)
 {
   if (image->GetVTKImages().size())
@@ -241,7 +289,10 @@ void vvSlicer::SetImage(vvImage::Pointer image)
       ca->SetText(0,mFileName.c_str());
     }
 }
+//------------------------------------------------------------------------------
 
+
+//------------------------------------------------------------------------------
 void vvSlicer::SetOverlay(vvImage::Pointer overlay)
 {
   if (overlay->GetVTKImages().size())
@@ -276,7 +327,10 @@ void vvSlicer::SetOverlay(vvImage::Pointer overlay)
       SetTSlice(mCurrentTSlice);
     }
 }
+//------------------------------------------------------------------------------
+
 
+//------------------------------------------------------------------------------
 void vvSlicer::SetFusion(vvImage::Pointer fusion)
 {
   if (fusion->GetVTKImages().size())
@@ -302,7 +356,10 @@ void vvSlicer::SetFusion(vvImage::Pointer fusion)
       SetTSlice(mCurrentTSlice);
     }
 }
+//------------------------------------------------------------------------------
+
 
+//------------------------------------------------------------------------------
 void vvSlicer::SetActorVisibility(const std::string& actor_type, int overlay_index ,bool vis)
 {
   if (actor_type == "vector")
@@ -321,7 +378,10 @@ void vvSlicer::SetActorVisibility(const std::string& actor_type, int overlay_ind
     this->mSurfaceCutActors[overlay_index]->GetActor()->SetVisibility(vis);
   UpdateDisplayExtent();
 }
+//------------------------------------------------------------------------------
 
+
+//------------------------------------------------------------------------------
 void vvSlicer::SetVF(vvImage::Pointer vf)
 {
   if (vf->GetVTKImages().size())
@@ -373,7 +433,10 @@ void vvSlicer::SetVF(vvImage::Pointer vf)
       SetTSlice(mCurrentTSlice);
     }
 }
+//------------------------------------------------------------------------------
+
 
+//------------------------------------------------------------------------------
 void vvSlicer::SetLandmarks(vvLandmarks* landmarks)
 {
   mLandmarks = landmarks;
@@ -420,7 +483,9 @@ void vvSlicer::SetLandmarks(vvLandmarks* landmarks)
       this->GetRenderer()->AddActor(mLandActor);
     }
 }
+//------------------------------------------------------------------------------
 
+//------------------------------------------------------------------------------
 //FIXME: this function leaks memory, we should fix it someday :)
 void vvSlicer::RemoveActor(const std::string& actor_type, int overlay_index)
 {
@@ -455,7 +520,10 @@ void vvSlicer::RemoveActor(const std::string& actor_type, int overlay_index)
       mSurfaceCutActors.erase(mSurfaceCutActors.begin()+overlay_index);
     }
 }
+//------------------------------------------------------------------------------
+
 
+//------------------------------------------------------------------------------
 void vvSlicer::SetVFSubSampling(int sub)
 {
   if (mVOIFilter)
@@ -466,7 +534,10 @@ void vvSlicer::SetVFSubSampling(int sub)
   UpdateDisplayExtent();
   Render();
 }
+//------------------------------------------------------------------------------
+
 
+//------------------------------------------------------------------------------
 void vvSlicer::SetVFScale(int scale)
 {
   mScale = scale;
@@ -475,7 +546,10 @@ void vvSlicer::SetVFScale(int scale)
   UpdateDisplayExtent();
   Render();
 }
+//------------------------------------------------------------------------------
 
+
+//------------------------------------------------------------------------------
 void vvSlicer::SetVFLog(int log)
 {
   mVFLog = log;
@@ -487,7 +561,10 @@ void vvSlicer::SetVFLog(int log)
   UpdateDisplayExtent();
   Render();
 }
+//------------------------------------------------------------------------------
+
 
+//------------------------------------------------------------------------------
 void vvSlicer::SetTSlice(int t)
 {
   if (t < 0)
@@ -517,12 +594,18 @@ void vvSlicer::SetTSlice(int t)
       (*i)->SetTimeSlice(mCurrentTSlice);
   UpdateDisplayExtent();
 }
+//------------------------------------------------------------------------------
+
 
+//------------------------------------------------------------------------------
 int vvSlicer::GetTSlice()
 {
   return mCurrentTSlice;
 }
+//------------------------------------------------------------------------------
 
+
+//------------------------------------------------------------------------------
 void vvSlicer::SetSliceOrientation(int orientation)
 {
   //if 2D image, force to watch in Axial View
@@ -574,10 +657,6 @@ void vvSlicer::UpdateDisplayExtent()
   }
   else w_ext = input->GetWholeExtent();
 
-  DD(w_ext[0]);
-  DD(w_ext[1]);
-  DD(w_ext[2]);
-
   switch (this->SliceOrientation)
     {
     case vtkImageViewer2::SLICE_ORIENTATION_XY:
@@ -780,7 +859,10 @@ void vvSlicer::UpdateDisplayExtent()
         }
     }
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicer::ComputeVFDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int vfExtent[6])
 {
   vtkImageData* image=this->GetInput();
@@ -799,7 +881,10 @@ void vvSlicer::ComputeVFDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z
 
   ClipDisplayedExtent(vfExtent,mVOIFilter->GetInput()->GetWholeExtent());
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 void vvSlicer::ComputeOverlayDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int overExtent[6])
 {
   vtkImageData* image=this->GetInput();
@@ -817,7 +902,10 @@ void vvSlicer::ComputeOverlayDisplayedExtent(int x1,int x2,int y1,int y2,int z1,
     mOverlay->GetSpacing()[2];
   ClipDisplayedExtent(overExtent, mOverlayMapper->GetInput()->GetWholeExtent());
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 void vvSlicer::ComputeFusionDisplayedExtent(int x1,int x2,int y1,int y2,int z1,int z2,int fusExtent[6])
 {
   vtkImageData* image=this->GetInput();
@@ -835,7 +923,10 @@ void vvSlicer::ComputeFusionDisplayedExtent(int x1,int x2,int y1,int y2,int z1,i
     mFusion->GetSpacing()[2];
   ClipDisplayedExtent(fusExtent, mFusionMapper->GetInput()->GetWholeExtent());
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicer::ClipDisplayedExtent(int extent[6], int refExtent[6])
 {
   bool out = false;
@@ -870,7 +961,10 @@ void vvSlicer::ClipDisplayedExtent(int extent[6], int refExtent[6])
         extent[i+1] = refExtent[i];
       }
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicer::UpdateOrientation()
 {
   // Set the camera position
@@ -899,12 +993,18 @@ void vvSlicer::UpdateOrientation()
         }
     }
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 void vvSlicer::SetOpacity(double s)
 {
   this->GetImageActor()->SetOpacity(s);
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicer::SetRenderWindow(int orientation, vtkRenderWindow * rw)
 {
   this->Superclass::SetRenderWindow(rw);
@@ -934,7 +1034,10 @@ void vvSlicer::SetRenderWindow(int orientation, vtkRenderWindow * rw)
   SetSliceOrientation(2-(orientation%3));
   ResetCamera();
 }
+//----------------------------------------------------------------------------
+
 
+//----------------------------------------------------------------------------
 void vvSlicer::ResetCamera()
 {
   if (this->GetInput())
@@ -947,7 +1050,10 @@ void vvSlicer::ResetCamera()
       this->GetRenderer()->GetActiveCamera()->SetParallelScale(bmax/2);
     }
 }
+//----------------------------------------------------------------------------
 
+
+//----------------------------------------------------------------------------
 void vvSlicer::SetDisplayMode(bool i)
 {
   this->GetImageActor()->SetVisibility(i);
@@ -1110,8 +1216,10 @@ void vvSlicer::Render()
           std::stringstream val;
           val << value;
           worldPos += "data value : " + val.str();
-          worldPos += "\n mm : " + world1.str() + " " + world2.str() + " " + world3.str() + " " + temps.str();
-          worldPos += "\n pixel : " + pixel1.str() + " " + pixel2.str() + " " + pixel3.str() + " " + temps.str();
+          worldPos += "\n mm : " + world1.str() + " " + world2.str() + " " + 
+            world3.str() + " " + temps.str();
+          worldPos += "\n pixel : " + pixel1.str() + " " + pixel2.str() + " " + 
+            pixel3.str() + " " + temps.str();
         }
       ca->SetText(1,worldPos.c_str());
     }
@@ -1143,6 +1251,7 @@ void vvSlicer::UpdateCursorPosition()
 }
 //----------------------------------------------------------------------------
 
+
 //----------------------------------------------------------------------------
 void vvSlicer::UpdateLandmarks()
 {
@@ -1165,11 +1274,7 @@ void vvSlicer::UpdateLandmarks()
 //----------------------------------------------------------------------------
 void vvSlicer::SetSlice(int slice)
 {
-  DD("vvSlicer::SetSlice");
-  DD(slice);
   int *range = this->GetSliceRange();
-  DD(range[0]);
-  DD(range[1]);
   if (range)
     {
       if (slice < range[0])
index e96a5b15b8239a6fa429ca575d49cb3072058b70..1d42e375f5ed18414875883f03a9073e2aed024a 100644 (file)
@@ -210,6 +210,7 @@ protected:
     int mVFLog;
     bool mUseReducedExtent;
     int * mReducedExtent;
+    int * mInitialExtent;
 
 private:
     void UpdateOrientation();
index 2d6a410756d016e1c56268875eb31ff192e08f0f..4f91d19d2c20165c87bd0e1c7acfa23ac26f33de 100644 (file)
@@ -3,8 +3,8 @@
   Program:   vv
   Module:    $RCSfile: vvToolBinarize.cxx,v $
   Language:  C++
-  Date:      $Date: 2010/03/01 07:37:25 $
-  Version:   $Revision: 1.9 $
+  Date:      $Date: 2010/03/01 15:38:09 $
+  Version:   $Revision: 1.10 $
   Author :   David Sarrut (david.sarrut@creatis.insa-lyon.fr)
 
   Copyright (C) 2008
@@ -114,6 +114,7 @@ void vvToolBinarize::RemoveVTKObjects() {
 }
 //------------------------------------------------------------------------------
 
+
 //------------------------------------------------------------------------------
 bool vvToolBinarize::close() { 
   RemoveVTKObjects();
@@ -153,8 +154,6 @@ void vvToolBinarize::useFGBGtoggled(bool) {
 //------------------------------------------------------------------------------
 void vvToolBinarize::InputIsSelected(vvSlicerManager * m) {
   mCurrentSlicerManager = m;
-  // Common
-  mCurrentImage = mCurrentSlicerManager->GetImage();
 
   // Specific for this gui
   mThresholdSlider1->SetValue(0);
@@ -209,6 +208,7 @@ void vvToolBinarize::GetArgsInfoFromGUI() {
   DD(good);
   */
 
+  mArgsInfo.imagetypes_flag = 0;
   mArgsInfo.upper_given = 0;
   mArgsInfo.lower_given = 0;
   bool inverseBGandFG = false;
@@ -241,7 +241,7 @@ void vvToolBinarize::GetArgsInfoFromGUI() {
   }
   else mArgsInfo.mode_arg = (char*)"FG";
 
-  mArgsInfo.verbose_flag = true;
+  mArgsInfo.verbose_flag = false;
 
   // Required (even if not used)
   mArgsInfo.input_given = 0;
@@ -256,20 +256,22 @@ void vvToolBinarize::GetArgsInfoFromGUI() {
 //------------------------------------------------------------------------------
 void vvToolBinarize::apply() {
   if (!mCurrentSlicerManager) close();
+  QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
   GetArgsInfoFromGUI();
 
   // Main filter
   clitk::BinarizeImageGenericFilter<args_info_clitkBinarizeImage>::Pointer filter = 
-    clitk::BinarizeImageGenericFilter<args_info_clitkBinarizeImage>::New();
+     clitk::BinarizeImageGenericFilter<args_info_clitkBinarizeImage>::New();
   filter->SetArgsInfo(mArgsInfo);
   filter->SetInputVVImage(mCurrentImage);
   filter->Update();
 
-  // Output ???
+  // Output
   vvImage::Pointer output = filter->GetOutputVVImage();
   std::ostringstream osstream;
   osstream << "Binarized_" << mCurrentSlicerManager->GetSlicer(0)->GetFileName() << ".mhd";
   AddImage(output,osstream.str()); 
+  QApplication::restoreOverrideCursor();
   close();
 }
 //------------------------------------------------------------------------------
@@ -284,12 +286,9 @@ void vvToolBinarize::valueChangedT2(double v) {
 
 //------------------------------------------------------------------------------
 void vvToolBinarize::valueChangedT1(double v) {
-  // DD(v);
   if (!mCurrentSlicerManager) close();
-//   DD(mCurrentSlicerManager->GetSlicer(0));
   mThresholdSlider2->SetMinimum(v);
-  int m1 = (int)lrint(v);
-  
+  int m1 = (int)lrint(v);  
   if (!mInteractiveDisplayIsEnabled) return;
   for(int i=0;i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
     mImageContour[i]->update(m1);
index a8cec28d5bfea452a561e090256fd191172dbab3..ba97489b8da372479c7c35aa9a8c755e5ab8331f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   vv
   Module:    $RCSfile: vvToolCropImage.cxx,v $
   Language:  C++
-  Date:      $Date: 2010/03/01 07:37:25 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2010/03/01 15:38:09 $
+  Version:   $Revision: 1.3 $
   Author :   David Sarrut (david.sarrut@creatis.insa-lyon.fr)
 
   Copyright (C) 2008
@@ -50,10 +50,7 @@ vvToolCropImage::vvToolCropImage(vvMainWindowBase * parent, Qt::WindowFlags f):
 
   // GUI Initialization
   Ui_vvToolCropImage::setupUi(mToolWidget);
-  mReducedExtent = new int[6]; // TO CHANGE !! nb dim
 
-  // Connect
-  connect(xminSlider, SIGNAL(sliderMoved(int)), this, SLOT(sliderMoved(int)));
 }
 //------------------------------------------------------------------------------
 
@@ -66,11 +63,101 @@ vvToolCropImage::~vvToolCropImage() {
 
 
 //------------------------------------------------------------------------------
-void vvToolCropImage::sliderMoved(int s) {
-  DD(s);
+bool vvToolCropImage::close() { 
+  for(int i=0; i<6; i++) mReducedExtent[i] = mInitialExtent[i];
+  UpdateExtent();
+  return vvToolWidgetBase::close(); 
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolCropImage::reject() { 
+  for(int i=0; i<6; i++) mReducedExtent[i] = mInitialExtent[i];
+  UpdateExtent();
+  return vvToolWidgetBase::reject(); 
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolCropImage::sliderXMinValueChanged(int s) {
+  xmaxSlider->setMinimum(xminSlider->value());
   mReducedExtent[0] = xminSlider->value();
+  UpdateExtent();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolCropImage::sliderXMaxValueChanged(int s) {
+  xminSlider->setMaximum(xmaxSlider->value());
+  mReducedExtent[1] = xmaxSlider->value();
+  UpdateExtent();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolCropImage::sliderYMinValueChanged(int s) {
+  ymaxSlider->setMinimum(yminSlider->value());
+  mReducedExtent[2] = yminSlider->value();
+  UpdateExtent();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolCropImage::sliderYMaxValueChanged(int s) {
+  yminSlider->setMaximum(ymaxSlider->value());
+  mReducedExtent[3] = ymaxSlider->value();
+  UpdateExtent();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolCropImage::sliderZMinValueChanged(int s) {
+  zmaxSlider->setMinimum(zminSlider->value());
+  mReducedExtent[4] = zminSlider->value();
+  UpdateExtent();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolCropImage::sliderZMaxValueChanged(int s) {
+  zminSlider->setMaximum(zmaxSlider->value());
+  mReducedExtent[5] = zmaxSlider->value();
+  UpdateExtent();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+// void vvToolCropImage::sliderTMinValueChanged(int s) {
+//   tmaxSlider->setMinimum(tminSlider->value());
+//   mReducedExtent[6] = tminSlider->value();
+//   UpdateExtent();
+// }
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+// void vvToolCropImage::sliderTMaxValueChanged(int s) {
+//   tminSlider->setMaximum(tmaxSlider->value());
+//   mReducedExtent[7] = tmaxSlider->value();
+//   UpdateExtent();
+// }
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolCropImage::UpdateExtent() {
   for(int i=0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
     mCurrentSlicerManager->GetSlicer(i)->SetReducedExtent(mReducedExtent);
+    mCurrentSlicerManager->GetSlicer(i)->ForceUpdateDisplayExtent();    
+    mCurrentSlicerManager->GetSlicer(i)->Render();    
   }
 }
 //------------------------------------------------------------------------------
@@ -78,68 +165,135 @@ void vvToolCropImage::sliderMoved(int s) {
 
 //------------------------------------------------------------------------------
 void vvToolCropImage::InputIsSelected(vvSlicerManager * slicer) {
-  DD("InputIsSelected"); 
 
+  // Change interface according to number of dimension
+  mExtentSize = 2*slicer->GetDimension();
+  // if (slicer->GetDimension()<4) {
+  //   mTLabel1->setHidden(true);
+  //   mTLabel2->setHidden(true);
+  //   tminSlider->setHidden(true);
+  //   tmaxSlider->setHidden(true);
+  //   spin_tmin->setHidden(true);
+  //   spin_tmax->setHidden(true);
+  // }
+  if (slicer->GetDimension()<3) {
+    mZLabel1->setHidden(true);
+    mZLabel2->setHidden(true);
+    zminSlider->setHidden(true);
+    zmaxSlider->setHidden(true);
+    spin_zmin->setHidden(true);
+    spin_zmax->setHidden(true);
+  }
+  
+  // Record initial extend
+  mReducedExtent = new int[mExtentSize];
+  mInitialExtent = new int[mExtentSize];
   mReducedExtent = mCurrentSlicerManager->GetImage()->GetFirstVTKImageData()->GetWholeExtent();
-  DD(mReducedExtent[0]);
-  DD(mReducedExtent[1]);
-
+  for(int i=0; i<6; i++) mInitialExtent[i] = mReducedExtent[i];
+  for(int i=0; i<mCurrentSlicerManager->NumberOfSlicers(); i++) {
+    mCurrentSlicerManager->GetSlicer(i)->EnableReducedExtent(true);
+  }
   
-  // TODO : set min/max
-    std::vector<int> imsize = mCurrentSlicerManager->GetImage()->GetSize();
-    xminSlider->setMaximum(imsize[0]-1);
-    xmaxSlider->setMaximum(imsize[0]-1);
-    xmaxSlider->setValue(imsize[0]-1);
-    yminSlider->setMaximum(imsize[1]-1);
-    ymaxSlider->setMaximum(imsize[1]-1);
-    ymaxSlider->setValue(imsize[1]-1);
+  // Not now ....
+  //  mIntensitySlider->SetImage(mCurrentImage);
+  //mIntensitySlider->setEnabled(false);
+
+  // Set initial sliders values
+  std::vector<int> imsize = mCurrentSlicerManager->GetImage()->GetSize();
+  xminSlider->setMaximum(imsize[0]-1);
+  xmaxSlider->setMaximum(imsize[0]-1);
+  xmaxSlider->setValue(imsize[0]-1);
+
+  yminSlider->setMaximum(imsize[1]-1);
+  ymaxSlider->setMaximum(imsize[1]-1);
+  ymaxSlider->setValue(imsize[1]-1);
+
+  if (slicer->GetDimension() >2) {
     zminSlider->setMaximum(imsize[2]-1);
     zmaxSlider->setMaximum(imsize[2]-1);
     zmaxSlider->setValue(imsize[2]-1);
-    spin_xmin->setMaximum(imsize[0]-1);
-    spin_xmax->setMaximum(imsize[0]-1);
-    spin_xmax->setValue(imsize[0]-1);
-    spin_ymin->setMaximum(imsize[1]-1);
-    spin_ymax->setMaximum(imsize[1]-1);
-    spin_ymax->setValue(imsize[1]-1);
+  }
+
+  // if (slicer->GetDimension() >3) {
+  //   tminSlider->setMaximum(imsize[3]-1);
+  //   tmaxSlider->setMaximum(imsize[3]-1);
+  //   tmaxSlider->setValue(imsize[3]-1);
+  // }
+
+  spin_xmin->setMaximum(imsize[0]-1);
+  spin_xmax->setMaximum(imsize[0]-1);
+  spin_xmax->setValue(imsize[0]-1);
+
+  spin_ymin->setMaximum(imsize[1]-1);
+  spin_ymax->setMaximum(imsize[1]-1);
+  spin_ymax->setValue(imsize[1]-1);
+
+  if (slicer->GetDimension() >2) {
     spin_zmin->setMaximum(imsize[2]-1);
     spin_zmax->setMaximum(imsize[2]-1);
     spin_zmax->setValue(imsize[2]-1);
+  }
+  
+  // if (slicer->GetDimension() >3) {
+  //   spin_tmin->setMaximum(imsize[3]-1);
+  //   spin_tmax->setMaximum(imsize[3]-1);
+  //   spin_tmax->setValue(imsize[3]-1);
+  // }  
+  
+  // Connect
+  connect(xminSlider, SIGNAL(valueChanged(int)), this, SLOT(sliderXMinValueChanged(int)));
+  connect(xmaxSlider, SIGNAL(valueChanged(int)), this, SLOT(sliderXMaxValueChanged(int)));
+  connect(yminSlider, SIGNAL(valueChanged(int)), this, SLOT(sliderYMinValueChanged(int)));
+  connect(ymaxSlider, SIGNAL(valueChanged(int)), this, SLOT(sliderYMaxValueChanged(int)));
+  connect(zminSlider, SIGNAL(valueChanged(int)), this, SLOT(sliderZMinValueChanged(int)));
+  connect(zmaxSlider, SIGNAL(valueChanged(int)), this, SLOT(sliderZMaxValueChanged(int)));
+  // connect(tminSlider, SIGNAL(valueChanged(int)), this, SLOT(sliderTMinValueChanged(int)));
+  // connect(tmaxSlider, SIGNAL(valueChanged(int)), this, SLOT(sliderTMaxValueChanged(int)));
+  
+  //  connect(mIntensitySlider, SIGNAL(valueChanged(double)), this, SLOT(autoCropValueChanged(double)));
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolCropImage::autoCropValueChanged(double v) {
+  // DD(v);
+  //  vvImageToITKImageVector -> TODO a generic method
+  // then sliceriterator on each dimension from in to max
+  // ==> make a clitkGenericFilter even for the regular apply ...
 }
 //------------------------------------------------------------------------------
 
 
 //------------------------------------------------------------------------------
 void vvToolCropImage::apply() {
-  DD("apply");
-
-    QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
-    vvImage::Pointer mResult=vvImage::New();
-    //vvSlicerManager * current=mSlicerManagers[inputSequenceBox->currentIndex()];
-    vvImage::Pointer image= mCurrentSlicerManager->GetImage();
-    for (std::vector<vtkImageData*>::const_iterator i=image->GetVTKImages().begin();
-            i!=image->GetVTKImages().end();i++)
+
+  QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
+  vvImage::Pointer mResult=vvImage::New();
+  vvImage::Pointer image= mCurrentSlicerManager->GetImage();
+  for (std::vector<vtkImageData*>::const_iterator i=image->GetVTKImages().begin();
+       i!=image->GetVTKImages().end();i++)
     {
-        vtkSmartPointer<vtkImageClip> filter=vtkSmartPointer<vtkImageClip>::New();
-        ///Vtk is very weird, you need to "translate the extent" to get the correct origin
-        //http://markmail.org/message/vndc2tr6kcabiakp#query:vtkImageClip%20origin+page:1+mid:6na7y57floutklvz+state:results
-        vtkSmartPointer<vtkImageTranslateExtent> translate=vtkSmartPointer<vtkImageTranslateExtent>::New();
-        filter->SetInput(*i);
-        filter->SetOutputWholeExtent(xminSlider->value(),xmaxSlider->value(),
-                yminSlider->value(),ymaxSlider->value(),
-                zminSlider->value(),zmaxSlider->value());
-        translate->SetTranslation(-xminSlider->value(),-yminSlider->value(),-zminSlider->value());
-        translate->SetInput(filter->GetOutput());
-        filter->ClipDataOn(); //Really create a cropped copy of the image
-        translate->Update();
-        vtkImageData* output=vtkImageData::New();
-        output->ShallowCopy(translate->GetOutput());
-        mResult->AddImage(output);
+      vtkSmartPointer<vtkImageClip> filter=vtkSmartPointer<vtkImageClip>::New();
+      ///Vtk is very weird, you need to "translate the extent" to get the correct origin
+      //http://markmail.org/message/vndc2tr6kcabiakp#query:vtkImageClip%20origin+page:1+mid:6na7y57floutklvz+state:results
+      vtkSmartPointer<vtkImageTranslateExtent> translate=vtkSmartPointer<vtkImageTranslateExtent>::New();
+      filter->SetInput(*i);
+      filter->SetOutputWholeExtent(xminSlider->value(),xmaxSlider->value(),
+                                   yminSlider->value(),ymaxSlider->value(),
+                                   zminSlider->value(),zmaxSlider->value());
+      translate->SetTranslation(-xminSlider->value(),-yminSlider->value(),-zminSlider->value());
+      translate->SetInput(filter->GetOutput());
+      filter->ClipDataOn(); //Really create a cropped copy of the image
+      translate->Update();
+      vtkImageData* output=vtkImageData::New();
+      output->ShallowCopy(translate->GetOutput());
+      mResult->AddImage(output);
     }
-    QApplication::restoreOverrideCursor();
-
-  AddImage(mResult,"crop.mhd"); 
-
+  QApplication::restoreOverrideCursor();
+  std::ostringstream osstream;
+  osstream << "Crop_" << mCurrentSlicerManager->GetSlicer(0)->GetFileName() << ".mhd";
+  AddImage(mResult, osstream.str()); 
   close();
 }
 //------------------------------------------------------------------------------
index 42b85b7c73ae6efe0d32ff8703cee3b42d96fc98..ebd5b8311593a2a32717365d5944a25226f34d1d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   vv
   Module:    $RCSfile: vvToolCropImage.h,v $
   Language:  C++
-  Date:      $Date: 2010/03/01 07:37:25 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2010/03/01 15:38:09 $
+  Version:   $Revision: 1.3 $
   Author :   David Sarrut (david.sarrut@creatis.insa-lyon.fr)
 
   Copyright (C) 2010
@@ -51,7 +51,17 @@ class vvToolCropImage:
 
 public slots:
   virtual void apply();
-  void sliderMoved(int s);
+  virtual bool close();
+  virtual void reject();
+  void sliderXMinValueChanged(int s);
+  void sliderXMaxValueChanged(int s);
+  void sliderYMinValueChanged(int s);
+  void sliderYMaxValueChanged(int s);
+  void sliderZMinValueChanged(int s);
+  void sliderZMaxValueChanged(int s);
+  // void sliderTMinValueChanged(int s);
+  // void sliderTMaxValueChanged(int s);
+  void autoCropValueChanged(double v);
 
   //-----------------------------------------------------
   static void Initialize() {
@@ -64,6 +74,9 @@ public slots:
  protected:
   Ui::vvToolCropImage ui;
   int * mReducedExtent;
+  int * mInitialExtent;
+  int mExtentSize;
+  void UpdateExtent();
 
 }; // end class vvToolCropImage
 //------------------------------------------------------------------------------
index 217b53be2340c3f615f00eab5ea07673dca06829..482c2410909d906ef230cd88de57b1a93a5e3133 100644 (file)
@@ -3,8 +3,8 @@
   Program:   vv
   Module:    $RCSfile: vvToolInputSelectorWidget.cxx,v $
   Language:  C++
-  Date:      $Date: 2010/02/24 11:42:42 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2010/03/01 15:38:09 $
+  Version:   $Revision: 1.3 $
   Author :   David Sarrut (david.sarrut@creatis.insa-lyon.fr)
 
   Copyright (C) 2010
@@ -67,13 +67,6 @@ void vvToolInputSelectorWidget::Initialize(std::vector<vvSlicerManager*> l, int
 //------------------------------------------------------------------------------
 
 
-//------------------------------------------------------------------------------
-void vvToolInputSelectorWidget::SetToolTip(QString s) {
-  setToolTip(s);
-}
-//------------------------------------------------------------------------------
-
-
 //------------------------------------------------------------------------------
 void vvToolInputSelectorWidget::accept() {
   mInputSelectionButtonBox->setEnabled(false);
index 0c02651c9a65cbedc832d4fd00d7ea28643da3ad..80a6bde6d49875deacf733ad711b98b94c75e1c4 100644 (file)
@@ -3,8 +3,8 @@
   Program:   vv
   Module:    $RCSfile: vvToolInputSelectorWidget.h,v $
   Language:  C++
-  Date:      $Date: 2010/02/24 11:42:42 $
-  Version:   $Revision: 1.3 $
+  Date:      $Date: 2010/03/01 15:38:09 $
+  Version:   $Revision: 1.4 $
   Author :   David Sarrut (david.sarrut@creatis.insa-lyon.fr)
 
   Copyright (C) 2010
@@ -45,7 +45,6 @@ class vvToolInputSelectorWidget: public QWidget, private Ui::vvToolInputSelector
   
   void Initialize(std::vector<vvSlicerManager*> l, int index);
   int GetSelectedInputIndex() { return mCurrentIndex; }
-  void SetToolTip(QString s);
 
  public slots:
   void accept();
index c853c751a81c3d18dd83145c2d97b19fd9474eb9..080e29857e45e999aedd82a415f9c30c0aee7323 100644 (file)
@@ -3,8 +3,8 @@
   Program:   vv
   Module:    $RCSfile: vvToolWidgetBase.cxx,v $
   Language:  C++
-  Date:      $Date: 2010/02/24 11:43:37 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2010/03/01 15:38:09 $
+  Version:   $Revision: 1.2 $
   Author :   David Sarrut (david.sarrut@creatis.insa-lyon.fr)
 
   Copyright (C) 2008
@@ -96,7 +96,7 @@ void vvToolWidgetBase::AnImageIsBeingClosed(vvSlicerManager * m) {
 void vvToolWidgetBase::InitializeInputs() {
   if (mFilter) {
     int j=0;
-    mToolInputSelectionWidget->SetToolTip(QString("%1").arg(mFilter->GetAvailableImageTypes().c_str()));
+    mToolInputSelectionWidget->setToolTip(QString("%1").arg(mFilter->GetAvailableImageTypes().c_str()));
     for(unsigned int i=0; i<mMainWindowBase->GetSlicerManagers().size(); i++) {
       vvImage * s = mMainWindowBase->GetSlicerManagers()[i]->GetImage();
       if (mFilter->CheckImageType(s->GetNumberOfDimensions(), 
@@ -124,6 +124,7 @@ void vvToolWidgetBase::InputIsSelected() {
   // Common
   int index = mToolInputSelectionWidget->GetSelectedInputIndex();
   mCurrentSlicerManager = mSlicerManagersCompatible[index];
+  mCurrentImage = mCurrentSlicerManager->GetImage();
   mToolWidget->setEnabled(true);
   if (!mCurrentSlicerManager) close();
   InputIsSelected(mCurrentSlicerManager);