MIC-DKFZ / medicaldetectiontoolkit

The Medical Detection Toolkit contains 2D + 3D implementations of prevalent object detectors such as Mask R-CNN, Retina Net, Retina U-Net, as well as a training and inference framework focused on dealing with medical images.
Apache License 2.0
1.3k stars 297 forks source link

LIDC dataloader ground truth #47

Closed Arkkienkeli closed 5 years ago

Arkkienkeli commented 5 years ago

Hi, I was wondering how to load ground truth objects if I use LIDS dataloader code. As I understood from the code of preprocessing.py and Readme, each object is loaded as a bounding box. I have multiple objects in my image, which I want to segment. Does it mean, that I should have separate .nii.gz file for each object? How the folder structure will look like?

Btw, I want to use 3D MRCNN, inputs were originally tif files, which I transformed to nrrd.

Thank you.

pfjaeger commented 5 years ago

Hi, annotations can either be loaded as bounding boxes (then you need to create pseudo masks out of the min your data loader) or as pixel-wise annotations (like in LIDC). Please look at line 236ff. of the lidc data_loader to see how to load the files and generate batches. In this case two .npy files are loaded separate for data and pixel-wise annotations for each patient. Those were created in the preprocessing.py, but you need to adapt that script to your own data set. Hope this helps.