dicom文件处理
-
提取ct文件 / mr文件 / dose文件 / rt structure 文件
-
提取指定ROI勾画和对应的CT或MR图像,重采样到指定大小,存为
.nii
文件
from ifree import dicom
# get paths for CT, MR, DOSE and RT
fileDir = "./p/"
ctfiles, rtfile, mrfiles, dosefile, patientID = dicom.GetFilePath(fileDir)
# get MRs or CTs related to RT and copy them to new dir
patientNames, patientIDs, id2mrs, id2rt = archiveFiles(old_Dir, new_Dir)
# crop ROI-MASK and its CT or MR
roiName = "ctv"
newDir = "./p/"
newSize = [100, 100, 100] # leave None to get origin size
cropROI(id2mrs, id2rt, roiName, newSize, newDir)