我正在读取一个 dicom 图像并访问它的像素阵列。之后,使用 sitk.Write 将该数组再次保存为 dicom 格式,但是要读取的原始图像与写入后的相同图像之间存在差异。如何获得相同的图像显示。我正在使用 Radiant Viewer 来可视化 Dicom 图像。我想要与输入相同的输出。下面给出了代码以及输入和输出图像:
# Reading a dicom image
Image = pydicom.dcmread('Input.dcm')
output = Image.pixel_array
#Saving the image into another folder
img = sitk.GetImageFromArray(output)
sitk.WriteImage(img, 'output.dcm' )