Medical Imaging Interaction Toolkit  2018.4.99-6a3ea89d
Medical Imaging Interaction Toolkit
mitk::FileWriter Class Referenceabstract

Interface class of writers that write data to files. More...

#include <mitkFileWriter.h>

Inheritance diagram for mitk::FileWriter:
Collaboration diagram for mitk::FileWriter:

Public Types

typedef FileWriter Self
 
typedef itk::ProcessObject Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 

Public Member Functions

virtual std::vector< std::string > GetClassHierarchy () const
 
virtual const char * GetClassName () const
 
virtual const char * GetFileName () const =0
 Get the specified the file to write. More...
 
virtual void SetFileName (const char *aFileName)=0
 Specify the file to write. More...
 
virtual const char * GetFilePrefix () const =0
 Get the specified file prefix for the file(s) to write. More...
 
virtual void SetFilePrefix (const char *aFilePrefix)=0
 Specify file prefix for the file(s) to write. More...
 
virtual const char * GetFilePattern () const =0
 Get the specified file pattern for the file(s) to write. The sprintf format used to build filename from FilePrefix and number. More...
 
virtual void SetFilePattern (const char *aFilePattern)=0
 Specified file pattern for the file(s) to write. The sprintf format used to build filename from FilePrefix and number. More...
 
virtual std::string GetFileExtension ()
 Return the extension to be added to the filename. More...
 
bool IsExtensionValid (std::string extension)
 Checks if given extension is valid for file writer. More...
 
virtual std::vector< std::string > GetPossibleFileExtensions ()=0
 Return the possible file extensions for the data type associated with the writer. More...
 
virtual std::string GetPossibleFileExtensionsAsString ()
 possible file extensions for the data type associated with the writer as string More...
 
virtual bool CanWriteDataType (DataNode *)
 Check if the Writer can write this type of data of the DataTreenode. More...
 
virtual std::string GetWritenMIMEType ()
 Return the MimeType of the saved File. More...
 
virtual std::string GetSupportedBaseData () const =0
 
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 const char * GetStaticNameOfClass ()
 

Protected Member Functions

 FileWriter ()
 
 ~FileWriter () override
 

Protected Attributes

bool m_CanWriteToMemory
 
bool m_WriteToMemory
 
char * m_MemoryBuffer
 
unsigned int m_MemoryBufferSize
 

Detailed Description

Interface class of writers that write data to files.

Deprecated:
(as of 2014_10) Use mitk::IFileWriter instead.

Definition at line 26 of file mitkFileWriter.h.

Member Typedef Documentation

◆ ConstPointer

Definition at line 29 of file mitkFileWriter.h.

◆ Pointer

Definition at line 29 of file mitkFileWriter.h.

◆ Self

Definition at line 29 of file mitkFileWriter.h.

◆ Superclass

typedef itk::ProcessObject mitk::FileWriter::Superclass

Definition at line 29 of file mitkFileWriter.h.

Constructor & Destructor Documentation

◆ FileWriter()

mitk::FileWriter::FileWriter ( )
protected

Definition at line 61 of file mitkFileWriter.cpp.

◆ ~FileWriter()

mitk::FileWriter::~FileWriter ( )
overrideprotected

Definition at line 65 of file mitkFileWriter.cpp.

Member Function Documentation

◆ CanWriteDataType()

bool mitk::FileWriter::CanWriteDataType ( DataNode node)
virtual

Check if the Writer can write this type of data of the DataTreenode.

Reimplemented in mitk::SurfaceVtkWriter< VTKWRITER >, mitk::PointSetWriter, and mitk::ImageWriter.

Definition at line 15 of file mitkFileWriter.cpp.

References mitk::DataNode::GetData(), and GetSupportedBaseData().

◆ CanWriteToMemory()

bool mitk::FileWriter::CanWriteToMemory ( )
virtual

Specifies, whether the file writer also can write a file to a memory buffer.

Definition at line 69 of file mitkFileWriter.cpp.

References m_CanWriteToMemory.

◆ GetClassHierarchy()

virtual std::vector<std::string> mitk::FileWriter::GetClassHierarchy ( ) const
inlinevirtual

Reimplemented in mitk::FileWriterWithInformation.

Definition at line 29 of file mitkFileWriter.h.

◆ GetClassName()

virtual const char* mitk::FileWriter::GetClassName ( ) const
virtual

◆ GetFileExtension()

std::string mitk::FileWriter::GetFileExtension ( )
virtual

Return the extension to be added to the filename.

Reimplemented in mitk::SurfaceVtkWriter< VTKWRITER >, mitk::PointSetWriter, and mitk::ImageWriter.

Definition at line 33 of file mitkFileWriter.cpp.

◆ GetFileName()

virtual const char* mitk::FileWriter::GetFileName ( ) const
pure virtual

Get the specified the file to write.

Either the FileName or FilePrefix plus FilePattern are used to write.

Implemented in mitk::SurfaceVtkWriter< VTKWRITER >, mitk::PointSetWriter, and mitk::ImageWriter.

◆ GetFilePattern()

virtual const char* mitk::FileWriter::GetFilePattern ( ) const
pure virtual

Get the specified file pattern for the file(s) to write. The sprintf format used to build filename from FilePrefix and number.

You should specify either a FileName or FilePrefix. Use FilePrefix if the data is stored in multiple files.

