13 #ifndef mitkFileWriter_h
14 #define mitkFileWriter_h
17 #include <itkProcessObject.h>
34 virtual const char *GetFileName()
const = 0;
40 virtual void SetFileName(
const char *aFileName) = 0;
47 virtual const char *GetFilePrefix()
const = 0;
54 virtual void SetFilePrefix(
const char *aFilePrefix) = 0;
62 virtual const char *GetFilePattern()
const = 0;
70 virtual void SetFilePattern(
const char *aFilePattern) = 0;
74 virtual std::string GetFileExtension();
78 bool IsExtensionValid(std::string extension);
82 virtual std::vector<std::string> GetPossibleFileExtensions() = 0;
86 virtual std::string GetPossibleFileExtensionsAsString();
91 virtual bool CanWriteDataType(
DataNode *);
95 virtual std::string GetWritenMIMEType();
97 virtual std::string GetSupportedBaseData()
const = 0;
99 using ProcessObject::SetInput;
102 virtual void Write() = 0;
107 virtual bool CanWriteToMemory();
112 virtual void SetWriteToMemory(
bool write);
113 virtual bool GetWriteToMemory();
118 virtual const char *GetMemoryPointer();
123 virtual unsigned int GetMemorySize();
128 virtual void ReleaseMemory();
140 #define mitkWriterMacro \
142 virtual void Write() override \
145 if (this->GetInput() == nullptr) \
148 itkExceptionMacro(<< "Write:Please specify an input!"); \
152 this->UpdateOutputInformation(); \
153 (*(this->GetInputs().begin()))->SetRequestedRegionToLargestPossibleRegion(); \
154 this->PropagateRequestedRegion(nullptr); \
155 this->UpdateOutputData(nullptr); \
158 virtual void Update() override { Write(); }