Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::ImageWriter Class Reference

Writer for mitk::Image. More...

#include <mitkImageWriter.h>

Inheritance diagram for mitk::ImageWriter:
Collaboration diagram for mitk::ImageWriter:

Public Member Functions

 mitkClassMacro (ImageWriter, mitk::FileWriter)
 
Pointer Clone () const
 
virtual void SetFileName (const char *fileName) override
 
virtual void SetFileName (const std::string &fileName)
 
virtual const char * GetFileName () const
 
virtual void SetExtension (const char *extension)
 Explicitly set the extension to be added to the filename. More...
 
virtual void SetExtension (const std::string &extension)
 
virtual const char * GetExtension () const
 Get the extension to be added to the filename. More...
 
void SetDefaultExtension ()
 Set the extension to be added to the filename to the default. More...
 
virtual void SetFilePrefix (const char *_arg)
 
virtual const char * GetFilePrefix () const
 
virtual void SetFilePattern (const char *_arg)
 
virtual const char * GetFilePattern () const
 
void SetInput (mitk::Image *input)
 
virtual std::vector< std::string > GetPossibleFileExtensions () override
 Return the possible file extensions for the data type associated with the writer. More...
 
virtual std::string GetSupportedBaseData () const override
 
virtual std::string GetFileExtension () override
 Return the extension to be added to the filename. More...
 
virtual bool CanWriteDataType (DataNode *) override
 Check if the Writer can write the Content of the. More...
 
virtual std::string GetWritenMIMEType () override
 Return the MimeType of the saved File. More...
 
virtual void SetInput (DataNode *)
 Set the DataTreenode as Input. Important: The Writer always have a SetInput-Function. More...
 
const mitk::ImageGetInput ()
 
virtual const char * GetDefaultFilename () override
 
virtual const char * GetFileDialogPattern () override
 
virtual const char * GetDefaultExtension () override
 
virtual bool CanWriteBaseDataType (BaseData::Pointer data) override
 
virtual void DoWrite (BaseData::Pointer data) override
 
void SetUseCompression (bool useCompression)
 
- Public Member Functions inherited from mitk::FileWriterWithInformation
virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
- Public Member Functions inherited from mitk::FileWriter
bool IsExtensionValid (std::string extension)
 Checks if given extension is valid for file writer. More...
 
virtual std::string GetPossibleFileExtensionsAsString ()
 possible file extensions for the data type associated with the writer as string More...
 
void SetInput (BaseData *data)
 
virtual void Write ()=0
 
virtual bool CanWriteToMemory ()
 Specifies, whether the file writer also can write a file to a memory buffer. More...
 
virtual void SetWriteToMemory (bool write)
 Set/Get functions to advise the file writer to use tis internal memory array as file writing destination. More...
 
virtual bool GetWriteToMemory ()
 
virtual const char * GetMemoryPointer ()
 To be used along with a call of SetWriteToMemory(true). This returns the memory buffer where the file was written. More...
 
virtual unsigned int GetMemorySize ()
 To be used along with a call of SetWriteToMemory(true). This returns the size of the memory buffer where the file was written. More...
 
virtual void ReleaseMemory ()
 CAUTION: It's up to the user to call this function to release the memory buffer after use in case the file writer has written to its memory array. More...
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from mitk::FileWriterWithInformation
static const char * GetStaticNameOfClass ()
 
- Static Public Member Functions inherited from mitk::FileWriter
static const char * GetStaticNameOfClass ()
 

Public Attributes

 mitkWriterMacro
 

Protected Member Functions

 ImageWriter ()
 
virtual ~ImageWriter ()
 
virtual void GenerateData () override
 
virtual void WriteByITK (mitk::Image *image, const std::string &fileName)
 
- Protected Member Functions inherited from mitk::FileWriter
 FileWriter ()
 
virtual ~FileWriter ()
 

Protected Attributes

std::string m_FileName
 
