A possible feature: save pixels position in dcmread to enable gpu direct dicom file loading #2191
Replies: 3 comments
-
Get the offset to the start of the Pixel Data value without loading the actual image data into memory: >>> from pydicom import examples, dcmread
>>> path = examples.get_path("ct")
>>> ds = dcmread(path, defer_size="100 KB") # Don't read large element values into memory
>>> ds.get_item(0x7FE00010, keep_deferred=True).value_tell
6300
>>> type(ds._dict[0x7FE00010])
<class 'pydicom.dataelem.RawDataElement'> |
Beta Was this translation helpful? Give feedback.
-
Thanks @scaramallion , it works well.
I closed the draft PR since there is no need to do that. |
Beta Was this translation helpful? Give feedback.
-
Hi @scaramallion , I think the GDS + pydicom application for faster loading could be a feature, or at least a tutorial contribution for the repository. Do you thinks it's fine to let me contribute it? If so, I will following the contribution guide and submit a formal PR. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi pydicom maintainers,
I did some research on pydicom source code, and found that it's feasible to enable GPU Direct Storage to accelerate data loading.
Via using kvikio, we can load a dicom file from disk into GPU directly. If we know the position of pixels, it's easy to parse loaded bytes into a pixel array.
A draft PR is submitted to show the potential changes: #2189
and later I will also post some experiment code on how to make use of the changes and accelerate dicom image loading with GPU.
Welcome to discuss about if it's fine to enable this feature, thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions