Class DicomTransferSyntax
A transfer syntax: how a file encodes its dataset (VR explicit or implicit, byte order, deflate) and its pixel data (native or encapsulated in a codec's codestream), named by a UID of PS3.6 table A-1 (PS3.5 section 10).
[Experimental("EGAMIX001", UrlFormat = "https://github.com/inexin/Egami/blob/main/docs/articles/formats/dicom.md")]
public sealed class DicomTransferSyntax
- Inheritance
-
DicomTransferSyntax
- Inherited Members
Examples
// The dataset of a DICOM file, every element kept; the preview API needs EGAMIX001 suppressed.
DicomFile file = DicomFile.Load("scan.dcm");
Console.WriteLine($"{file.TransferSyntax.Name}, {file.Dataset.Count} elements");
// Elements by PS3.6 keyword or by tag, null when the file has none.
string? modality = file.Dataset.GetString("Modality");
double? rows = file.Dataset.GetNumber("Rows");
DicomElement? name = file.Dataset[new DicomTag(0x0010, 0x0010)];
foreach (EgamiDiagnostic warning in file.Warnings)
{
Console.WriteLine($"{warning.Id}: {warning.Message}");
}
Properties
DeflatedExplicitVRLittleEndian
Gets Deflated Explicit VR Little Endian (1.2.840.10008.1.2.1.99).
public static DicomTransferSyntax DeflatedExplicitVRLittleEndian { get; }
Property Value
ExplicitVRBigEndian
Gets Explicit VR Big Endian (1.2.840.10008.1.2.2), retired but still met.
public static DicomTransferSyntax ExplicitVRBigEndian { get; }
Property Value
ExplicitVRLittleEndian
Gets Explicit VR Little Endian (1.2.840.10008.1.2.1).
public static DicomTransferSyntax ExplicitVRLittleEndian { get; }
Property Value
ImplicitVRLittleEndian
Gets Implicit VR Little Endian (1.2.840.10008.1.2), DICOM's default.
public static DicomTransferSyntax ImplicitVRLittleEndian { get; }
Property Value
IsBigEndian
Gets whether binary values are big-endian.
public bool IsBigEndian { get; }
Property Value
IsDeflated
Gets whether the dataset after the file meta information is deflated (RFC 1951).
public bool IsDeflated { get; }
Property Value
IsEncapsulated
Gets whether pixel data is encapsulated: compressed, in fragments (PS3.5 section A.4).
public bool IsEncapsulated { get; }
Property Value
IsExplicitVR
Gets whether each element states its VR.
public bool IsExplicitVR { get; }
Property Value
IsKnown
Gets whether PS3.6 lists the UID.
public bool IsKnown { get; }
Property Value
JpegBaseline
Gets JPEG Baseline (Process 1) (1.2.840.10008.1.2.4.50): lossy, 8 bits.
public static DicomTransferSyntax JpegBaseline { get; }
Property Value
JpegExtended
Gets JPEG Extended (Process 2 and 4) (1.2.840.10008.1.2.4.51): lossy, 8 or 12 bits.
public static DicomTransferSyntax JpegExtended { get; }
Property Value
JpegLossless
Gets JPEG Lossless, Non-Hierarchical, First-Order Prediction (Process 14, Selection Value 1) (1.2.840.10008.1.2.4.70).
public static DicomTransferSyntax JpegLossless { get; }
Property Value
JpegLsLossless
Gets JPEG-LS Lossless (1.2.840.10008.1.2.4.80).
public static DicomTransferSyntax JpegLsLossless { get; }
Property Value
JpegLsNearLossless
Gets JPEG-LS Lossy (Near-Lossless) (1.2.840.10008.1.2.4.81).
public static DicomTransferSyntax JpegLsNearLossless { get; }
Property Value
JpegXl
Gets JPEG XL (1.2.840.10008.1.2.4.112): lossy.
public static DicomTransferSyntax JpegXl { get; }
Property Value
JpegXlLossless
Gets JPEG XL Lossless (1.2.840.10008.1.2.4.110).
public static DicomTransferSyntax JpegXlLossless { get; }
Property Value
Name
Gets the PS3.6 name, such as JPEG 2000 Image Compression (Lossless Only), or the UID when PS3.6 does not list it.
public string Name { get; }
Property Value
RleLossless
Gets RLE Lossless (1.2.840.10008.1.2.5): PackBits byte planes (PS3.5 annex G).
public static DicomTransferSyntax RleLossless { get; }
Property Value
Uid
Gets the UID.
public string Uid { get; }
Property Value
Methods
FromUid(string)
Returns the transfer syntax a UID names. UIDs other than the four native ones are read as explicit VR little endian with encapsulated pixel data, as every compressed transfer syntax is.
public static DicomTransferSyntax FromUid(string uid)
Parameters
uidstringThe UID; trailing spaces and NUL padding are ignored.
Returns
- DicomTransferSyntax
The transfer syntax.
Exceptions
- ArgumentNullException
uidis null.
ToString()
Returns the name and UID.
public override string ToString()
Returns
- string
The transfer syntax as text.