ImFusion SDK 4.3

#include <ImFusion/Dicom/DicomIOD_Registry.h>

A registry that assigns a IOD implementation to a SOP class UID. More...

+ Inheritance diagram for IOD_Registry:

Detailed Description

A registry that assigns a IOD implementation to a SOP class UID.

Both the DicomLoader and DicomWriter use an instance of this class to determine how DICOM files should be loaded or saved. The IOD_Registry offers some static methods that can extend the content of the default IOD_Registry.

The most common use-case of the IOD_Registry is enabled or disabling certain extensions. E.g. to enable the OverlayExtension:

auto overlayExt = registry->findExtension<Dicom::OverlayExtension>();
if (overlayExt)
overlayExt->setEnabled(true);
DicomLoader loader(..., std::move(registry));
static std::unique_ptr< IOD_Registry > createDefault()
Create a registry instance containing all default IODs and Extensions.
The DicomLoader class loads images from DICOM files.
Definition DicomLoader.h:85

,

Public Types

using ContainerFactory = std::function<std::unique_ptr<SharedImageSet>(DcmDataset&, const std::string&)>
 

Public Member Functions

std::unique_ptr< SharedImageSetcreateContainer (DcmDataset &dataset) const
 Creates a SharedImageSet instance for the given dataset.
 
void addExtension (std::unique_ptr< Extension > extension)
 Add a Extension to this instance.
 
std::vector< const Extension * > extensions () const
 Return all Extensions available on this instance.
 
std::vector< Extension * > extensions ()
 
template<typename T>
T * findExtension ()
 Find and return the first Extension that matches the type T.
 
void addDatasetHandler (std::function< std::unique_ptr< DatasetHandler >()> handlerConstruction)
 Add a new DatasetHandler for loading proprietary / non-standard DICOM image formats, or non-image datasets to this instance.
 
std::vector< std::unique_ptr< DatasetHandler > > createDatasetHandlers ()
 Creates all registered DatasetHandler objects \experimental.
 
bool enableFallbackLoader () const
 Returns the flag whether to use a fallback loader in case the series has an unsupported SOP.
 
void setEnableFallbackLoader (bool value)
 Sets the flag whether to use a fallback loader in case the series has an unsupported SOP.
 
std::unique_ptr< IODcreateLoaderIOD (DcmDataset &dataset, const ErrorRecorder *errorRecorder=nullptr, const std::string &pathInfo="")
 Creates the corresponding IOD object for the datasets SOP class UID.
 
std::vector< std::stringavailableWriterIODs (SharedImageSet &image, const ErrorRecorder *errorRecorder=nullptr)
 Returns a list of writers that can save the given image.
 
bool isMultiFrameIOD (const std::string &name) const
 Returns true if the writer with the given name supports multiple frames in one dataset.
 
std::unique_ptr< IODcreateWriterIOD (const std::string &name, DcmDataset &dataset, SharedImageSet &image, const ErrorRecorder *errorRecorder=nullptr) const
 Creates the IOD for the writer with the given name.
 
void configure (const Properties *p) override
 Configure this object instance by de-serializing the given Properties.
 
void configuration (Properties *p) const override
 Serialize the current object configuration into the given Properties object.
 
- Public Member Functions inherited from Configurable
virtual void configureDefaults ()
 Retrieve the properties of this object, replaces values with their defaults and sets it again.
 
void registerParameter (ParameterBase *param)
 Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration().
 
void unregisterParameter (const ParameterBase *param)
 Remove the given Parameter or SubProperty from the list of registered parameters.
 
 Configurable (const Configurable &rhs)
 
 Configurable (Configurable &&rhs) noexcept
 
Configurableoperator= (const Configurable &)
 
Configurableoperator= (Configurable &&) noexcept
 

Static Public Member Functions

static std::unique_ptr< IOD_RegistrycreateDefault ()
 Create a registry instance containing all default IODs and Extensions.
 
static std::unique_ptr< IOD_RegistrycreateEmpty ()
 Create an empty registry instance without any Extensions.
 
static void registerContainerFactory (ContainerFactory factory)
 Register a factory for SharedImageSet subclasses.
 
static void registerDefaultExtension (std::unique_ptr< const Extension > extension)
 Register a Extension that should be available by default.
 
template<typename T>
static void registerLoaderIOD (const char *sopClassUID)
 Registers a new IOD.
 
static void registerLoaderIOD (std::function< IOD *(DcmDataset &, const std::string &sopClassUID)> canLoad)
 Registers a new IOD for loading a Dicom dataset.
 
static void registerDefaultDatasetHandler (std::function< std::unique_ptr< DatasetHandler >()> handlerConstruction)
 Registers a new DatasetHandler that should available by default.
 
template<typename T>
static void registerWriterIOD (const std::string &name, bool isMultiframe, std::function< std::string(SharedImageSet &)> canWrite)
 Registers a new IOD for writing a Dicom dataset.
 

Additional Inherited Members

- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 
- Protected Member Functions inherited from NotCopyable
 NotCopyable (NotCopyable &&) noexcept=default
 
