Class DicomEncoding
Support methods for DICOM encoding.
Inheritance
Inherited Members
Namespace: FellowOakDicom
Assembly: fo-dicom.core.dll
Syntax
public static class DicomEncoding
Fields
Default
Default encoding used in DICOM.
Declaration
public static readonly Encoding Default
Field Value
Type | Description |
---|---|
System.Text.Encoding |
DefaultArray
Declaration
public static readonly Encoding[] DefaultArray
Field Value
Type | Description |
---|---|
System.Text.Encoding[] |
Methods
GetCharset(Encoding, Boolean)
Get DICOM character set from encoding.
Declaration
public static string GetCharset(Encoding encoding, bool extended = false)
Parameters
Type | Name | Description |
---|---|---|
System.Text.Encoding | encoding | Encoding. |
System.Boolean | extended | If true, the extended version of the character set is returned. |
Returns
Type | Description |
---|---|
System.String | The Specific Character Set as defined in DICOM. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | No character set found for the encoding. |
GetEncoding(String)
Get encoding from Specific Character Set attribute value. Tolerates some common misspellings.
Declaration
public static Encoding GetEncoding(string charset)
Parameters
Type | Name | Description |
---|---|---|
System.String | charset | DICOM character set. |
Returns
Type | Description |
---|---|
System.Text.Encoding | String encoding. |
GetEncodings(String[])
Get multiple encodings from Specific Character Set attribute values.
Declaration
public static Encoding[] GetEncodings(string[] charsets)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | charsets | List of character sets. |
Returns
Type | Description |
---|---|
System.Text.Encoding[] | String encodings. |
RegisterEncoding(String, String)
Register an encoding for a specific character set value. Can be used to add an encoding that is not handled by the library, or a private encoding. Can also be used to map an existing character set to another encoding.
Declaration
public static void RegisterEncoding(string charset, string encoding)
Parameters
Type | Name | Description |
---|---|---|
System.String | charset | The name of the character set as given in the Specific Character Set DICOM attribute. |
System.String | encoding | The name of the character encoding used to decode the DICOM tag values as defined in the .NET framework. |