Is there a way for me to load a list of pydicom images straight into simpleITK in python without having to save them locally first?
I’m working on a auto-segmentation project where I receive two pydicom lists ( one PET and one CT), they are in the format list<pydicom.dataset.FileDataset>. The script that runs the auto-segmentation usually takes a PET path and a CT path, but as they aren’t actually saved locally, that’s not a possibility. Is there a way for me to modify the code below, such that it takes the two lists and not two file paths?
Thank you very much
print('Reading PET..')
reader = sitk.ImageSeriesReader()
dicom_names = reader.GetGDCMSeriesFileNames(PET_path)
reader.SetFileNames(dicom_names)
reader.MetaDataDictionaryArrayUpdateOn()
reader.SetOutputPixelType(sitk.sitkFloat32)
imagePET = reader.Execute()
print('Reading CT..')
reader = sitk.ImageSeriesReader()
dicom_names = reader.GetGDCMSeriesFileNames(CT_path)
reader.SetFileNames(dicom_names)
reader.MetaDataDictionaryArrayUpdateOn()
reader.LoadPrivateTagsOn()
imageCT = reader.Execute()