X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkImageToImageGenericFilterBase.h;h=aa6190460139eca75b851030b2d3d22938b6de97;hb=2136379e8e3cd0010b909a2a7ef2580559cc3ead;hp=2d624baecef67ecb87d25124528c9c4f5940f09f;hpb=28a696a732734608d0c32608c80c890a164872c4;p=clitk.git diff --git a/common/clitkImageToImageGenericFilterBase.h b/common/clitkImageToImageGenericFilterBase.h index 2d624ba..aa61904 100644 --- a/common/clitkImageToImageGenericFilterBase.h +++ b/common/clitkImageToImageGenericFilterBase.h @@ -15,6 +15,7 @@ - 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 @@ -22,6 +23,7 @@ #include "clitkCommon.h" #include "clitkImageCommon.h" #include "clitkCommonGenericFilter.h" +#include "clitkFilterBase.h" // itk #include @@ -60,7 +62,6 @@ namespace clitk { /// 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 +90,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 @@ -116,6 +127,9 @@ namespace clitk { bool m_FailOnImageTypeError; std::string m_LastError; + void SetFilterBase(FilterBase * f) { m_FilterBase = f; } + FilterBase * m_FilterBase; + bool m_StopOnError; }; // end class clitk::ImageToImageGenericFilter