NotCopyableoperator= (NotCopyable &&) noexcept=default
 
 NotCopyable (const NotCopyable &)=delete
 
NotCopyableoperator= (const NotCopyable &)=delete
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 

Member Function Documentation

◆ createDefault()

static std::unique_ptr< IOD_Registry > createDefault ( )
static

Create a registry instance containing all default IODs and Extensions.

It comes with at least the following extensions:

◆ createEmpty()

static std::unique_ptr< IOD_Registry > createEmpty ( )
static

Create an empty registry instance without any Extensions.

Currently still contains all IODs but this might change in the future!

◆ registerContainerFactory()

static void registerContainerFactory ( ContainerFactory factory)
static

Register a factory for SharedImageSet subclasses.

Certain DICOMs should be loaded as a specialized sub-class of SharedImageSet, e.g. as a UltrasoundSweep or ConeBeamData. Factories should only return a new object if the given DICOM dataset fullfills all requirements of the corresponding specialized SharedImageSet. Otherwise they should return nullptr.

◆ createContainer()

std::unique_ptr< SharedImageSet > createContainer ( DcmDataset & dataset) const

Creates a SharedImageSet instance for the given dataset.

This might create a sub-class of SharedImageSet such as UltrasoundSweep or ConeBeamData. Never returns nullptr.

◆ registerDefaultExtension()

static void registerDefaultExtension ( std::unique_ptr< const Extension > extension)
static

Register a Extension that should be available by default.

The given loader instance will only be used as a kind of template to clone the instances from which will receive the actual DICOM data.

◆ findExtension()

template<typename T>
T * findExtension ( )

Find and return the first Extension that matches the type T.

Return nullptr if no such loader exists.

◆ registerLoaderIOD() [1/2]

template<typename T>
void registerLoaderIOD ( const char * sopClassUID)
static

Registers a new IOD.

Replaces any IOD with the same SOP class UID. A single IOD can be registered for several SOP class UIDs.

◆ registerLoaderIOD() [2/2]

static void registerLoaderIOD ( std::function< IOD *(DcmDataset &, const std::string &sopClassUID)> canLoad)
static

Registers a new IOD for loading a Dicom dataset.

The function should return a valid IOD implementation that can load the given dataset or 0 otherwise. The sopClassUID is provided for convenience. Loaders are queried in reverse order of registration i.e. the last registered loader is queried first.

◆ registerDefaultDatasetHandler()

static void registerDefaultDatasetHandler ( std::function< std::unique_ptr< DatasetHandler >()> handlerConstruction)
static

Registers a new DatasetHandler that should available by default.

\experimental

◆ addDatasetHandler()

void addDatasetHandler ( std::function< std::unique_ptr< DatasetHandler >()> handlerConstruction)

Add a new DatasetHandler for loading proprietary / non-standard DICOM image formats, or non-image datasets to this instance.

\experimental

◆ enableFallbackLoader()

bool enableFallbackLoader ( ) const

Returns the flag whether to use a fallback loader in case the series has an unsupported SOP.

Note
The fallback loader will use the MultiFrameImageIOD class to read the series and may end up with incomplete/invalid data.

◆ setEnableFallbackLoader()

void setEnableFallbackLoader ( bool value)

Sets the flag whether to use a fallback loader in case the series has an unsupported SOP.

Enabled by default.

Note
The fallback loader will use the MultiFrameImageIOD class to read the series and may end up with incomplete/invalid data.

◆ createLoaderIOD()

std::unique_ptr< IOD > createLoaderIOD ( DcmDataset & dataset,
const ErrorRecorder * errorRecorder = nullptr,
const std::string & pathInfo = "" )

Creates the corresponding IOD object for the datasets SOP class UID.

Returned object must be deleted by caller.

◆ registerWriterIOD()

template<typename T>
void registerWriterIOD ( const std::string & name,
bool isMultiframe,
std::function< std::string(SharedImageSet &)> canWrite )
static

Registers a new IOD for writing a Dicom dataset.

Each writer is uniquely identified by its name. The canWrite method should return a SOP class UID if the registered writer can save the given image or an empty string otherwise. The function is allowed to return different SOP class UID for different images. The isMultiframe flag defines if the IOD can store multiple frames in one dataset or not.

◆ createWriterIOD()

std::unique_ptr< IOD > createWriterIOD ( const std::string & name,
DcmDataset & dataset,
SharedImageSet & image,
const ErrorRecorder * errorRecorder = nullptr ) const

Creates the IOD for the writer with the given name.

If no writer with that name is registered, 0 is returned.

◆ configure()

void configure ( const Properties * p)
overridevirtual

Configure this object instance by de-serializing the given Properties.

The default implementation will do so automatically for all registered Parameter and SubProperty instances.

See also
configuration() for the inverse functionality

Reimplemented from Configurable.

◆ configuration()

void configuration ( Properties * p) const
overridevirtual

Serialize the current object configuration into the given Properties object.

The default implementation will do so automatically for all registered Parameter and SubProperty instances.

See also
configure() for the inverse functionality

Reimplemented from Configurable.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close