Repository navigation
Converting clinical DICOM into an nnU-Net-ready dataset (Med-ImageNet) #3061
JoshuaSiraj
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi all,
We wanted to share a part of our Med-ImageNet project that makes going from clinical DICOM to an nnU-Net-ready dataset easier.
With clinical data, the work before
nnUNetv2_plan_and_preprocesscan be surprisingly time-consuming: identifying the relevant imaging series, linking RTSTRUCTs to CTs, dealing with inconsistent ROI names, converting segmentations, and generating the expectedimagesTr/labelsTr/dataset.jsonstructure.Med-ImageNet was developed within Cancer Digital Intelligence (CDI) in collaboration with the BHK Lab at University Health Network, specifically through use of their open-source Med-ImageTools package. The steps below use its
imgtools nnunet-pipelinecommand, and the workflow is:DICOM → ROI mapping → nnU-Net dataset
1. Install
2. Inspect your data and define your ROI mapping
Index the DICOM data and inspect how the imaging and RTSTRUCTs are linked:
Then map the ROI names found in your data to the labels you want, using strings or regular expressions:
The YAML keys become the labels in the resulting nnU-Net dataset.
3. Run the pipeline
This produces a standard nnU-Net dataset:
The generated
nnunet_preprocess.shalready contains the required nnU-Net environment variables and the dataset ID, so you can move directly to preprocessing:This doesn't modify nnU-Net itself. It's a preprocessing and conversion layer around the clinical DICOM → nnU-Net workflow. Full documentation is here.
We'd love feedback from anyone who has had to get DICOM data into nnU-Net: whether this fits how you prepare your own datasets, and what we might be missing.
To learn more about the wider project, see medimagenet.com.
Thanks!
All reactions