Table of Contents

Class DicomReaderOptions

Namespace
Egami.Formats.Extended.Dicom
Assembly
Egami.Formats.Extended.dll

Options for reading DICOM: which frame, what values, and which VOI transform shows a monochrome image. Pass them to Load(Stream, EgamiContext?, ReaderOptions?) or LoadFrame(int, DicomReaderOptions?, EgamiContext?).

[Experimental("EGAMIX001", UrlFormat = "https://github.com/inexin/Egami/blob/main/docs/articles/formats/dicom.md")]
public sealed record DicomReaderOptions : ReaderOptions, IEquatable<ReaderOptions>, IEquatable<DicomReaderOptions>
Inheritance
DicomReaderOptions
Implements
Inherited Members

Examples

// A window of your own, in modality values (Hounsfield units for CT), or the file's second one.
using Raster bone = Raster.Load("scan.dcm", context, new DicomReaderOptions { WindowCenter = 400, WindowWidth = 1800 });
using Raster second = Raster.Load("scan.dcm", context, new DicomReaderOptions { WindowIndex = 1 });
using Raster smooth = Raster.Load("scan.dcm", context,
    new DicomReaderOptions { WindowCenter = 40, WindowWidth = 400, WindowFunction = DicomWindowFunction.Sigmoid });

Properties

Frame

Gets the frame to load, from 0 (the default). LoadAll(Stream, EgamiContext?, ReaderOptions?) loads every frame.

public int Frame { get; init; }

Property Value

int

Exceptions

ArgumentOutOfRangeException

The value is negative.

PreferWindow

Gets whether the file's window (Window Center and Width) is used when it also has a VOI LUT Sequence. Defaults to false: the VOI LUT is used, as PS3.3 C.11.2 lets a viewer choose.

public bool PreferWindow { get; init; }

Property Value

bool

Values

Gets what the load gives. Defaults to Display.

public DicomValues Values { get; init; }

Property Value

DicomValues

WindowCenter

Gets the window center to show a monochrome image with, in modality values, instead of the file's; used with WindowWidth, and null (the default) for the file's own VOI.

public double? WindowCenter { get; init; }

Property Value

double?

WindowFunction

Gets the window function to use with WindowCenter and WindowWidth, or null (the default) for the file's VOI LUT Function, LINEAR when it has none.

public DicomWindowFunction? WindowFunction { get; init; }

Property Value

DicomWindowFunction?

WindowIndex

Gets which of the file's windows or VOI LUTs to use when it has several, from 0 (the default, the first). An index past the last uses the last.

public int WindowIndex { get; init; }

Property Value

int

Exceptions

ArgumentOutOfRangeException

The value is negative.

WindowWidth

Gets the window width to go with WindowCenter, greater than 0.

public double? WindowWidth { get; init; }

Property Value

double?

Exceptions

ArgumentOutOfRangeException

The value is not greater than 0.