Table of Contents

Class DicomDirectory

Namespace
FellowOakDicom.Media
Assembly
fo-dicom.core.dll

Class for managing DICOM directory objects.

public class DicomDirectory : DicomFile
Inheritance
DicomDirectory
Inherited Members
Extension Methods

Constructors

DicomDirectory(bool)

Initializes a new instance of the DicomDirectory class.

public DicomDirectory(bool explicitVr = true)

Parameters

explicitVr bool

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

[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

bool

FileSetID

Gets or sets the file set ID.

public string FileSetID { get; set; }

Property Value

string

Exceptions

ArgumentException

If applied file set ID is null or empty.

MediaStorageSOPInstanceUID

Gets or sets the media storage SOP instance UID.

public DicomUID MediaStorageSOPInstanceUID { get; set; }

Property Value

DicomUID

RootDirectoryRecord

Gets the root directory record.

public DicomDirectoryRecord RootDirectoryRecord { get; }

Property Value

DicomDirectoryRecord

RootDirectoryRecordCollection

Gets the root directory record collection.

public DicomDirectoryRecordCollection RootDirectoryRecordCollection { get; }

Property Value

DicomDirectoryRecordCollection

SourceApplicationEntityTitle

Gets or sets the source application entity title.

public string SourceApplicationEntityTitle { get; set; }

Property Value

string

Methods

AddFile(DicomFile, string)

Add new file to DICOM directory.

public DicomDirectoryEntry AddFile(DicomFile dicomFile, string referencedFileId = "")

Parameters

dicomFile DicomFile

DICOM file to add.

referencedFileId string

Referenced file ID.

Returns

DicomDirectoryEntry

OnSave()

Method to call before performing the actual saving.

protected override void OnSave()

Open(Stream)

Read DICOM Directory.

public static DicomDirectory Open(Stream stream)

Parameters

stream Stream

Stream to read.

Returns

DicomDirectory

DicomDirectory instance.

Open(Stream, Encoding, Func<ParseState, bool>, FileReadOption, int)

Read DICOM Directory from stream.

public static DicomDirectory Open(Stream stream, Encoding fallbackEncoding, Func<ParseState, bool> stop = null, FileReadOption readOption = FileReadOption.Default, int largeObjectSize = 0)

Parameters

stream Stream

Stream to read.

fallbackEncoding Encoding

Encoding to apply if it cannot be identified from DICOM directory.

stop Func<ParseState, bool>

Stop criterion in dataset.

readOption FileReadOption

The option how to deal with large DICOM tags like pixel data.

largeObjectSize int

Custom limit of what are large values and what are not. If 0 is passend, then the default of 64k is used.

Returns

DicomDirectory

DicomDirectory instance.

Open(string)

Read DICOM Directory.

public static DicomDirectory Open(string fileName)

Parameters

fileName string

File name.

Returns

DicomDirectory

DicomDirectory instance.

Open(string, Encoding, Func<ParseState, bool>, FileReadOption, int)

Read DICOM Directory.

public static DicomDirectory Open(string fileName, Encoding fallbackEncoding, Func<ParseState, bool> stop = null, FileReadOption readOption = FileReadOption.Default, int largeObjectSize = 0)

Parameters

fileName string

File name.

fallbackEncoding Encoding

Encoding to apply if it cannot be identified from DICOM directory.

stop Func<ParseState, bool>

Stop criterion in dataset.

readOption FileReadOption

The option how to deal with large DICOM tags like pixel data.

largeObjectSize int

Custom limit of what are large values and what are not. If 0 is passend, then the default of 64k is used.

Returns

DicomDirectory

DicomDirectory instance.

OpenAsync(Stream)

Asynchronously read DICOM Directory from stream.

public static Task<DicomDirectory> OpenAsync(Stream stream)

Parameters

stream Stream

Stream to read.

Returns

Task<DicomDirectory>

Awaitable DicomDirectory instance.

OpenAsync(Stream, Encoding, Func<ParseState, bool>, FileReadOption, int)

Asynchronously read DICOM Directory from stream.

public static Task<DicomDirectory> OpenAsync(Stream stream, Encoding fallbackEncoding, Func<ParseState, bool> stop = null, FileReadOption readOption = FileReadOption.Default, int largeObjectSize = 0)

Parameters

stream Stream

Stream to read.

fallbackEncoding Encoding

Encoding to apply if it cannot be identified from DICOM directory.

stop Func<ParseState, bool>

Stop criterion in dataset.

readOption FileReadOption

The option how to deal with large DICOM tags like pixel data.

largeObjectSize int

Custom limit of what are large values and what are not. If 0 is passend, then the default of 64k is used.

Returns

Task<DicomDirectory>

Awaitable DicomDirectory instance.

OpenAsync(string)

Asynchronously read DICOM Directory.

public static Task<DicomDirectory> OpenAsync(string fileName)

Parameters

fileName string

File name.

Returns

Task<DicomDirectory>

Awaitable DicomDirectory instance.

OpenAsync(string, Encoding, Func<ParseState, bool>, FileReadOption, int)

Asynchronously read DICOM Directory.

public static Task<DicomDirectory> OpenAsync(string fileName, Encoding fallbackEncoding, Func<ParseState, bool> stop = null, FileReadOption readOption = FileReadOption.Default, int largeObjectSize = 0)

Parameters

fileName string

File name.

fallbackEncoding Encoding

Encoding to apply if it cannot be identified from DICOM directory.

stop Func<ParseState, bool>

Stop criterion in dataset.

readOption FileReadOption

The option how to deal with large DICOM tags like pixel data.

largeObjectSize int

Custom limit of what are large values and what are not. If 0 is passend, then the default of 64k is used.

Returns

Task<DicomDirectory>

Awaitable DicomDirectory instance.