LAUREL BRIDGE

Program Class

DICOM Connectivity Framework V3.4
This example demonstrates how to use the DCF library to convert datasets to change the transfer syntax of the encoded pixel data, also known as transcoding.
Inheritance Hierarchy

SystemObject
  LaurelBridge.DCFExamples.TranscodeProgram

Namespace:  LaurelBridge.DCFExamples.Transcode
Assembly:  Transcode (in Transcode.exe) Version: DCF34 r13043 DCF_3_4_56_20220408 NetFramework
Syntax

C#
public class Program

The Program type exposes the following members.

Constructors

  NameDescription
Public methodProgram
Initializes a new instance of the Program class
Top
Methods

  NameDescription
Public methodStatic memberMain
Main entry point for DatasetDump. See the Options class for usage and options.
Top
Remarks

The DCF supports the three 'native' DICOM encodings:

ILEimplicit little endian, 1.2.840.10008.1.2
ELEexplicit little endian, 1.2.840.10008.1.2.1
EBEexplicit big endian, 1.2.840.10008.1.2.2 (Deprecated)

In addition, the DCF provides transcoding support for these encapsulated encodings:

RLELosslessRun Length Encoded Lossless, 1.2.840.10008.1.2.5
Jpeg50JPEG Baseline (Process 1): Default Lossy 8 Bit, 1.2.840.10008.1.2.4.50
Jpeg51JPEG Extended (Process 2 & 4): Default Lossy 12 Bit (Process 4 only), 1.2.840.10008.1.2.4.51
Jpeg57JPEG Lossless, Non-Hierarchical (Process14), 1.2.840.10008.1.2.4.57
Jpeg70JPEG Lossless, Non-Hierarchical, First-Order Prediction (Process 14 [Selection Value 1]): Default Lossless, 1.2.840.10008.1.2.4.70
Jpeg80JPEG-LS Lossless Image Compression, 1.2.840.10008.1.2.4.80
Jpeg81JPEG-LS Lossy (Near-Lossless) Image Compression, 1.2.840.10008.1.2.4.81
J2k90JPEG 2000 Image Compression (Lossless Only), 1.2.840.10008.1.2.4.90
J2k91JPEG 2000 Image Compression, 1.2.840.10008.1.2.4.91

Note: The DCF also supports other encapsulated formats in what is known as pass-through mode. Although you can not convert the dataset to a different transfer syntax, you can: send or receive these datasets in pass-through mode; modify or filter other elements; and access, modify or replace the raw pixel data stream in the pixel data element. This example will only allow you to specify transfer syntax uids that are supported by DCF for transcoding.

For this example, if the input and output transfer syntax uids are the same and you wish to re-encode the image data in the output dataset, you must disable pass through mode either by using the disable_pass_through option or by using a configuration file as shown below.

This example will accept a configuration override file to allow customization of session settings and/or other Framework configuration settings. So for example, the following configuration:

[ DCF.Dicom/default_session_cfg ]
# turn on compression logging
log_level_flags = Fatal,Error,Warn,Info,Debug
log_debug_flags = Compression,CompressionVerbose

# turn off pass through mode
enable_compression_pass_through_mode = false

[ DCF.Dicom/default_session_cfg/CodecOptions/1.2.840.10008.1.2.4.90/Decode ]
_TYPE_ = LaurelBridge.DCF.Codecs.OpjCodecOptions
[ DCF.Dicom/default_session_cfg/CodecOptions/1.2.840.10008.1.2.4.90/Encode ]
_TYPE_ = LaurelBridge.DCF.Codecs.OpjCodecOptions

[ DCF.Dicom/default_session_cfg/CodecOptions/1.2.840.10008.1.2.4.91/Decode ]
_TYPE_ = LaurelBridge.DCF.Codecs.OpjCodecOptions
[ DCF.Dicom/default_session_cfg/CodecOptions/1.2.840.10008.1.2.4.91/Encode ]
_TYPE_ = LaurelBridge.DCF.Codecs.OpjCodecOptions

# Advanced codec overrides could be specified here
[ DCF.Codecs/OpjCodecOptions/1.2.840.10008.1.2.4.90 ]
# J2kEncodeOverrides =
# J2kDecodeOverrides =
[ DCF.Codecs/OpjCodecOptions/1.2.840.10008.1.2.4.91 ]
# J2kEncodeOverrides =
# J2kDecodeOverrides =
would be equivalent to setting the Options parameters -v --disable_pass_through -J which will verbosely log compression details, disable pass through mode and use the OpenJpeg codec implementation for J2k90 and J2k91.

See Also

Reference