I am completely new to CT image world. So thank you in advance I have two dicom series of Same patient. For both of the series, first slice information is
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
. I want to overlap Series 2 on series 1.
But to overlap they have to share same coordinates as per my understanding. Also there is difference of pixel spacing and number of files. So my question is:
How to overlap two series ?
How to match Indices. As both series has different number of slices. For example, In series 1, a slice index is 220 or Z value is -976, How to get the the Z value or the Index in Series 2 of that particular slice of series 1?
I am using pydicom python package. Any example code or the idea to handle this problem would be great :)
Edit: sitk.resample code I am using
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)