ImFusion SDK 4.3
IOD Class Referenceabstract

#include <ImFusion/Dicom/DicomIOD.h>

Base class of a Dicom Information Object Definition (IOD). More...

+ Inheritance diagram for IOD:

Detailed Description

Base class of a Dicom Information Object Definition (IOD).

An IOD bundles several modules and basically represents a single series instance. The purpose of an IOD is to interpret the values from its modules and combine them into an image. Different IODs might handle the same Module differently (e.g. apply additional restrictions).

For reading, the member functions are usually (e.g. by DicomLoader) called in the following order:

  1. loadFrames()
  2. sortAndGroupFrames() (only on the first frame)
  3. loadFrameData()
  4. loadFrameProperties()

For writing, the member functions are usually (e.g. by DicomWriter) called in the following order:

  1. save()
  2. savePixelData()
See also
PS 3.3A http://dicom.nema.org/medical/dicom/current/output/chtml/part03/chapter_3.html

Public Member Functions

 IOD (DcmDataset &dataset, const OFString &sopClassUID)
 Creates a new IOD representation using the given DcmDataset and SOP class UID.
 
virtual std::vector< FrameDescriptorloadFrames ()=0
 Loads the descriptors of all individual frames stored in this IOD.
 
virtual std::vector< FrameDescriptorSetsortAndGroupFrames (const std::vector< FrameDescriptor > &frames) const =0
 Sorts and groups the given frames into sets of associated frames (e.g.
 
virtual void loadFrameData (const FrameDescriptor &desc, MemImage &image, int slice=-1)=0
 Loads the actual frame data into the given image.
 
virtual void loadFrameProperties (const FrameDescriptor &desc, SharedImageSet &image)
 Loads any additional properties into the given image.
 
virtual void save (SharedImageSet &imageSet, int sharedImageIndex, int sliceIndex)
 Stores the general image descriptor and metadata of imageSet in the DICOM data set.
 
virtual void savePixelData (SharedImageSet &imageSet, int sharedImageIndex, int sliceIndex)=0
 Writes the pixel data of imageSet in the DICOM data set.
 
virtual void checkErrors () const
 Checks modules for errors and adds them to the list.
 
template<typename T>
const T * searchModule ()
 Returns the first module of the given type or nullptr if no such module exists.
 
DcmDataset & dataset () override
 Returns the dataset represented by this IOD.
 
- Public Member Functions inherited from ModuleList
const std::vector< const Module * > & modules () const
 List of all modules.
 
- Public Member Functions inherited from ElementList
const std::vector< ElementBase * > & elements () const
 List of all elements.
 
- Public Member Functions inherited from ErrorRecorder
virtual void * registerErrorHandler (ErrorCallback handler)
 Registers a new handler callback function.
 
virtual void unregisterErrorHandler (void *handler)
 Removes a previously registered handler again.
 
void * forwardErrors (const ErrorRecorder *otherRecorder)
 Convenient function to forward all errors registered to this recorder to another recorder.
 
virtual void registerError (const Error &error) const
 Sends the given error to all error handler callbacks.
 
void registerError (Error::Code code, Error::Type type, const std::string &details, TagProxy tag=TagProxy()) const
 

Public Attributes

const OFString sopClassUID
 DICOM SOP used.
 
std::string pathInfo
 Optional information from which file this IOD was loaded from (only use for display purposes)
 
CommonModule common
 
ImagePixel imagePixel
 
Element< int > numberOfFrames
 If this element exists and is larger than 1, multiple frames will be loaded regardless of the SOP Class defining it or not.
 

Protected Attributes

DcmDataset & m_dataset
 
- Protected Attributes inherited from ModuleList
std::vector< const Module * > m_modules
 List of all modules.
 
- Protected Attributes inherited from ElementList
std::vector< ElementBase * > m_elements
 List of all elements.
 

Additional Inherited Members

- Public Types inherited from ErrorRecorder
using ErrorCallback = std::function<void(const Error&)>
 Alias for a function to call for each error recorded.
 
- Protected Member Functions inherited from ModuleList
virtual void addModule (const Module &m)
 Adds a the module to the list. Should only be called by the Module constructor.
 
virtual void removeModule (const Module &m)
 
- Protected Member Functions inherited from NotCopyable
 NotCopyable (NotCopyable &&) noexcept=default
 
NotCopyableoperator= (NotCopyable &&) noexcept=default
 
 NotCopyable (const NotCopyable &)=delete
 
NotCopyableoperator= (const NotCopyable &)=delete
 

Member Function Documentation

◆ loadFrames()

virtual std::vector< FrameDescriptor > loadFrames ( )
pure virtual

Loads the descriptors of all individual frames stored in this IOD.

Except for Enhanced Multiframe Dicoms, most IODs will return one image. Does not load any pixel data.

Implemented in DicomMultiFrameConeBeamIOD, DicomSingleFrameConeBeamIOD, EnhancedMultiFrameImageIOD, MultiFrameImageIOD, VolumetricImageIOD, NuclearMedicineImageIOD, PhilipsQLabIOD, and DicomGeVividE9IOD.

◆ sortAndGroupFrames()

virtual std::vector< FrameDescriptorSet > sortAndGroupFrames ( const std::vector< FrameDescriptor > & frames) const
pure virtual

Sorts and groups the given frames into sets of associated frames (e.g.

volumes).

All given frames should be somehow part of the returned frame sets. 2D images (i.e. IMAGESET) can be returned as framesets with only a single item. The exact order of the given frames is undefined. For multiframe Dicoms, this method is only called on the first frame. The IOD pointer held by each frame can be used to access special elements that are required for sorting and/or grouping.

Note
When overriding this method, it should be treated like a static method, i.e. no members should be accessed.

Implemented in DicomMultiFrameConeBeamIOD, DicomSingleFrameConeBeamIOD, DicomGeSignaExciteIOD, EnhancedMultiFrameImageIOD, MultiFrameImageIOD, SegmentationStorageIOD, VolumetricImageIOD, PhilipsQLabIOD, and DicomGeVividE9IOD.

◆ loadFrameData()

virtual void loadFrameData ( const FrameDescriptor & desc,
MemImage & image,
int slice = -1 )
pure virtual

Loads the actual frame data into the given image.

The frameNumber in the given FrameDescriptor is the index of the corresponding frame as returned by loadFrames. If slice is not -1, the frame should be loaded into the given slice of the image.

Implemented in EnhancedMultiFrameImageIOD, MultiFrameImageIOD, SegmentationStorageIOD, PhilipsQLabIOD, and DicomGeVividE9IOD.

◆ loadFrameProperties()

virtual void loadFrameProperties ( const FrameDescriptor & desc,
SharedImageSet & image )
virtual

Loads any additional properties into the given image.

This method is called after the complete image data has been loaded. desc will contain valid sharedImageIndex and sliceIndex parameters indicating where this frame has been stored in the image. Implementations must not reorder, remove or resize the images of the given SharedImageSet!

The order or amount of images must not be changed inside the SharedImageSet! Also, the size of the individual images must not change. Otherwise, this would lead to inconsistent sharedImageIndex and sliceIndex values.

This method might throw an exception if the properties somehow make the image completely invalid. This should only be used as a last restort if there is really no way to use the image in any meaningful way!

Note
The default implementation will create an ImageInfoDataComponent instance and attach it to image. Thus, when overriding this method make sure to call the base class method.

Reimplemented in DicomMultiFrameConeBeamIOD, DicomSingleFrameConeBeamIOD, DicomGeSignaExciteIOD, EnhancedMultiFrameImageIOD, MultiFrameImageIOD, SegmentationStorageIOD, and PhilipsQLabIOD.

◆ save()

virtual void save ( SharedImageSet & imageSet,
int sharedImageIndex,
int sliceIndex )
virtual

Stores the general image descriptor and metadata of imageSet in the DICOM data set.

sharedImageIndex and sliceIndex describe which part of the image set should be stored.

Reimplemented in EnhancedMultiFrameImageIOD, MultiFrameImageIOD, VolumetricImageIOD, NuclearMedicineImageIOD, and PhilipsQLabIOD.

◆ savePixelData()

virtual void savePixelData ( SharedImageSet & imageSet,
int sharedImageIndex,
int sliceIndex )
pure virtual

Writes the pixel data of imageSet in the DICOM data set.

sharedImageIndex and sliceIndex describe which part of the image set should be stored.

Implemented in EnhancedMultiFrameImageIOD, MultiFrameImageIOD, NuclearMedicineImageIOD, PhilipsQLabIOD, and DicomGeVividE9IOD.

◆ checkErrors()

virtual void checkErrors ( ) const
virtual

Checks modules for errors and adds them to the list.

Reimplemented in EnhancedMultiFrameImageIOD.

◆ dataset()

DcmDataset & dataset ( )
overridevirtual

Returns the dataset represented by this IOD.

Implements ModuleList.

Examples
DicomExtensionExample2.cpp.

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