![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Dicom/DicomModule.h>
Image Pixel Module (PS 3.3 C.7.6.3) More...
Image Pixel Module (PS 3.3 C.7.6.3)
Most essential module that contains all relevant information to load the image. Be aware that the pixelData can contain multiple frames but the Module only contains the properties for a single frame.
Public Member Functions | |
ImagePixel (ModuleList &parent, Type type) | |
ImageDescriptor | loadDescriptor () const |
Convenient method to load a descriptor from element data. | |
void | saveDescriptor (const ImageDescriptor &desc, bool singleBitStorage=false) |
Convenient method to store a descriptor. | |
bool | createPixelData (const ImageDescriptor &desc, int numberOfFrames, bool singleBitStorage=false) const |
bool | copyAndConvertPixelData (MemImage &image, int slice=0, int frame=0) const |
Loads the pixel data and converts it to Monochrome2 or RGB. | |
bool | convertAndStorePixelData (const MemImage &image, int slice=0, int frame=0, bool singleBitStorage=false) |
Store one slice of the image in the pixel data and convert it to an appropriate format if necessary. | |
![]() | |
Module (ModuleList &parent, Type type) | |
Creates a new Dicom Module, registers it with the given parent and sets the given type/conditionality. | |
virtual bool | isMandatory () const |
Evaluates whether this module is mandatory (based on the specified type and optionally condition). | |
void | setCondition (std::function< bool()> predicate) |
Sets a callback function that determines if a conditional module is mandatory. | |
virtual void | checkErrors (bool ignoreMandatory=false) const |
Checks the module for errors. | |
DcmItem & | dataset () override |
Returns the data set this module corresponds to. | |
![]() | |
const std::vector< ElementBase * > & | elements () const |
List of all elements. | |
![]() | |
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 | |
Element< int > | rows |
Element< int > | columns |
Element< int > | samplesPerPixel |
Element< int > | bitsAllocated |
Element< int > | bitsStored |
Element< int > | highBit |
Element< bool > | pixelRepresentation |
Element< int > | planarConfiguration |
Element< std::string > | transferSyntax |
Element< PhotometricInterpretation > | photometricInterpretation |
Element< std::vector< int > > | paletteDescriptor |
Element< std::vector< int > > | paletteRed |
Element< std::vector< int > > | paletteGreen |
Element< std::vector< int > > | paletteBlue |
Element< std::vector< double > > | pixelAspectRatio |
Element< DcmPixelData * > | pixelData |
Additional Inherited Members | |
![]() | |
enum | Type { Mandatory , UserOption , Conditional } |
Conditionality of the module. | |
![]() | |
using | ErrorCallback = std::function<void(const Error&)> |
Alias for a function to call for each error recorded. | |
![]() | |
NotCopyable (NotCopyable &&) noexcept=default | |
NotCopyable & | operator= (NotCopyable &&) noexcept=default |
NotCopyable (const NotCopyable &)=delete | |
NotCopyable & | operator= (const NotCopyable &)=delete |
![]() | |
ModuleList & | m_parent |
List this module is part of. | |
DcmItem & | m_dataset |
The data set this module corresponds to. | |
Type | m_type |
Conditionality of this module. | |
std::function< bool()> | m_typeCondition |
Optional predicate function to evaluate mandatoriness. | |
![]() | |
std::vector< ElementBase * > | m_elements |
List of all elements. | |
ImageDescriptor loadDescriptor | ( | ) | const |
Convenient method to load a descriptor from element data.
If the module is incomplete, an empty descriptor is returned.
bool copyAndConvertPixelData | ( | MemImage & | image, |
int | slice = 0, | ||
int | frame = 0 ) const |
Loads the pixel data and converts it to Monochrome2 or RGB.
The pixel data is copied from the DcmItem to the provided image.
The optional slice parameter specifies into which slice the data should be copied. By default the data is copied to the first slice.
The optional frame parameter will read from the given frame index. It is assumed that all frames have the same size as the image.
This method never changes the underlying PixelType of the image. If a palette would change the PixelType, the palette values are mapped to the image type.
Returns false when the pixel data could not be copied. An error is automatically registered in this case.
bool convertAndStorePixelData | ( | const MemImage & | image, |
int | slice = 0, | ||
int | frame = 0, | ||
bool | singleBitStorage = false ) |
Store one slice of the image in the pixel data and convert it to an appropriate format if necessary.
The optional slice parameter specifies which slice the data should be copied from. By default the data is copied to the first slice.
The optional frame parameter will write to the pixel data of the given frame index. It is assumed that all frames have the same size as the image.
When singleBitStorage is true, each pixel will be reduced to a single bit (e.g. for labelmaps).
Returns false when the pixel data could not be stored. An error is automatically registered in this case.