Closed rohanbanerjee closed 9 months ago
hey you are right, the formatting of dataset.json
is the issue here. Here's the example:
{
"description": "sci-colorado",
"labels": {
"0": "background",
"1": "soft-sc-seg"
},
"license": "nk",
"modality": {
"0": "MRI"
},
"name": "spine-generic",
"numTest": 80,
"reference": "University of Zurich",
"tensorImageSize": "3D",
"test": [
{
"image": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/sub-5425/anat/sub-5425_T2w.nii.gz",
"label": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/derivatives/labels/sub-5425/anat/sub-5425_T2w_seg-manual.nii.gz"
},
{
"image": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/sub-6036/anat/sub-6036_T2w.nii.gz",
"label": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/derivatives/labels/sub-6036/anat/sub-6036_T2w_seg-manual.nii.gz"
},
{
"image": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/sub-6505/anat/sub-6505_T2w.nii.gz",
"label": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/derivatives/labels/sub-6505/anat/sub-6505_T2w_seg-manual.nii.gz"
}
],
"train": [
{
"image": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/sub-6004/anat/sub-6004_T2w.nii.gz",
"label": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/derivatives/labels/sub-6004/anat/sub-6004_T2w_seg-manual.nii.gz"
},
{
"image": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/sub-6363/anat/sub-6363_T2w.nii.gz",
"label": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/derivatives/labels/sub-6363/anat/sub-6363_T2w_seg-manual.nii.gz"
},
{
"image": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/sub-6184/anat/sub-6184_T2w.nii.gz",
"label": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/derivatives/labels/sub-6184/anat/sub-6184_T2w_seg-manual.nii.gz"
},
{
"image": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/sub-5660/anat/sub-5660_T2w.nii.gz",
"label": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/derivatives/labels/sub-5660/anat/sub-5660_T2w_seg-manual.nii.gz"
},
{
"image": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/sub-6162/anat/sub-6162_T2w.nii.gz",
"label": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/derivatives/labels/sub-6162/anat/sub-6162_T2w_seg-manual.nii.gz"
},
{
"image": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/sub-6186/anat/sub-6186_T2w.nii.gz",
"label": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/derivatives/labels/sub-6186/anat/sub-6186_T2w_seg-manual.nii.gz"
},
"image": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/sub-5844/anat/sub-5844_T2w.nii.gz",
"label": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/derivatives/labels/sub-5844/anat/sub-5844_T2w_seg-manual.nii.gz"
},
{
"image": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/sub-5755/anat/sub-5755_T2w.nii.gz",
"label": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/derivatives/labels/sub-5755/anat/sub-5755_T2w_seg-manual.nii.gz"
},
{
"image": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/sub-5543/anat/sub-5543_T2w.nii.gz",
"label": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/derivatives/labels/sub-5543/anat/sub-5543_T2w_seg-manual.nii.gz"
}
],
"validation": [
{
"image": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/sub-5725/anat/sub-5725_T2w.nii.gz",
"label": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/derivatives/labels/sub-5725/anat/sub-5725_T2w_seg-manual.nii.gz"
},
{
"image": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/sub-5692/anat/sub-5692_T2w.nii.gz",
"label": "/home/GRAMES.POLYMTL.CA/u114716/datasets/sci-colorado/derivatives/labels/sub-5692/anat/sub-5692_T2w_seg-manual.nii.gz"
}
]
}
let me know if you are still having issues. The create_msd_data.py
has the code to create similar json files
Just to have a clearer picture, the dataset need not be in the MSD format. We just need a json file like the above to able to feed the data to main.py
. Am I missing something here?
the dataset need not be in the MSD format
Exactly! The bids datasets we have would totally work!
We just need a json file like the above to able to feed the data to main.py.
Correct. Just image-label pairs and some boilerplate code just to make the load_decathlon_datalist function happy. A similar datalist creation process can also be found in monai's tutorial here.
This issue is now solved. Thank you for the help!
Hello, I am trying to use the script --
main.py
in the directory monai which is currently under the branch sb/remove_crop_preprocessing.I am using the following
dataset.json
for the script (a small sample)I am using the command:
python main.py --model nnunet -me 1
Error:TypeError: Every item in items must be a dict but got str.
To reproduce this error:
duke/temp/rohan/fmri_sc_seg/monai
python main.py --model nnunet -me 1
Could you provide me with the
dataset.json
used for thecontrast-agnostic
project or let me know if there is a fix for this issue if you have faced it before. I strongly feel it is due to the formatting of the thedataset.json
file that I am using. (tagging @naga-karthik, @valosekj)Thanks!