Replies: 1 comment
-
How is your clinical data represented, as a single csv document? The CSVDataset is meant for loading a list of dictionaries from the rows of a csv document, these would include the file names of images to load. What you can do is load the data with this class and then use it as the argument for the CacheDataset which then uses transforms to load your images from those given keys. Something like this: import monai
from nibabel.testing import data_path
# create example csv file pointing to nibabel test images
with open("test.csv","w") as o:
o.write(f"""image,clinical_info
{data_path}/example4d.nii.gz,something about this patient
{data_path}/example4d.nii.gz,something else entirely different
""")
transforms=monai.transforms.Compose([
monai.transforms.LoadImaged(keys="image")
# further transforms here
])
c=monai.data.CSVDataset("test.csv")
ds=monai.data.CacheDataset(c,transforms) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I am not sure if this goes under this category, but I am in the need of loading a dataset with images and clinical data, and I wanted to cache it for fast training. Unfortunately I cannot find an option in the CacheDataset to have my clinical data loaded with the image, and in the CSVDataset there is no cache mechanism, it appears. Is there any way of combining both things into a single dataset?
Thanks!
Adrian
Beta Was this translation helpful? Give feedback.
All reactions