Working with DICOM Waveforms
The DICOM standard supports waveform storage and communication: this includes hemodynamic curve data, cardiac electrophysiology, electrocardiography (ECG) and audio signals (WAV files). A waveform consists of one or more multiplex groups, each encoded into an Item in the Waveform Sequence (5400,0100). All channels within a multiplex group are synchronously digitized at a common sampling frequency. The waveform samples can be 8 or 16 bit, with data representation as signed , unsigned , mu-law or A-law. DICOM also supports waveform annotations, which are typically generated as part of the data acquisition process, such as waveform maxima and minima, or the labeling of particular stimuli.
LEADTOOLS waveform support is comprehensive and handles the various features supported by the standard. The DicomWaveformGroup COM class encapsulates the attributes of a multiplex group (the building block for waveforms in DICOM), while the DicomWaveformChannel COM class provides functionality to create and manipulate waveform channels. On the dataset level, the toolkit provides four simple, yet powerful methods for using waveforms:
The AddWaveformGroup method, which creates a new waveform group.
The DeleteWaveformGroup method, which deletes an existing waveform group.
The GetWaveformGroupCount method, which gets the number of waveform groups.
The GetWaveformGroup method, which extracts a waveform group from a dataset.
The functionality provided by the DicomWaveformGroup COM class can be divided into three main categories:
Channel Manipulation
Audio Support
Management of Waveform Group Attributes
Channel Manipulation
At the heart of any waveform support is the creation and management of channels. This is provided by the Channels property, a DicomWaveformChannels object that contains a collection of DicomWaveformChannel objects. The collection of channels can be manipulated using the _NewEnum property, Add method, Item method, Remove method and the SetNumberOfSamplesPerChannel method. In addition, information about the collection can be found in the Count property.
Audio Support
LEADTOOLS waveform support includes support for audio data. To load a wave file into a waveform group, use the LoadAudio method. This method is very useful when creating DICOM objects of type "Basic Voice Audio" (1.2.840.10008.5.1.4.1.1.9.4.1), which is typically used for report dictation.
To create a wave file from the channels in a waveform group, use the SaveAudio method. This method is very useful when extracting audio (wave) data from a DICOM object of type "Basic Voice Audio" (1.2.840.10008.5.1.4.1.1.9.4.1).
Management of Waveform Group Attributes
LEADTOOLS waveform support includes comprehensive support for the management of the attributes of a waveform group.
In DICOM it is mandatory to specify the waveform's originality (that is, whether the waveform data is original (source) data, or derived data), as well as its sampling frequency. Consequently, it is important to use the WaveformOriginality property and the SamplingFrequency property to set these values in order to create a proper waveform group.
If the acquisition equipment adds padding values, DICOM makes it mandatory to set the waveform padding value. This can be done using the WaveformPaddingValue property. For more information, refer to the "Waveform Padding Value" (5400,100A) element in the DICOM Standard.
The following are other properties and methods that can be used to set and get the different attributes of a waveform group:
MultiplexGroupTimeOffset property
NumberOfSamplesPerChannel property
TriggerSamplePosition property
In addition, the ValueDefined property provides information on which IDicomWaveformGroup properties contain valid data.
The DicomWaveformChannel COM class provides functionality that can be divided into the following categories:
Setting/Getting Channel Samples
Specifying the Channel Source
Specifying the Channel Sensitivity
Adding/Managing Waveform Annotations
Setting/Getting Other Waveform Channel Attributes
Setting/Getting Channel Samples
Before setting channel data be sure to set the sample interpretation in the SampleInterpretation property. The channel data can be set using the SetChannelSamples method. The data representation for 8-bit channels can be signed, unsigned, mu-law or A-law, while the data representation for 16-bit channels can be signed or unsigned. To get the data for a channel, use the ChannelSamples property. The NumberOfSamples property contains the number of samples per channel
Specifying the Channel Source
In DICOM, it is mandatory to specify the source for a channel. For this reason it is important to use the ChannelSource property to create a proper waveform channel.
Specifying the Channel Sensitivity
In DICOM, it is mandatory to specify the channel sensitivity if the channel samples represent defined (not arbitrary) units. Since this is almost always the case, it is important to use the following properties to create a proper waveform channel:
ChannelSensitivityUnits property
You can use the various methods and properties that deal with the Context Group Table in order set the Channel Sensitivity Units. For more information, please refer to Working with Context Groups.
Adding/Managing Waveform Annotations
The annotations applied to a waveform channel are specified by the Annotations property, a DicomWaveformAnnotations object that contains a collection of DicomWaveformAnnotation objects. The collection of annotations can be manipulated using the _NewEnum property, Add method, Item method and the Remove method. In addition, information about the collection can be found in the Count property.
The following properties and methods can be used to set and get the different attributes of an annotation:
AnnotationGroupNumber property
In addition, the ValueDefined property provides information on which IDicomWaveformAnnotation properties contain valid data.
Setting/Getting Other Waveform Channel Attributes
The following properties are other properties that can be used to set and get the different attributes of a waveform channel:
WaveformChannelNumber property
Code Sequence Items
Both the IDicomWaveformChannel object and the IDicomWaveformAnnotation object use code sequence items in the form of IDicomCodeSequenceItem objects. The following properties contain information about the code sequence items:
CodingSchemeDesignator property
ContextGroupExtensionCreatorUID property
ContextGroupLocalVersion property
IsContextGroupLocalVersion property