std::string m_FileNameWithoutExtension
 
std::string m_FilePrefix
 
std::string m_FilePattern
 
std::string m_Extension
 
std::string m_MimeType
 
bool m_UseCompression
 
- Protected Attributes inherited from mitk::FileWriter
bool m_CanWriteToMemory
 
bool m_WriteToMemory
 
char * m_MemoryBuffer
 
unsigned int m_MemoryBufferSize
 

Additional Inherited Members

- Public Types inherited from mitk::FileWriterWithInformation
typedef FileWriterWithInformation Self
 
typedef FileWriter Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
- Public Types inherited from mitk::FileWriter
typedef FileWriter Self
 
typedef itk::ProcessObject Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 

Detailed Description

Writer for mitk::Image.

Uses the given extension (SetExtension) to decide the format to write (.mhd is default, .pic, .tif, .png, .jpg supported yet).

Deprecated:
(as of 2014_10) Use mitk::IOUtils or mitk::FileWriterRegistry instead.

Definition at line 34 of file mitkImageWriter.h.

Constructor & Destructor Documentation

mitk::ImageWriter::ImageWriter ( )
protected

Constructor.

Definition at line 29 of file mitkImageWriter.cpp.

References m_MimeType, and SetDefaultExtension().

mitk::ImageWriter::~ImageWriter ( )
protectedvirtual

Virtual destructor.

Definition at line 36 of file mitkImageWriter.cpp.

Member Function Documentation

bool mitk::ImageWriter::CanWriteBaseDataType ( BaseData::Pointer  data)
overridevirtual

Implements mitk::FileWriterWithInformation.

Definition at line 463 of file mitkImageWriter.cpp.

bool mitk::ImageWriter::CanWriteDataType ( DataNode input)
overridevirtual

Check if the Writer can write the Content of the.

Reimplemented from mitk::FileWriter.

Definition at line 361 of file mitkImageWriter.cpp.

References mitk::DataNode::GetData().

Pointer mitk::ImageWriter::Clone ( ) const
void mitk::ImageWriter::DoWrite ( BaseData::Pointer  data)
overridevirtual

Implements mitk::FileWriterWithInformation.

Definition at line 468 of file mitkImageWriter.cpp.

References Update().

void mitk::ImageWriter::GenerateData ( )
overrideprotectedvirtual
const char * mitk::ImageWriter::GetDefaultExtension ( )
overridevirtual

Implements mitk::FileWriterWithInformation.

Definition at line 458 of file mitkImageWriter.cpp.

const char * mitk::ImageWriter::GetDefaultFilename ( )
overridevirtual

Implements mitk::FileWriterWithInformation.

Definition at line 440 of file mitkImageWriter.cpp.

virtual const char* mitk::ImageWriter::GetExtension ( ) const
virtual

Get the extension to be added to the filename.

Returns
the extension to be added to the filename (e.g., ".mhd").
const char * mitk::ImageWriter::GetFileDialogPattern ( )
overridevirtual

Implements mitk::FileWriterWithInformation.

Definition at line 445 of file mitkImageWriter.cpp.

std::string mitk::ImageWriter::GetFileExtension ( )
overridevirtual

Return the extension to be added to the filename.

Reimplemented from mitk::FileWriter.

Definition at line 418 of file mitkImageWriter.cpp.

virtual const char* mitk::ImageWriter::GetFileName ( ) const
virtual
Returns
the name of the file to be written to disk.

Implements mitk::FileWriter.

virtual const char* mitk::ImageWriter::GetFilePattern ( ) const
virtual
Warning
multiple write not (yet) supported

Implements mitk::FileWriter.

virtual const char* mitk::ImageWriter::GetFilePrefix ( ) const
virtual
Warning
multiple write not (yet) supported

Implements mitk::FileWriter.

const mitk::Image * mitk::ImageWriter::GetInput ( void  )
Returns
the 0'th input object of the filter.

Definition at line 428 of file mitkImageWriter.cpp.