Implemented in mitk::SurfaceVtkWriter< VTKWRITER >, mitk::ImageWriter, and mitk::PointSetWriter.

◆ GetFilePrefix()

virtual const char* mitk::FileWriter::GetFilePrefix ( ) const
pure virtual

Get the specified file prefix for the file(s) to write.

You should specify either a FileName or FilePrefix. Use FilePrefix if the data is stored in multiple files.

Implemented in mitk::SurfaceVtkWriter< VTKWRITER >, mitk::ImageWriter, and mitk::PointSetWriter.

◆ GetMemoryPointer()

const char * mitk::FileWriter::GetMemoryPointer ( )
virtual

To be used along with a call of SetWriteToMemory(true). This returns the memory buffer where the file was written.

Definition at line 81 of file mitkFileWriter.cpp.

References m_MemoryBuffer.

◆ GetMemorySize()

unsigned int mitk::FileWriter::GetMemorySize ( )
virtual

To be used along with a call of SetWriteToMemory(true). This returns the size of the memory buffer where the file was written.

Definition at line 85 of file mitkFileWriter.cpp.

References m_MemoryBufferSize.

◆ GetPossibleFileExtensions()

virtual std::vector<std::string> mitk::FileWriter::GetPossibleFileExtensions ( )
pure virtual

◆ GetPossibleFileExtensionsAsString()

std::string mitk::FileWriter::GetPossibleFileExtensionsAsString ( )
virtual

possible file extensions for the data type associated with the writer as string

Definition at line 38 of file mitkFileWriter.cpp.

References GetPossibleFileExtensions().

◆ GetStaticNameOfClass()

static const char* mitk::FileWriter::GetStaticNameOfClass ( )
inlinestatic

Definition at line 29 of file mitkFileWriter.h.

◆ GetSupportedBaseData()

virtual std::string mitk::FileWriter::GetSupportedBaseData ( ) const
pure virtual

◆ GetWritenMIMEType()

std::string mitk::FileWriter::GetWritenMIMEType ( )
virtual

Return the MimeType of the saved File.

Reimplemented in mitk::SurfaceVtkWriter< VTKWRITER >, mitk::PointSetWriter, and mitk::ImageWriter.

Definition at line 23 of file mitkFileWriter.cpp.

◆ GetWriteToMemory()

bool mitk::FileWriter::GetWriteToMemory ( )
virtual

Definition at line 77 of file mitkFileWriter.cpp.

References m_WriteToMemory.

◆ IsExtensionValid()

bool mitk::FileWriter::IsExtensionValid ( std::string  extension)

Checks if given extension is valid for file writer.

Definition at line 50 of file mitkFileWriter.cpp.

References GetPossibleFileExtensions().

◆ ReleaseMemory()

void mitk::FileWriter::ReleaseMemory ( )
virtual

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.

Definition at line 89 of file mitkFileWriter.cpp.

◆ SetFileName()

virtual void mitk::FileWriter::SetFileName ( const char *  aFileName)
pure virtual

Specify the file to write.

Either the FileName or FilePrefix plus FilePattern are used to write.

Implemented in mitk::SurfaceVtkWriter< VTKWRITER >, mitk::PointSetWriter, and mitk::ImageWriter.

◆ SetFilePattern()

virtual void mitk::FileWriter::SetFilePattern ( const char *  aFilePattern)
pure virtual

Specified file pattern for the file(s) to write. The sprintf format used to build filename from FilePrefix and number.

You should specify either a FileName or FilePrefix. Use FilePrefix if the data is stored in multiple files.

Implemented in mitk::SurfaceVtkWriter< VTKWRITER >, mitk::ImageWriter, and mitk::PointSetWriter.

◆ SetFilePrefix()

virtual void mitk::FileWriter::SetFilePrefix ( const char *  aFilePrefix)
pure virtual

Specify file prefix for the file(s) to write.

You should specify either a FileName or FilePrefix. Use FilePrefix if the data is stored in multiple files.

Implemented in mitk::SurfaceVtkWriter< VTKWRITER >, mitk::ImageWriter, and mitk::PointSetWriter.

◆ SetInput()

void mitk::FileWriter::SetInput ( mitk::BaseData data)

Definition at line 28 of file mitkFileWriter.cpp.

◆ SetWriteToMemory()

void mitk::FileWriter::SetWriteToMemory ( bool  write)
virtual

Set/Get functions to advise the file writer to use tis internal memory array as file writing destination.

Definition at line 73 of file mitkFileWriter.cpp.

References m_WriteToMemory.

◆ Write()

virtual void mitk::FileWriter::Write ( )
pure virtual

Member Data Documentation

◆ m_CanWriteToMemory

bool mitk::FileWriter::m_CanWriteToMemory
protected

Definition at line 134 of file mitkFileWriter.h.

Referenced by CanWriteToMemory().

◆ m_MemoryBuffer

char* mitk::FileWriter::m_MemoryBuffer
protected

Definition at line 136 of file mitkFileWriter.h.

Referenced by GetMemoryPointer().

◆ m_MemoryBufferSize

unsigned int mitk::FileWriter::m_MemoryBufferSize
protected

Definition at line 137 of file mitkFileWriter.h.

Referenced by GetMemorySize().

◆ m_WriteToMemory

bool mitk::FileWriter::m_WriteToMemory
protected

Definition at line 135 of file mitkFileWriter.h.

Referenced by GetWriteToMemory(), and SetWriteToMemory().


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