pub struct DecodedPixelData<'a> { /* private fields */ }
Expand description

A blob of decoded pixel data.

This is the outcome of collecting a DICOM object’s imaging-related attributes into a decoded form. The decoded pixel data samples will be stored as raw bytes in native form without any LUT transformations applied. Whether to apply such transformations can be specified through one of the various to_* methods, such as to_dynamic_image and to_vec.

Implementations

Retrieve a slice of all raw pixel data samples as bytes, irrespective of the expected size of each sample.

Retrieve a copy of all raw pixel data samples as unsigned 16-bit integers.

This is useful for retrieving pixel data with the OW value representation.

Retrieve a slice of a frame’s raw pixel data samples as bytes, irrespective of the expected size of each sample.

Retrieve a copy of a frame’s raw pixel data samples as unsigned 16-bit integers.

This is useful for retrieving pixel data with the OW value representation.

Retrieves the number of rows of the pixel data.

Retrieves the number of columns of the pixel data.

Retrieves the photometric interpretation.

Retrieves the planar configuration of the pixel data.

The value returned is only meaningful for images with more than 1 sample per pixel.

Retrieves the total number of frames in this piece of decoded pixel data.

Retrieves the number of samples per pixel.

Retrieve the number of bits effectively used for each sample.

Retrieve the number of bits allocated for each sample.

Retrieve the high bit index of each sample.

Retrieve the pixel representation.

Retrieve object’s rescale parameters.

Retrieve the VOI LUT function defined by the object, if any.

Convert the decoded pixel data of a specific frame into a dynamic image.

The default pixel data process pipeline applies the Modality LUT function, followed by the first VOI LUT transformation found in the object. To change this behavior, see to_dynamic_image_with_options.

Convert the decoded pixel data of a specific frame into a dynamic image.

The options value allows you to specify which transformations should be done to the pixel data (primarily Modality LUT function and VOI LUT function). By default, both Modality and VOI LUT functions are applied according to the attributes of the given object. Note that certain options may be ignored if they do not apply.

Example
let options = ConvertOptions::new()
    .with_voi_lut(VoiLutOption::Custom(WindowLevel {
        center: -300.0,
        width: 600.,
    }));
let img = data.to_dynamic_image_with_options(0, &options)?;

Convert all of the decoded pixel data into a vector of flat pixels of a given type T.

The underlying pixel data type is extracted based on the bits allocated and pixel representation, which is then converted to the requested type. Photometric interpretation is ignored.

The default pixel data process pipeline applies only the Modality LUT function. To change this behavior, see to_vec_with_options.

Example
// get the pixels of all frames as 32-bit modality values
let all_pixels: Vec<f32> = data.to_vec()?;

Convert all of the decoded pixel data into a vector of flat pixels of a given type T.

The underlying pixel data type is extracted based on the bits allocated and pixel representation, which is then converted to the requested type. Photometric interpretation is ignored.

The options value allows you to specify which transformations should be done to the pixel data (primarily Modality LUT function and VOI LUT function). By default, only the Modality LUT function is applied.

Convert the decoded pixel data of a frame into a vector of flat pixels of a given type T.

The underlying pixel data type is extracted based on the bits allocated and pixel representation, which is then converted to the requested type. Photometric interpretation is ignored.

The default pixel data process pipeline applies only the Modality LUT function. To change this behavior, see to_vec_frame_with_options.

Convert the decoded pixel data of a frame into a vector of flat pixels of a given type T.

The underlying pixel data type is extracted based on the bits allocated and pixel representation, which is then converted to the requested type. Photometric interpretation is considered to identify whether rescaling should be applied. The pixel values are not inverted if photometric interpretation is MONOCHROME1.

The options value allows you to specify which transformations should be done to the pixel data (primarily Modality LUT function and VOI LUT function). By default, only the Modality LUT function is applied according to the attributes of the given object. Note that certain options may be ignored if they do not apply.

Example
let options = ConvertOptions::new()
    .with_voi_lut(VoiLutOption::Custom(WindowLevel {
        center: -300.0,
        width: 600.,
    }));
// get the pixels of the first frame with 8 bits per channel
let first_frame_pixels: Vec<u8> = data.to_vec_frame_with_options(0, &options)?;

Convert all of the decoded pixel data into a four dimensional array of a given type T.

The underlying pixel data type is extracted based on the bits allocated and pixel representation, which is then converted to the requested type. Photometric interpretation is considered to identify whether rescaling should be applied. The pixel values are not inverted if photometric interpretation is MONOCHROME1.

The shape of the array will be [N, R, C, S], where N is the number of frames, R is the number of rows, C is the number of columns, and S is the number of samples per pixel.

The default pixel data process pipeline applies only the Modality LUT function described in the object, To change this behavior, see to_ndarray_with_options.

Convert all of the decoded pixel data into a four dimensional array of a given type T.

The underlying pixel data type is extracted based on the bits allocated and pixel representation, which is then converted to the requested type. Photometric interpretation is considered to identify whether rescaling should be applied. The pixel values are not inverted if photometric interpretation is MONOCHROME1.

The shape of the array will be [N, R, C, S], where N is the number of frames, R is the number of rows, C is the number of columns, and S is the number of samples per pixel.

The options value allows you to specify which transformations should be done to the pixel data (primarily Modality LUT function and VOI LUT function). By default, only the Modality LUT function described in the object is applied. Note that certain options may be ignored if they do not apply.

Convert the decoded pixel data of a single frame into a three dimensional array of a given type T.

The underlying pixel data type is extracted based on the bits allocated and pixel representation, which is then converted to the requested type. Photometric interpretation is considered to identify whether rescaling should be applied. The pixel values are not inverted if photometric interpretation is MONOCHROME1.

The shape of the array will be [R, C, S], where R is the number of rows, C is the number of columns, and S is the number of samples per pixel.

The default pixel data process pipeline applies only the Modality LUT function described in the object, To change this behavior, see to_ndarray_frame_with_options.

Convert the decoded pixel data of a single frame into a three dimensional array of a given type T.

The underlying pixel data type is extracted based on the bits allocated and pixel representation, which is then converted to the requested type. Photometric interpretation is considered to identify whether rescaling should be applied. The pixel values are not inverted if photometric interpretation is MONOCHROME1.

The shape of the array will be [R, C, S], where R is the number of rows, C is the number of columns, and S is the number of samples per pixel.

The options value allows you to specify which transformations should be done to the pixel data (primarily Modality LUT function and VOI LUT function). By default, only the Modality LUT function described in the object is applied. Note that certain options may be ignored if they do not apply.

Trait Implementations

Formats the value using the given formatter. Read more

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 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