我对CT图像世界完全陌生。所以先谢谢你 我有两个相同患者的dicom系列。 对于这两个系列,第一个切片信息均为
Series 1
'ImagePositionPatient',
['-205.0966796875', '-384.0966796875', '-1496.5']
'Pixelspacing',['0.806640625', '0.806640625']
slice Thickness' 2mm
Image Orientation (Patient)['1', '0', '0', '0', '1', '0']
Series 2
'ImagePositionPatient',
['-171.650390625', '-356.650390625', '-1099.7']
'Pixelspacing', ['0.69921875', '0.69921875']
'slice Thickness', 2mm
Image Orientation (Patient)['1', '0', '0', '0', '1', '0']
In both series slices are of 512*512 in size
。 我想将系列2与系列1重叠。
但根据我的理解,要重叠,它们必须共享相同的坐标。像素间距和文件数量也有所不同。所以我的问题是:
如何重叠两个系列?
如何匹配指数。由于两个系列的切片数量不同。 例如,在系列1中,切片索引为220或Z值为-976,如何获取系列1中该特定切片的Z值或在系列2中的索引?
我正在使用pydicom python软件包。任何示例代码或解决此问题的想法都将很棒:)
编辑:我正在使用的sitk.resample代码
def resample_image(self,itk_image, ref_imge, is_label=False):
original_spacing = itk_image.GetSpacing()
original_size = itk_image.GetSize()
out_spacing = ref_imge.GetSpacing()
out_size = ref_imge.GetSize()
resample = sitk.ResampleImageFilter()
resample.SetOutputSpacing(out_spacing)
resample.SetSize(out_size)
resample.SetOutputDirection(itk_image.GetDirection())
resample.SetOutputOrigin(ref_imge.GetOrigin())
resample.SetTransform(sitk.Transform())
resample.SetDefaultPixelValue(itk_image.GetPixelIDValue())
if is_label:
resample.SetInterpolator(sitk.sitkNearestNeighbor)
else:
resample.SetInterpolator(sitk.sitkLinear)#sitkBSpline)
return resample.Execute(itk_image)
答案 0 :(得分:1)
听起来您想将一个图像重新采样到另一个图像上,以便它们具有匹配的像素尺寸和大小。如果是这样,则可以使用ResampleImageFilter或Resample函数。这是他们的文档页面。
过滤器: https://itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1ResampleImageFilter.html
功能: https://itk.org/SimpleITKDoxygen/html/namespaceitk_1_1simple.html#ab02a58cf3633d810fac5821749b49a74
基本思想是建立一个图像的图像坐标系,然后告诉Resample使用该系统对另一图像进行采样。