Segmentor is a deep learning segmentation engine.
# activate conda
conda activate
# clone the repository
git clone https://github.com/inqlee0704/segmentor.git
# Install packages
cd segmentor
python -m pip install -r requirements.txtPredict and save segmentation results.
- model file: RESULTS/lobe/ZUNet.pth
- dicom: {subj_path}/dicom/
- in file: ProjSubjListDCM.in (if you want to run multiple cases)
# Infer one case (lobes)
python run_inference --mask=lobes --model=ZUNet --subj_path=25 --parameter_path=RESULTS/lobes/ZUNet.pth --pp=True --multi_channel=True
# Infer one case (airway)
python run_inference --mask=airway --model=UNet --subj_path=25 --parameter_path=RESULTS/airway/UNet.pth --pp=False --multi_channel=False
# Infer a list of cases
python run_inference --in_file_path=TE_ProjSubjListDCM.in- mask: [airway, lobes, lung, vessels]
- model: [UNet, ZUNet]
- subj_path: Subject folder which has a dicom folder
- parameter_path: path to the *.pth
- pp: postprocessing [True, False]
- {model}_{mask}.img.gz
- {model}_{mask}.hdr.gz
Calculate segmentation accuracy using the mask from the 'run_inference.py' and ground truth.
- predicted mask: *.img.gz & *.hdr
- label: *.img.gz & *.hdr
- Get VIDA_sheet.csv
- Download VIDA_sheet as a .csv from either google drive or one drive.
- save as VIDA_sheet.csv
- Get ProjSubjList.in
cd utils
python get_ProjSubjList.py /d/ENV18PM/VIDA_sheet_20220120.csv /d/ENV18PM/ENV18PM_ProjSubjList_20220120.in /d/ENV18PM/ImageData- Convert dicom to analyze
python convert_dcm2img.py /d/ENV18PM/ENV18PM_ProjSubjList_20220120.inpython main.py- mask: airway, vessels, lung, lobe
- model: UNet, ZUNet
- debug: True, False
- save: True, False
- lr: learning rate
- train_bs: train batch size
- valid_bs: valid batch size
- epochs: train epoch
- n_case: number of cases to use