Class DICOMFileReader
Class for reading DICOM files
Inheritance
Inherited Members
Namespace:EvilDICOM.Core.IO.Reading
Assembly:EvilDICOM.dll
Syntax
public class DICOMFileReader
Methods
View SourceRead(Byte[], TransferSyntax)
Reads a DICOM file from a byte array
Declaration
public static DICOMObject Read(byte[] fileBytes, TransferSyntax trySyntax = TransferSyntax.IMPLICIT_VR_LITTLE_ENDIAN)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | fileBytes | the bytes of the DICOM file |
| TransferSyntax | trySyntax |
Returns
| Type | Description |
|---|---|
| DICOMObject | a DICOM object containing all elements |
Read(String, TransferSyntax)
Reads a DICOM file from a path
Declaration
public static DICOMObject Read(string filePath, TransferSyntax trySyntax = TransferSyntax.IMPLICIT_VR_LITTLE_ENDIAN)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | the path to the DICOM file |
| TransferSyntax | trySyntax |
Returns
| Type | Description |
|---|---|
| DICOMObject | a DICOM object containing all elements |
ReadAsync(String, TransferSyntax)
Asynchronously reads a DICOM file from a path
Declaration
public static async Task<DICOMObject> ReadAsync(string filePath, TransferSyntax trySyntax = TransferSyntax.IMPLICIT_VR_LITTLE_ENDIAN)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | the path to the DICOM file |
| TransferSyntax | trySyntax |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<DICOMObject> | a DICOM object containing all elements |
ReadFileMetadata(DICOMBinaryReader, ref TransferSyntax, ref StringEncoding)
Read explicit VR little endian up to transfer syntax element and determines transfer syntax for rest of elements
Declaration
public static List<IDICOMElement> ReadFileMetadata(DICOMBinaryReader dr, ref TransferSyntax syntax, ref StringEncoding enc)
Parameters
| Type | Name | Description |
|---|---|---|
| DICOMBinaryReader | dr | the binary reader which is reading the DICOM object |
| TransferSyntax | syntax | the transfer syntax of the DICOM file |
| StringEncoding | enc |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<IDICOMElement> | elements preceeding and including transfer syntax element |
ReadFileMetadata(Byte[])
Read the meta data from the DICOM object
Declaration
public static DICOMObject ReadFileMetadata(byte[] fileBytes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | fileBytes |
Returns
| Type | Description |
|---|---|
| DICOMObject | a DICOM object containing the metadata elements |
ReadFileMetadata(String)
Read the meta data from the DICOM object
Declaration
public static DICOMObject ReadFileMetadata(string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | the path to the DICOM file |
Returns
| Type | Description |
|---|---|
| DICOMObject | a DICOM object containing the metadata elements |