jrkerns / pylinac

An image analysis library for medical physics
https://pylinac.readthedocs.io/en/latest/
MIT License
153 stars 98 forks source link

About PixelData. #299

Closed Wuhaotiandl closed 3 years ago

Wuhaotiandl commented 4 years ago

Thanks for your contributions. I have a question It's special MR dcm image and it's PixelData is like this: b'\xfe\xff\x00\xe0\x00\x00\x00\x00\xfe\xff\x00\xe0z]\x00\x00\xff\xd8\xff\xfe\x004Intel(R) IPP JPEG encoder [7.0.998] - Sep 1 2010\x00\xff\xc3\x00\x0b\x0c\x00\xc0\x00\xc0\x01\x00\x11\x00\xff\xc4\x00 \x00\x01\x00\x01\x04\x03\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x08\x06\x07\t\n\x04\x05\x0b\x03\x0c\x02\x01\xff\xda\x00\x08\x01\x00\x00\x01\x00\x00\xfc\xff\x00\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf4D\xf3\xbb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03b\xee\x9d\xafH\x00\x00\x00\x00\x00\x00\x03\xd0\x02\xddX\x9e\xb7\xb0\xb8\x16b\xc6\xcd\x0bq\xa6`\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x006\r\xb7=_Ki\xee\xc4\xe4\xa2\xf5\xb6\x00\x00\x00\x00\x00\x00\x07\xaa\xae6\xb1\xcfm\xa8:n\xa4\xaak\x1b\x8d\xdeRw\xdb\xfb\xd1\x8c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03d\x9bmh:J\xd2\xd7\xf1\xbe\xbc\xeb\xebue\xe7}\xa78\x00\x00\x00\x00\x00\x03\xd1v.\xdahab;\x7f\xad\x05^U\xfd\xb7\xdb\x97\xda\xcc\xbb\x97\xa28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1bm\xf1\xa0\xc5\x9a\xe4w}/I\xd5\xd4\x94\xff\x00{u\xee\xb7\x0ecj..." How can I analysis this pixeldata ?

jrkerns commented 4 years ago

Wuhaotiandl, This is likely a question for the pydicom forums: https://groups.google.com/forum/#!forum/pydicom. Pylinac uses pydicom under the hood. If you want to use this image in pylinac you can try the image.load() function like so:

from pylinac.core import image
image.load('your file.dcm')
# do whatever you want

@darcymason