]> Creatis software - clitk.git/blobdiff - common/clitkImageToImageGenericFilterBase.h
ostream does not handle std::string (check http://www.cplusplus.com/reference/iostrea...
[clitk.git] / common / clitkImageToImageGenericFilterBase.h
index 2d624baecef67ecb87d25124528c9c4f5940f09f..280dd6569a4ce25c622339c25a3a5f85fcff1b08 100644 (file)
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
 ======================================================================-====*/
+
 #ifndef CLITKIMAGETOIMAGEGENERICFILTERBASE_H
 #define CLITKIMAGETOIMAGEGENERICFILTERBASE_H
 
 // clitk 
-#include "clitkCommon.h"
 #include "clitkImageCommon.h"
 #include "clitkCommonGenericFilter.h"
+#include "clitkFilterBase.h"
 
 // itk 
 #include <itkImage.h>
@@ -52,15 +53,14 @@ namespace clitk {
     void SetFilterName(std::string & n);
     
     // Error management
-    itkSetMacro(LastError, std::string);
-    itkGetConstMacro(LastError, std::string);
-    bool HasError() { return (GetLastError() != ""); }
+    // itkSetMacro(LastError, std::string);
+    // itkGetConstMacro(LastError, std::string);
+    // bool HasError() { return (GetLastError() != ""); }
 
     // Generic IO
     /// Returns the dimension and pixel type of the *first* input
     void GetInputImageDimensionAndPixelType(unsigned int& dim, std::string& pixeltype,
                                             unsigned int & components);
-
     // File IO
     void SetInputFilename(const std::string & filename);
     void AddInputFilename(const std::string & filename);
@@ -89,6 +89,16 @@ namespace clitk {
     // Main function to call for using the filter. 
     virtual bool Update() = 0;
 
+    // Get the associated filter
+    FilterBase * GetFilterBase() { return m_FilterBase; }
+    
+    // Indicate that the filter must stop as soon as possible (if threaded)
+    // void MustStop();
+    void DeleteLastOutputImage();
+    // itkSetMacro(StopOnError, bool);
+    // itkGetConstMacro(StopOnError, bool);
+    // itkBooleanMacro(StopOnError);    
+
   protected:  
     bool m_ReadOnDisk;
     /// Call this function to dispatch an output towards the correct sink
@@ -115,7 +125,10 @@ namespace clitk {
     void SetImageTypeError();
     bool m_FailOnImageTypeError;
     
-    std::string m_LastError;
+    // std::string m_LastError;
+    void SetFilterBase(FilterBase * f) { m_FilterBase = f; }
+    FilterBase * m_FilterBase;
+    // bool m_StopOnError;
 
   }; // end class clitk::ImageToImageGenericFilter