![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Dicom/DicomIOD_Registry.h>
A registry that assigns a IOD implementation to a SOP class UID. More...
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:
,
Public Types | |
using | ContainerFactory = std::function<std::unique_ptr<SharedImageSet>(DcmDataset&, const std::string&)> |
Public Member Functions | |
std::unique_ptr< SharedImageSet > | createContainer (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< IOD > | createLoaderIOD (DcmDataset &dataset, const ErrorRecorder *errorRecorder=nullptr, const std::string &pathInfo="") |
Creates the corresponding IOD object for the datasets SOP class UID. | |
std::vector< std::string > | availableWriterIODs (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< 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. | |
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. | |
![]() | |
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 | |
Configurable & | operator= (const Configurable &) |
Configurable & | operator= (Configurable &&) noexcept |
Static Public Member Functions | |
static std::unique_ptr< IOD_Registry > | createDefault () |
Create a registry instance containing all default IODs and Extensions. | |
static std::unique_ptr< IOD_Registry > | createEmpty () |
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 | |
![]() | |
Signal | signalParametersChanged |
Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted. | |
![]() | |
NotCopyable (NotCopyable &&) noexcept=default | |
NotCopyable & | operator= (NotCopyable &&) noexcept=default |
NotCopyable (const NotCopyable &)=delete | |
NotCopyable & | operator= (const NotCopyable &)=delete |
![]() | |
std::vector< Param > | m_params |
List of all registered Parameter and SubProperty instances. | |
|
static |
Create a registry instance containing all default IODs and Extensions.
It comes with at least the following extensions:
|
static |
Create an empty registry instance without any Extensions.
Currently still contains all IODs but this might change in the future!
|
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.
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.
|
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.
T * findExtension | ( | ) |
Find and return the first Extension that matches the type T.
Return nullptr if no such loader exists.
|
static |
|
static |
|
static |
Registers a new DatasetHandler that should available by default.
\experimental
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
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.
Enabled by default.
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.
|
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.
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.
|
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.
Reimplemented from Configurable.
|
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.
Reimplemented from Configurable.