trans_coco.py can be used to change MRI-dataset to the COCO dataset format, and trans_middle.py is used to change MRI dataset to the middle format defined in mmdetection.
The structure of our original dataset is as follow:
|-meta_data
|----annotations
|--------xxx.label.nrrd
|----imgs
|--------xxx(DICOM data of per patient)
|----normal
Before you run the code, please change root_path to the root path where you store the dataset.