Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::ImageSerializer Class Reference

Serializes mitk::Image for mitk::SceneIO. More...

#include <mitkImageSerializer.h>

Inheritance diagram for mitk::ImageSerializer:
Collaboration diagram for mitk::ImageSerializer:

Public Member Functions

 mitkClassMacro (ImageSerializer, BaseDataSerializer)
 
Pointer Clone () const
 
std::string Serialize () override
 Serialize the Image object to a .nrrd file. More...
 
- Public Member Functions inherited from mitk::BaseDataSerializer
 mitkClassMacroItkParent (BaseDataSerializer, itk::Object)
 
virtual void SetFilenameHint (const char *_arg)
 Sets a hint for the output filename (without path or extension). More...
 
virtual const char * GetFilenameHint () const
 Returns the current filename hint. More...
 
virtual void SetWorkingDirectory (const char *_arg)
 Sets the working directory where serialized files will be stored. More...
 
virtual const char * GetWorkingDirectory () const
 Returns the current working directory for serialized files. More...
 
virtual void SetData (const BaseData *_arg)
 Sets the BaseData object to be serialized. More...
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 ImageSerializer ()
 
 ~ImageSerializer () override
 
- Protected Member Functions inherited from mitk::BaseDataSerializer
 BaseDataSerializer ()
 
 ~BaseDataSerializer () override
 
std::string GetUniqueFilenameInWorkingDirectory ()
 

Additional Inherited Members

- Protected Attributes inherited from mitk::BaseDataSerializer
std::string m_FilenameHint
 
std::string m_WorkingDirectory
 
BaseData::ConstPointer m_Data
 

Detailed Description

Serializes mitk::Image for mitk::SceneIO.

Writes the Image object to a NRRD file (.nrrd) in the configured working directory using mitk::IOUtil. The filename is composed from a unique prefix and the filename hint.

See also
BaseDataSerializer, SceneIO, Image

Definition at line 29 of file mitkImageSerializer.h.

Constructor & Destructor Documentation

◆ ImageSerializer()

mitk::ImageSerializer::ImageSerializer ( )
protected

◆ ~ImageSerializer()

mitk::ImageSerializer::~ImageSerializer ( )
overrideprotected

Member Function Documentation

◆ Clone()

Pointer mitk::ImageSerializer::Clone ( ) const

◆ mitkClassMacro()

mitk::ImageSerializer::mitkClassMacro ( ImageSerializer  ,
BaseDataSerializer   
)

◆ New()

static Pointer mitk::ImageSerializer::New ( )
static

◆ Serialize()

std::string mitk::ImageSerializer::Serialize ( )
overridevirtual

Serialize the Image object to a .nrrd file.

Casts the stored BaseData to mitk::Image and writes it to disk in NRRD format.

Returns
The filename (without path) of the created file, or an empty string on failure.
Precondition
The Data must be set and must be castable to mitk::Image.
The WorkingDirectory must be set.

Reimplemented from mitk::BaseDataSerializer.


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