Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::IOMimeTypes::BaseDicomMimeType Class Reference

Base mime-type for all DICOM image formats. More...

#include <mitkIOMimeTypes.h>

Inheritance diagram for mitk::IOMimeTypes::BaseDicomMimeType:
Collaboration diagram for mitk::IOMimeTypes::BaseDicomMimeType:

Public Member Functions

 BaseDicomMimeType (const std::string &name)
 Construct with a specific mime-type name. More...
 
 BaseDicomMimeType (const BaseDicomMimeType &other)=default
 
bool AppliesTo (const std::string &path) const override
 Check whether the given path points to a readable DICOM file. More...
 
BaseDicomMimeType * Clone () const override
 Clone this mime-type. More...
 
- Public Member Functions inherited from mitk::CustomMimeType
 CustomMimeType ()
 Construct a default CustomMimeType with an empty name. More...
 
 CustomMimeType (const std::string &name)
 Construct a CustomMimeType with the given unique name. More...
 
 CustomMimeType (const CustomMimeType &other)
 Copy constructor. More...
 
 CustomMimeType (const MimeType &other)
 Construct from an immutable MimeType wrapper. More...
 
virtual ~CustomMimeType ()
 
CustomMimeType & operator= (const CustomMimeType &other)
 Copy assignment operator. More...
 
CustomMimeType & operator= (const MimeType &other)
 Assignment from an immutable MimeType wrapper. More...
 
std::string GetName () const
 Get the unique name for this mime-type. More...
 
std::string GetCategory () const
 Get the human-readable category of this mime-type. More...
 
std::vector< std::string > GetExtensions () const
 Get all file extensions this mime-type can handle. More...
 
std::string GetComment () const
 Get a human-readable description of this mime-type. More...
 
bool MatchesExtension (const std::string &path) const
 Check whether the file extension of the given path matches this mime-type. More...
 
std::string GetExtension (const std::string &path) const
 Get the first matching extension found at the end of the given path. More...
 
std::string GetFilenameWithoutExtension (const std::string &path) const
 Get the filename from the given path, without the matching extension. More...
 
void SetName (const std::string &name)
 Set the unique name of this mime-type. More...
 
void SetCategory (const std::string &category)
 Set the category for grouping this mime-type. More...
 
void SetExtension (const std::string &extension)
 Set a single file extension, replacing all existing extensions. More...
 
void AddExtension (const std::string &extension)
 Add a file extension to the list if not already present (case-insensitive). More...
 
void SetComment (const std::string &comment)
 Set the human-readable comment for this mime-type. More...
 
void Swap (CustomMimeType &r)
 Swap the contents of this CustomMimeType with another. More...
 

Detailed Description

Base mime-type for all DICOM image formats.

This mime-type class uses GDCM to inspect file contents and verify DICOM compatibility. It can be subclassed to create more specific DICOM mime-types. DICOM-RT modalities (RTSTRUCT, RTDOSE, RTPLAN) are explicitly excluded.

See also
DicomMimeType

Definition at line 56 of file mitkIOMimeTypes.h.

Constructor & Destructor Documentation

◆ BaseDicomMimeType() [1/2]

mitk::IOMimeTypes::BaseDicomMimeType::BaseDicomMimeType ( const std::string &  name)

Construct with a specific mime-type name.

Parameters
[in]nameThe unique mime-type name.

◆ BaseDicomMimeType() [2/2]

mitk::IOMimeTypes::BaseDicomMimeType::BaseDicomMimeType ( const BaseDicomMimeType &  other)
default

Member Function Documentation

◆ AppliesTo()

bool mitk::IOMimeTypes::BaseDicomMimeType::AppliesTo ( const std::string &  path) const
overridevirtual

Check whether the given path points to a readable DICOM file.

Parameters
[in]pathFile or directory path to inspect.
Returns
true if the path contains valid DICOM data (excluding RT modalities).

Reimplemented from mitk::CustomMimeType.

◆ Clone()

BaseDicomMimeType* mitk::IOMimeTypes::BaseDicomMimeType::Clone ( ) const
overridevirtual

Clone this mime-type.

Returns
A heap-allocated copy. Caller takes ownership.

Reimplemented from mitk::CustomMimeType.

Reimplemented in mitk::IOMimeTypes::DicomMimeType.


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