Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkImageWriter.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef _MITK_IMAGE_WRITER__H_
14 #define _MITK_IMAGE_WRITER__H_
15 
16 #include <MitkLegacyIOExports.h>
18 
19 namespace mitk
20 {
21  class Image;
31  {
32  public:
34 
35  itkFactorylessNewMacro(Self);
36 
37  itkCloneMacro(Self);
38 
40 
45  void SetFileName(const char *fileName) override;
46  virtual void SetFileName(const std::string &fileName);
47 
51  itkGetStringMacro(FileName);
52 
58  virtual void SetExtension(const char *extension);
59  virtual void SetExtension(const std::string &extension);
60 
66  itkGetStringMacro(Extension);
67 
71  void SetDefaultExtension();
72 
76  itkSetStringMacro(FilePrefix);
77 
81  itkGetStringMacro(FilePrefix);
82 
86  itkSetStringMacro(FilePattern);
87 
91  itkGetStringMacro(FilePattern);
92 
97  void SetInput(mitk::Image *input);
98 
99  //##Documentation
100  //## @brief Return the possible file extensions for the data type associated with the writer
101  std::vector<std::string> GetPossibleFileExtensions() override;
102 
103  std::string GetSupportedBaseData() const override;
104 
108  std::string GetFileExtension() override;
109 
113  bool CanWriteDataType(DataNode *) override;
114 
118  std::string GetWritenMIMEType() override;
119 
120  using Superclass::SetInput;
124  virtual void SetInput(DataNode *);
125 
129  const mitk::Image *GetInput();
130 
131  // FileWriterWithInformation methods
132  const char *GetDefaultFilename() override;
133  const char *GetFileDialogPattern() override;
134  const char *GetDefaultExtension() override;
135  bool CanWriteBaseDataType(BaseData::Pointer data) override;
136  void DoWrite(BaseData::Pointer data) override;
137 
138  void SetUseCompression(bool useCompression);
139 
140  protected:
144  ImageWriter();
145 
149  ~ImageWriter() override;
150 
151  void GenerateData() override;
152 
153  virtual void WriteByITK(mitk::Image *image, const std::string &fileName);
154 
155  std::string m_FileName;
156 
158 
159  std::string m_FilePrefix;
160 
161  std::string m_FilePattern;
162 
163  std::string m_Extension;
164 
165  std::string m_MimeType;
166 
168  };
169 }
170 
171 #endif //_MITK_IMAGE_WRITER__H_
#define MITKLEGACYIO_EXPORT
std::string m_FilePattern
DataCollection - Class to facilitate loading/accessing structured data.
Interface for FileWriters with extra information. Should be merged into FileWriter.
std::string m_MimeType
Writer for mitk::Image.
class ITK_EXPORT Image
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Image class for storing images.
Definition: mitkImage.h:72
Interface class of writers that write data to files.
mitk::Image::Pointer image
std::string m_FileName
std::string m_FileNameWithoutExtension
std::string m_FilePrefix
std::string m_Extension
Class for nodes of the DataTree.
Definition: mitkDataNode.h:57