Pixel data backend changes #1595
Replies: 1 comment 2 replies
-
I like the idea of a function with parameters such as this - a good way to integrate a number of controls together while keeping sensible defaults, and a good place to integrate documentation. However, I don't think the name is specific enough, and to me sounds like it is converting the whole Dataset to an array of some kind. I still like the word One alternative is to go back to the idea of image handling as a kind of metaclass/"module" within a Dataset. Perhaps could have
I feel like there was a good reason for not updating PixelData, but don't recall what it might have been. Maybe so original could be written out as originally compressed if person was doing read-only work with pixels but modifying other information. I'll think on it and see if anything else comes back to mind. As to pixel_data_handlers and encoders/decoders submodules, I'd again pitch the idea that these not be user-facing (used internally within pydicom), with user code operating instead through a meta-class within Dataset.
All of these change areas are used extensively enough that I think 4.0 would definitely be better. And maybe even things like |
Beta Was this translation helpful? Give feedback.
-
I'm working on rewriting the pixel data backend and would like some feedback on my current plan:
Dataset
Dataset.as_array()
function to return bulk data elements (pixel data, float pixel data, double float pixel data, overlay data, waveform data) as anndarray
:data element. Deprecate
Dataset.waveform_array()
andDataset.overlay_array()
in favour ofas_array()
, removal in v3.0.Dataset.asarray()
for consistency with numpy and pillow,Dataset.to_array()
,Dataset.bulk_data_array()
Dataset.waveform_array()
andDataset.overlay_array()
?Dataset.decompress()
to convert a compressed dataset to an uncompressed oneDataset.pixel_array
as-is, the raw [Float/Double Float] Pixel Data as found in the dataset, but switch to using the new backend in v3.0.Dataset.convert_pixel_data()
for removal in v3.0.Dataset._convert_pixel_data_using_handler()
,Dataset._convert_pixel_data_without_handler()
,Dataset._do_pixel_data_conversion()
pixel_data_handlers
pixels
module to make importing pixel utility functions simper and to match thewaveforms
andoverlays
module naming:decoders
pixels.decoders
module that functions similarly to theencoders
module, replacespixel_data_handlers
encoders
encoders
topixels.encoders
, deprecate old path for removal in v3.0.I realise it's quite late in the version cycle to remove some of these, so maybe v4.0 would be better?
Beta Was this translation helpful? Give feedback.
All reactions