]> Creatis software - clitk.git/commitdiff
Smart pointer for filter in vv tools
authorsrit <srit>
Fri, 15 Apr 2011 08:29:19 +0000 (08:29 +0000)
committersrit <srit>
Fri, 15 Apr 2011 08:29:19 +0000 (08:29 +0000)
tools/clitkBinarizeImageGenericFilter.h
vv/vvToolMIP.cxx
vv/vvToolWidgetBase.h

index db8956c01cd7df9dcc508f5ed6b43e2906104291..fb5df78412fdef73a696232547a6f8a9d15ef1f4 100644 (file)
@@ -32,10 +32,6 @@ namespace clitk
   {
     
   public:
-
-    //--------------------------------------------------------------------
-    BinarizeImageGenericFilter();
-
     //--------------------------------------------------------------------
     typedef BinarizeImageGenericFilter         Self;
     typedef itk::SmartPointer<Self>            Pointer;
@@ -57,6 +53,7 @@ namespace clitk
     void UpdateWithInputImageType();
 
   protected:
+    BinarizeImageGenericFilter();
     template<unsigned int Dim> void InitializeImageType();
     args_info_type mArgsInfo;
     
index cfa338f63028d65ad605eff8659095ee04b61b69..f23bfd484cd840a1543b9131968c0e0b5eb04355 100644 (file)
@@ -3,8 +3,8 @@
   Program:   vv
   Module:    $RCSfile: vvToolMIP.cxx,v $
   Language:  C++
-  Date:      $Date: 2011/03/22 15:50:39 $
-  Version:   $Revision: 1.2 $
+  Date:      $Date: 2011/04/15 08:29:21 $
+  Version:   $Revision: 1.3 $
   Author :   Bharath Navalpakkam (Bharath.Navalpakkam@creatis.insa-lyon.fr)
 
   Copyright (C) 2010
@@ -61,7 +61,6 @@ vvToolMIP::vvToolMIP(vvMainWindowBase * parent, Qt::WindowFlags f)
 //------------------------------------------------------------------------------
 vvToolMIP::~vvToolMIP()
 {
-  delete mFilter;
 }
 //------------------------------------------------------------------------------
 void vvToolMIP::Initialize()
@@ -83,7 +82,7 @@ void vvToolMIP::apply()
   cmdline_parser_clitkMIP_init(&args_info);
   args_info.dimension_arg=this->dimensionSpinBox->value();
   args_info.dimension_given=true;
-  clitk::MIPGenericFilter* filter= dynamic_cast<clitk::MIPGenericFilter*>(mFilter);
+  clitk::MIPGenericFilter* filter= dynamic_cast<clitk::MIPGenericFilter*>(mFilter.GetPointer());
   filter->SetArgsInfo(args_info);
   filter->SetInputVVImage(mCurrentImage);
   filter->Update();
index 2c3ddd99a2fc54261b95a595a3c743f9807d9dd0..096130eb4bec48cbb588257f75df8a5a519a39ce 100644 (file)
@@ -60,7 +60,7 @@ protected:
   virtual void Initialization();
   void InitializeInputs();
   Ui::vvToolWidgetBase ui;
-  clitk::ImageToImageGenericFilterBase * mFilter;
+  clitk::ImageToImageGenericFilterBase::Pointer mFilter;
   vvMainWindowBase * mMainWindow;
   std::vector<vvSlicerManager*> mSlicerManagersCompatible;
   vvSlicerManager * mCurrentSlicerManager;