You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We find that the data structure of the segmentation is different from the standard dicom file.
We wonder how to read the pixel data in the segmentation by python code?
We use PyDicom module to do this.
I wish you can help us, Thank you very much!
The text was updated successfully, but these errors were encountered:
Hi - the segmentation object will have a PixelData like other objects, but it will be a multiframe with multiple segments concatenated. You need to be able to parse the other header fields to know how the pixels are encoded. I don't think we currently have a pydicom implementation of this, but it's definitely possible to do.
Here's some javascript code that should give you an idea:
@RitchieAlpha we added the functionality to pydicom to unpack PixelData of the segmentation objects. You can see the details of how it is implemented here: pydicom/pydicom#627. That PR was merged in the end of April, so you should be able to access it from pydicom installed from source, at least.
Note that this functionality just unpacks the individual frames. If you want to reconstruct the volumes of the individual segments, you will need to take a look at the shared and per-frame attributes for image positon, orientation and spacing for the individual frames, and you will also need to look at the segment number corresponding to the individual frames. But hopefully this won't be too hard.
If you have specific questions, or if you have suggestions as to how pydicom functionality could be improved - please let us know!
We find that the data structure of the segmentation is different from the standard dicom file.
We wonder how to read the pixel data in the segmentation by python code?
We use PyDicom module to do this.
I wish you can help us, Thank you very much!
The text was updated successfully, but these errors were encountered: