Replies: 1 comment 6 replies
-
When you apply a dictionary transform with a certain set of specified keys, the transform will be applied to the dictionary values with those, keys, and all other dictionary values are left untouched. Those other keys could perhaps be manipulated by a different transform later in your transform pipeline.
You could write your own transform that loads the json file into a dictionary object, for example using the json library.
|
Beta Was this translation helpful? Give feedback.
-
Hello, I have my dataset file in the following format. I wrote my dataset in such a format because I want to use the cache dataset
{ "Train": [ { "image": "dicom_image.dcm", "label": [ "annotation_file.json" ] },
When I try to read the images using
LoadImaged(keys=["image"], image_only=True)
. I get the following outputMy question is if I use the
keys="image"
, shouldn't the output be just the image (and not the contents of the other keys'label'
. Here is a working version of the code. I changed the filenames.In an ideal scenario, I would like the Loading function to give the output as the images and a dictionary with the contents of the annotations.json file, but I dont think there is a support for a json file reader in LoadImaged.
Any thoughts on this issue.
Thanks
Vikash
Beta Was this translation helpful? Give feedback.
All reactions