pub enum PhotometricInterpretation {
    Monochrome1,
    Monochrome2,
    PaletteColor,
    Rgb,
    YbrFull,
    YbrFull422,
    YbrPartial420,
    YbrIct,
    YbrRct,
    Other(String),
}
Expand description

A decoded representation of the DICOM Photometric Interpretation attribute.

See section C.7.6.3 of the standard for more details about each photometric interpretation.

In the event that the photometric interpretation is not any of the specified variants, the Other variant is used. Note that this enumeration covers the ones which are known, not necessarily supported in the decoding process.

Variants

Monochrome1

MONOCHROME1: Pixel data represent a single monochrome image plane. The minimum sample value is intended to be displayed as white.

Monochrome2

MONOCHROME2: Pixel data represent a single monochrome image plane. The minimum sample value is intended to be displayed as black.

PaletteColor

PALETTE COLOR: Pixel data describe a color image with a single sample per pixel (single image plane).

Rgb

RGB: Pixel data represent a color image described by red, green, and blue image planes.

YbrFull

YBR_FULL: Pixel data represent a color image described by one luminance (Y) and two chrominance planes (CB and CR) and as a result there are half as many CB and CR values as Y values.

YbrFull422

YBR_FULL_422: The same as YBR_FULL except that the CB and CR values are sampled horizontally at half the Y rate.

YbrPartial420

YBR_PARTIAL_420: Pixel data represent a color image described by one luminance (Y) and two chrominance planes (CB and CR). The CB and CR values are sampled horizontally and vertically at half the Y rate and as a result there are four times less CB and CR values than Y values.

YbrIct

YBR_ICT: Irreversible Color Transformation. Pixel data represent a color image described by one luminance (Y) and two chrominance planes (CB and CR).

YbrRct

YBR_RCT: Rreversible Color Transformation. Pixel data represent a color image described by one luminance (Y) and two chrominance planes (CB and CR).

Other(String)

The photometric interpretation is not one of the known variants.

Note: this value is assumed to be different from any other variant listed above, and no checks are made to ensure this assumption. The construction of PhotometricInterpretation::Other when one of the existing variants is applicable is considered a bug.

Note 2: subsequent crate versions may introduce new variants, and as a consequence break any user depending on the Other variant. If you need to depend on an unspecified variant, you should also double check the photometric interpretations here every time the crate is updated.

Implementations

Obtain a string representation of the photometric interpretation.

Get whether this photometric interpretation is one of the monochrome variants (MONOCHROME1 or MONOCHROME2).

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more