dicom-rs
dicom-rs copied to clipboard
1-bit pixel data conversion is currently not supported
Example from pydicom tests: liver.dcm
Hi. First time contributor here.
- Am I correct that you would like to add support for when "(0028,0101) Bits Stored" is 1?
- I have worked with raw bits in rust before and it proved challenging without the help of external libraries (e.g. support for std::vector<bool>) is this ok to use?
Thank you for reaching out!
- Am I correct that you would like to add support for when "(0028,0101) Bits Stored" is 1?
Yes, this would be for handing image files where Bits Allocated (and subsequently Bits Stored) are 1. The necessary expansion from bits to bytes would happen when turning the DecodedPixelData into a vector, image, or ndarray.
- I have worked with raw bits in rust before and it proved challenging without the help of external libraries (e.g. support for std::vector
) is this ok to use?
You may be able to use bitvec. Once a byte-addressable view is obtained, it would only be a matter of making it go through the established pixel data transformation functions (Modality LUT, VOI LUT).