Install a python 3.6 environment using conda
- Install
gdcm
using command
conda install -c conda-forge gdcm
-
Install majority of packages using command
pip install -r requirements.txt
-
Install
pytorch
using command conda install
pytorch-cpu==1.1.0 torchvision-cpu==0.3.0 cpuonly -c pytorch
Or follow this link to install pytorch 1.1.0
.
- Install
pyradiomics
from source using command
git clone git://github.com/Radiomics/pyradiomics
For unix like systems (MacOSX, linux):
cd pyradiomics
python -m pip install -r requirements.txt
python setup.py install
python setup.py build_ext --inplace
For Windows:
cd pyradiomics
python -m pip install -r requirements.txt
python setup.py install
- (HELPER) If you run into problem described by this link when extracting features, you can replace the files in
anaconda\envs\<env_name>\lib\site-packages\radioimcs\
with the corresponding files we provided in folder radiomics_patch.
- Place unsegmented dicom image series in a folder (e.g.
<dcm>
), and arrange the dicom series in the following way:
<dcm>
├───<patient_id>
│ └───<study_uid>
│ └───<series_uid>
│ ├───000001.dcm
│ ├───000002.dcm
│ ├───...
│ └───000333.dcm
├───<patient_id>
│...
- Convert segmentation mask images into PNG format, named them in a sequence of numbers (e.g.
000.png
,001.png
, …,332.png
), and place them in another folder (e.g.<seg>
) for segmentation, and arrange them in the following way:
<seg>
├───<patient_id>
│ └───<study_uid>
│ └───<series_uid>
│ ├───000.png
│ ├───001.png
│ ├───...
│ └───332.png
├───<patient_id>
│...
-
Open terminal in root directory of the prediction pipeline.
-
Activate the conda environment in the terminal.
-
Extract radiomics features using the following command:
python proc_radiomic_feature.py --dicom_root <dcm> --lesion_mask_root <seg> --save_root <save_root>
- Extracted features will be saved in the
<save_root>
directory with file name: “final_merge_feature.csv
”.
- For radiomics-only models (
Radiom
), use command
python COVID-19_prediction.py --radiomics_data <save_root\final_merge_feature.csv>
- For models that include clinical symptoms, demographics and lab test results (
RadioClinLab
), you can prepare an additional CSV input, according to “example_lab_input.csv
” (refer to the “units.txt
” for units and meanings of the entries). This file should also be placed into the root directory of the prediction pipeline (<project_root>\<lab_input.csv>
). - To use the “
RadioClinLab
” model, use the command line code
python COVID-19_prediction --radiomics_data <save_root\final_merge_feature.csv> --lab_data <lab_input.csv>