This repository provides the material necessary to run inference on a DICOM coronary angiography video of the algorithms constituting DeepCoro, described in the paper titled "Evaluation of Stenoses Using AI Video Models Applied to Coronary Angiographies". Models for the primary anatomic struction classification (Algorithm 1) and stenosis detection (Algorithm 2) could not be made public. Therefore, coronary arteries viewed and stenoses need to be manually identified in an input csv file.
The input folder dcm_input/
contains the following inputs:
- Your DICOMs to run inference on. The DICOM on which inference is ran must:
- Contain information about:
- Imager Pixel Spacing
- Distance Source To Detector
- Distance Source To Patient
- Recommended Display Frame Rate
- Study Date
- Patient's Birth Date
- Display the right coronary arteries (RCA) or the left coronary arteries (LCA).
- Be aquired at 15 frames per seconds.
- Contain information about:
- An input csv file named
input_file.csv
that contains 7 columns:- dicom_path: The path to the DICOM on which you want to run inference.
- artery_view: The manual identification of the coronary arteries viewed in the coronary angiography (RCA or LCA).
- frame: Frame index at which a stenosis has been detected.
- x1: Lower-valued x-coordinate of the rectangle's corner identifying the stenosis location.
- y1: Lower-valued y-coordinate of the rectangle's corner identifying the stenosis location.
- x2: Higher-valued x-coordinate of the rectangle's corner identifying the stenosis location.
- y2: Higher-valued y-coordinate of the rectangle's corner identifying the stenosis location.
Example of input_file.csv
:
dicom_path | artery_view | frame | x1 | y1 | x2 | y2 |
---|---|---|---|---|---|---|
dicom1.dcm | RCA | 50 | 122 | 214 | 211 | 303 |
dicom1.dcm | RCA | 62 | 195 | 84 | 284 | 173 |
dicom2.dcm | LCA | 21 | 30 | 105 | 51 | 159 |
dicom2.dcm | LCA | 34 | 259 | 110 | 305 | 187 |
dicom2.dcm | LCA | 60 | 203 | 217 | 248 | 276 |
The outputs are generated from inference in a folder results/
which contains the following outputs:
- Registered videos of detected stenoses with the identification of the stenosis location, its associated coronary artery segment and its percentage of obstruction.
- A
df_stenosis.csv
file where, for each output registered video, there is information about:- dicom_path: Path to the DICOM on which inference is run.
- video_path: Path of the ouput video.
- frame: Reference frame used for registration.
- box: Coordinates of the input stenosis box.
- box_resized: Coordinates of the resized stenosis box (displayed in the video).
- artery_segment: Coronary artery segment on which the stenosis has been identified.
- percent_stenosis: Percentage of obstruction predicted.
- severe_stenosis: Mention of if the stenosis is severe or not according to our predetermined threshold.
To run inference on DICOMs identified in your input csv file, you must run the following command in a terminal:
- Clone the DeepCoro repository:
git clone https://github.com/HeartWise-AI/DeepCoro.git
- Place your input files in the
dcm_input/
input folder created (seeInput folder
section above). - Build the docker that contains the environment on which inference will be run, and all the weights and files necessary for the task. In the repository, run:
docker build -t deepcoro_inference .
- Run inference:
- To run on CPU:
docker run -v /path/to/dcm_input:/dcm_input -v /path/to/results:/results deepcoro_inference
- To run on GPU:
docker run --gpus all -v /path/to/dcm_input:/dcm_input -v /path/to/results:/results deepcoro_inference
where
- /path/to/dcm_input: The path to the input folder
dcm_input/
(seeInput folder
section above). - /path/to/results: The path to the output folder
results/
(seeOutput folder
section above).
Trained models are available on HuggingFace to perform inference: DeepCoro models
Labrecque Langlais, E., Corbin, D., Tastet, O., Hayek, A., Doolub, G., Mrad, S., Tardif, J.-C., Tanguay, J.-F., Marquis-Gravel, G., Tison, G., Kadoury, S., Le, W., Gallo, R., Lesage, F, & Avram, R. Evaluation of Stenoses Using AI Video Models Applied to Coronary Angiographies, 23 November 2023, PREPRINT (Version 1) available at Research Square [https://doi.org/10.21203/rs.3.rs-3610879/v1]
@article{avram2023evaluation,
title={Evaluation of Stenoses Using AI Video Models Applied to Coronary Angiographies},
author={Labrecque Langlais, E. and Corbin, D. and Tastet, O. and Hayek, A. and Doolub, G. and Mrad, S. and Tardif, J.-C. and Tanguay, J.-F. and Marquis-Gravel, G. and Tison, G. and Kadoury, S. and Le, W. and Gallo, R. and Lesage, F. and Avram, R.},
year={2023}
}