dicom-rs icon indicating copy to clipboard operation
dicom-rs copied to clipboard

1-bit pixel data conversion is currently not supported

Open Enet4 opened this issue 2 years ago • 2 comments

Example from pydicom tests: liver.dcm

Enet4 avatar May 13 '23 14:05 Enet4

Hi. First time contributor here.

  1. Am I correct that you would like to add support for when "(0028,0101) Bits Stored" is 1?
  2. 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?

ChayceJRoss avatar Nov 06 '24 21:11 ChayceJRoss

Thank you for reaching out!

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

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

Enet4 avatar Nov 07 '24 09:11 Enet4