Class DicomDirectory
Class for managing DICOM directory objects.
Inherited Members
Namespace: Dicom.Media
Assembly: cs.temp.dll.dll
Syntax
public class DicomDirectory : DicomFile
Constructors
DicomDirectory(Boolean)
Initializes a new instance of the DicomDirectory class.
Declaration
public DicomDirectory(bool explicitVr = true)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | explicitVr | Indicates whether or not Value Representation of the DICOM directory should be explicit. |
Properties
AutoValidate
Gets or sets if the content of DicomItems shall be validated as soon as they are added to the DicomDataset
Declaration
[Obsolete("Use this property with care. You can suppress validation, but be aware you might create invalid Datasets if you need to set this property.", false)]
public bool AutoValidate { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
FileSetID
Gets or sets the file set ID.
Declaration
public string FileSetID { get; set; }
Property Value
| Type | Description |
|---|---|
| String |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | If applied file set ID is null or empty. |
MediaStorageSOPInstanceUID
Gets or sets the media storage SOP instance UID.
Declaration
public DicomUID MediaStorageSOPInstanceUID { get; set; }
Property Value
| Type | Description |
|---|---|
| DicomUID |
RootDirectoryRecord
Gets the root directory record.
Declaration
public DicomDirectoryRecord RootDirectoryRecord { get; }
Property Value
| Type | Description |
|---|---|
| DicomDirectoryRecord |
RootDirectoryRecordCollection
Gets the root directory record collection.
Declaration
public DicomDirectoryRecordCollection RootDirectoryRecordCollection { get; }
Property Value
| Type | Description |
|---|---|
| DicomDirectoryRecordCollection |
SourceApplicationEntityTitle
Gets or sets the source application entity title.
Declaration
public string SourceApplicationEntityTitle { get; set; }
Property Value
| Type | Description |
|---|---|
| String |
Methods
AddFile(DicomFile, String)
Add new file to DICOM directory.
Declaration
public DicomDirectoryEntry AddFile(DicomFile dicomFile, string referencedFileId = "")
Parameters
| Type | Name | Description |
|---|---|---|
| DicomFile | dicomFile | DICOM file to add. |
| String | referencedFileId | Referenced file ID. |
Returns
| Type | Description |
|---|---|
| DicomDirectoryEntry |
OnSave()
Method to call before performing the actual saving.
Declaration
protected override void OnSave()
Overrides
Open(Stream)
Read DICOM Directory.
Declaration
public static DicomDirectory Open(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | Stream to read. |
Returns
| Type | Description |
|---|---|
| DicomDirectory | DicomDirectory instance. |
Open(Stream, Encoding, Func<ParseState, Boolean>, FileReadOption)
Read DICOM Directory from stream.
Declaration
public static DicomDirectory Open(Stream stream, Encoding fallbackEncoding, Func<ParseState, bool> stop = null, FileReadOption readOption = FileReadOption.Default)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | Stream to read. |
| Encoding | fallbackEncoding | Encoding to apply if it cannot be identified from DICOM directory. |
| Func<ParseState, Boolean> | stop | Stop criterion in dataset. |
| FileReadOption | readOption | The option how to deal with large DICOM tags like pixel data. |
Returns
| Type | Description |
|---|---|
| DicomDirectory | DicomDirectory instance. |
Open(String)
Read DICOM Directory.
Declaration
public static DicomDirectory Open(string fileName)
Parameters
| Type | Name | Description |
|---|---|---|
| String | fileName | File name. |
Returns
| Type | Description |
|---|---|
| DicomDirectory | DicomDirectory instance. |
Open(String, Encoding, Func<ParseState, Boolean>, FileReadOption)
Read DICOM Directory.
Declaration
public static DicomDirectory Open(string fileName, Encoding fallbackEncoding, Func<ParseState, bool> stop = null, FileReadOption readOption = FileReadOption.Default)
Parameters
| Type | Name | Description |
|---|---|---|
| String | fileName | File name. |
| Encoding | fallbackEncoding | Encoding to apply if it cannot be identified from DICOM directory. |
| Func<ParseState, Boolean> | stop | Stop criterion in dataset. |
| FileReadOption | readOption | The option how to deal with large DICOM tags like pixel data. |
Returns
| Type | Description |
|---|---|
| DicomDirectory | DicomDirectory instance. |
OpenAsync(Stream)
Asynchronously read DICOM Directory from stream.
Declaration
public static Task<DicomDirectory> OpenAsync(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | Stream to read. |
Returns
| Type | Description |
|---|---|
| Task<DicomDirectory> | Awaitable DicomDirectory instance. |
OpenAsync(Stream, Encoding, Func<ParseState, Boolean>, FileReadOption)
Asynchronously read DICOM Directory from stream.
Declaration
public static async Task<DicomDirectory> OpenAsync(Stream stream, Encoding fallbackEncoding, Func<ParseState, bool> stop = null, FileReadOption readOption = FileReadOption.Default)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | Stream to read. |
| Encoding | fallbackEncoding | Encoding to apply if it cannot be identified from DICOM directory. |
| Func<ParseState, Boolean> | stop | Stop criterion in dataset. |
| FileReadOption | readOption | The option how to deal with large DICOM tags like pixel data. |
Returns
| Type | Description |
|---|---|
| Task<DicomDirectory> | Awaitable DicomDirectory instance. |
OpenAsync(String)
Asynchronously read DICOM Directory.
Declaration
public static Task<DicomDirectory> OpenAsync(string fileName)
Parameters
| Type | Name | Description |
|---|---|---|
| String | fileName | File name. |
Returns
| Type | Description |
|---|---|
| Task<DicomDirectory> | Awaitable DicomDirectory instance. |
OpenAsync(String, Encoding, Func<ParseState, Boolean>, FileReadOption)
Asynchronously read DICOM Directory.
Declaration
public static async Task<DicomDirectory> OpenAsync(string fileName, Encoding fallbackEncoding, Func<ParseState, bool> stop = null, FileReadOption readOption = FileReadOption.Default)
Parameters
| Type | Name | Description |
|---|---|---|
| String | fileName | File name. |
| Encoding | fallbackEncoding | Encoding to apply if it cannot be identified from DICOM directory. |
| Func<ParseState, Boolean> | stop | Stop criterion in dataset. |
| FileReadOption | readOption | The option how to deal with large DICOM tags like pixel data. |
Returns
| Type | Description |
|---|---|
| Task<DicomDirectory> | Awaitable DicomDirectory instance. |