You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have got errors because sliceOK cannot be defined if Cportion_rt or/and img_vol[i].ImagePositionPatient[2] are float numbers. I changed some lines to find the closest distance between both.
I do not know what sliceOK is. If possible make some comments. :)
# Check DICOM file Modality
if IM.Modality == 'CT' or 'PT':
for k in range(len(M.ROIContourSequence[ROI_id].ContourSequence)):
Cpostion_rt = M.ROIContourSequence[ROI_id].ContourSequence[k].ContourData[2]
# ? generate a vector of ImagePositionPatient[2]
# usage get_ImagePositionPatient(index, img_vol)
get_ImagePositionPatient = lambda x, y: y[x].ImagePositionPatient[2]
list_get_IPP = np.zeros((num_slice,))
for i in range(num_slice): # ?? map()
list_get_IPP[i] = get_ImagePositionPatient(i, img_vol)
sliceOK = np.argmin(np.abs(Cpostion_rt - list_get_IPP))
print(sliceOK)
'''
for i in range(num_slice):
if Cpostion_rt == img_vol[i].ImagePositionPatient[2]:
sliceOK = i
break
'''
x=[]
y=[]
z=[]
m=M.ROIContourSequence[ROI_id].ContourSequence[k].ContourData
The text was updated successfully, but these errors were encountered:
Hi,
I have got errors because
sliceOK
cannot be defined ifCportion_rt
or/andimg_vol[i].ImagePositionPatient[2]
are float numbers. I changed some lines to find the closest distance between both.I do not know what sliceOK is. If possible make some comments. :)
The text was updated successfully, but these errors were encountered: