如何使用 numpy 从 RTDose(3D 阵列)计算平均剂量和最大剂量?
How to calculate mean dose and max dose from a RTDose (3D array) using numpy?
我有一个用于 RTDose 的 3D 阵列。一种用于预测,一种用于基本事实。另外,我有 OAR 面具的 3D 阵列。如何计算每个 OAR 的平均剂量和最大剂量?
考虑使用两种结构的 rts,一种是 PTV,另一种是 GTV。下面的代码用于计算 PTV 和 GTV 的平均剂量和最大剂量。在加载 rtss nifti 文件时... PTV 轮廓包含值 = 1,GTV 包含值 = 2。因此在获得这些轮廓的剂量时使用相同的方法。
import nibabel as nib
import numpy as np
rtss_fname="rtss0.nii.gz"
rtdose_fname="rtdose0.nii.gz"
rtss_img = nib.load(rtss_fname)
rtss_array=rtss_img.get_data()
rtdose_img = nib.load(rtdose_fname)
rtdose_array=rtdose_img.get_data()
dose_at_label1=rtdose_array[rtss_array==1]
dose_at_label2=rtdose_array[rtss_array==2]
print("PTV max dose ",dose_at_label1.max())
print("GTV max dose ",dose_at_label2.max())
print("PTV mean dose ",dose_at_label1.mean())
print("GTV mean dose ",dose_at_label2.mean())
我有一个用于 RTDose 的 3D 阵列。一种用于预测,一种用于基本事实。另外,我有 OAR 面具的 3D 阵列。如何计算每个 OAR 的平均剂量和最大剂量?
考虑使用两种结构的 rts,一种是 PTV,另一种是 GTV。下面的代码用于计算 PTV 和 GTV 的平均剂量和最大剂量。在加载 rtss nifti 文件时... PTV 轮廓包含值 = 1,GTV 包含值 = 2。因此在获得这些轮廓的剂量时使用相同的方法。
import nibabel as nib
import numpy as np
rtss_fname="rtss0.nii.gz"
rtdose_fname="rtdose0.nii.gz"
rtss_img = nib.load(rtss_fname)
rtss_array=rtss_img.get_data()
rtdose_img = nib.load(rtdose_fname)
rtdose_array=rtdose_img.get_data()
dose_at_label1=rtdose_array[rtss_array==1]
dose_at_label2=rtdose_array[rtss_array==2]
print("PTV max dose ",dose_at_label1.max())
print("GTV max dose ",dose_at_label2.max())
print("PTV mean dose ",dose_at_label1.mean())
print("GTV mean dose ",dose_at_label2.mean())