std::vector< std::string > mitk::ImageWriter::GetPossibleFileExtensions ( )
overridevirtual

Return the possible file extensions for the data type associated with the writer.

Implements mitk::FileWriter.

Definition at line 381 of file mitkImageWriter.cpp.

std::string mitk::ImageWriter::GetSupportedBaseData ( ) const
overridevirtual

Implements mitk::FileWriter.

Definition at line 413 of file mitkImageWriter.cpp.

References mitk::Image::GetStaticNameOfClass().

std::string mitk::ImageWriter::GetWritenMIMEType ( )
overridevirtual

Return the MimeType of the saved File.

Reimplemented from mitk::FileWriter.

Definition at line 376 of file mitkImageWriter.cpp.

mitk::ImageWriter::mitkClassMacro ( ImageWriter  ,
mitk::FileWriter   
)
static Pointer mitk::ImageWriter::New ( )
static
void mitk::ImageWriter::SetDefaultExtension ( )

Set the extension to be added to the filename to the default.

Definition at line 100 of file mitkImageWriter.cpp.

Referenced by ImageWriter().

void mitk::ImageWriter::SetExtension ( const char *  extension)
virtual

Explicitly set the extension to be added to the filename.

Parameters
_argto be added to the filename, including a "." (e.g., ".mhd").

Definition at line 76 of file mitkImageWriter.cpp.

void mitk::ImageWriter::SetExtension ( const std::string &  extension)
virtual

Definition at line 95 of file mitkImageWriter.cpp.

void mitk::ImageWriter::SetFileName ( const char *  fileName)
overridevirtual

Sets the filename of the file to write.

Parameters
_argthe name of the file to write.

Implements mitk::FileWriter.

Definition at line 40 of file mitkImageWriter.cpp.

void mitk::ImageWriter::SetFileName ( const std::string &  fileName)
virtual

Definition at line 71 of file mitkImageWriter.cpp.

virtual void mitk::ImageWriter::SetFilePattern ( const char *  _arg)
virtual
Warning
multiple write not (yet) supported

Implements mitk::FileWriter.

virtual void mitk::ImageWriter::SetFilePrefix ( const char *  _arg)
virtual
Warning
multiple write not (yet) supported

Implements mitk::FileWriter.

void mitk::ImageWriter::SetInput ( mitk::Image input)

Sets the 0'th input object for the filter.

Parameters
inputthe first input for the filter.

Definition at line 423 of file mitkImageWriter.cpp.

void mitk::ImageWriter::SetInput ( DataNode input)
virtual

Set the DataTreenode as Input. Important: The Writer always have a SetInput-Function.

Definition at line 370 of file mitkImageWriter.cpp.

References mitk::DataNode::GetData().

void mitk::ImageWriter::SetUseCompression ( bool  useCompression)

Definition at line 477 of file mitkImageWriter.cpp.

Member Data Documentation

std::string mitk::ImageWriter::m_Extension
protected

Definition at line 165 of file mitkImageWriter.h.

std::string mitk::ImageWriter::m_FileName
protected

Definition at line 157 of file mitkImageWriter.h.

std::string mitk::ImageWriter::m_FileNameWithoutExtension
protected

Definition at line 159 of file mitkImageWriter.h.

std::string mitk::ImageWriter::m_FilePattern
protected

Definition at line 163 of file mitkImageWriter.h.

std::string mitk::ImageWriter::m_FilePrefix
protected

Definition at line 161 of file mitkImageWriter.h.

std::string mitk::ImageWriter::m_MimeType
protected

Definition at line 167 of file mitkImageWriter.h.

Referenced by ImageWriter().

bool mitk::ImageWriter::m_UseCompression
protected

Definition at line 169 of file mitkImageWriter.h.

mitk::ImageWriter::mitkWriterMacro

Definition at line 41 of file mitkImageWriter.h.


The documentation for this class was generated from the following files: