For some reason some DICOMs are encoded with some propietary format...
First need to encode these:
find . -name '*.dcm' | xargs -n1 -P8 -I{} bash -c 'f={}; gdcmconv --raw -F $f ${f/.dcm/_raw.dcm}'
After converting to normal
DICOMs we can finally decode to PNG:
find . -name '*_raw.dcm' | xargs -n1 -P8 -I{} bash -c 'f={}; dcmj2pnm $f | convert - ${f/_raw.dcm/.png}'
Finally we have a lot of PNGs decoded from the dicom files. :)
Setup a virtual env:
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- Run
process_data_dir.py
- Run
process_annotations.py
- Run
create_coco.py
- Run
visualize.py
# to visualize