- 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>
const std::string & GetFilterName();
void SetFilterName(std::string & n);
- // Error management
- 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);
void SetInputFilenames(const std::vector<std::string> & filenames);
void EnableReadOnDisk(bool b);
+ void EnableWriteOnDisk(bool b);
void SetOutputFilename(const std::string & filename);
- void AddOutputFilename(const std::string & filename);
+ void AddOutputFilename(const std::string filename);
void SetOutputFilenames(const std::vector<std::string> & filenames);
std::string GetOutputFilename();
void SetIOVerbose(bool b);
// 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 DeleteLastOutputImage();
+
protected:
bool m_ReadOnDisk;
+ bool m_WriteOnDisk;
/// Call this function to dispatch an output towards the correct sink
template<class ImageType>
void SetNextOutput(typename ImageType::Pointer output);
std::vector<std::string> m_InputFilenames;
std::list<std::string> m_OutputFilenames;
-
+
bool m_IOVerbose;
unsigned int m_Dim;
std::string m_PixelTypeName;
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