Questions tagged «dicom»

2
如何使用pydicom创建JPEG压缩的DICOM数据集?
我正在尝试使用pydicom创建JPEG压缩的DICOM图像。可以在此处找到有关彩色DICOM图像的不错的原始资料,但这主要是理论和C ++。在下面的代码示例中,我在内部创建了一个淡蓝色的省略号output-raw.dcm(未压缩),如下所示: import io from PIL import Image, ImageDraw from pydicom.dataset import Dataset from pydicom.uid import generate_uid, JPEGExtended from pydicom._storage_sopclass_uids import SecondaryCaptureImageStorage WIDTH = 100 HEIGHT = 100 def ensure_even(stream): # Very important for some viewers if len(stream) % 2: return stream + b"\x00" return stream def bob_ross_magic(): image = …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.