DeepIVUS is a platform for deep learning based segmentation and analysis of coronary artery Intravascular Ultrasound (IVUS) images. The platform consists of a graphical user interface and serves to provide the following capabilities.
- Viewer of IVUS pullbacks
- End diastolic gating of IVUS pullbacks
- Segmentation of internal and external elastic lamina
- Automated lesion analysis
- Phenotyping of IVUS pullbacks
- Generation of IVUS pullback report
CURRENT VERSION DOES NOT SUPPORT PHENOTYPING
It is recommended to first setup a virtual environment using Anaconda or another environment manager
git clone https://github.com/dmolony3/DeepIVUS.git
cd DeepIVUS
python -m pip install .
Recommended way to install is as a virtual environment with Anaconda. On a windows computer follow the following instructions
- Download and install Anaconda from here.
- Download DeepIVUS from here.
- Download the trained weights from here and extract to the DeepIVUS folder. After extraction the files should be in the model folder contained within DeepIVUS. If not, create this folder and move the files here.
- Open Anaconda Prompt and navigate to the folder containing the model using the following command (just remember to switch "C:/Users/David/Documents/" to whereever you downloaded DeepIVUS to):
cd C:/Users/David/Documents/DeepIVUS
- Create a virtual environment with the following command:
conda create -n DeepIVUS python=3.6
- Activate the virtual environment with the following command:
conda activate DeepIVUS
- Install all the dependency packages using the following commmand:
python -m pip install .
- Run the program using the following command:
DeepIVUS gui
- After installation to use the program again you just need to repeats steps 4-8 but skip step 5 and step 7.
A Windows 11 binary is available from here https://github.com/dmolony3/DeepIVUS/releases
Model weights are accessible from here.
DeepIVUS is launced directly from the command line. This will open the GUI and functionality is explained in more detail below
DeepIVUS gui
IVUS pullbacks in DICOM (.dcm) format can be loaded. Contours are stored in a .xml format and can be loaded for display. Alternatively reading a project file (.proj) will simultaneously read in the images and contours. Images are displayed in the cross-sectional view as well as the longitudinal view. The longitudinal view can be manipulated by rotating the marker in the cross-sectional view.
End diastolic images from the pullback can be extracted by presssing the Extract Diastolic Frames button.
IVUS pullbacks can be segmented by pressing the Segment button. It is highly recommended to extract end-diastolic frames prior to segmentation. Checking the Gated Frames box will segment only the end-diastolic images. If this is unchecked segmentation will take a significantly longer time.
Contours can be manually edited by dragging anchor points.
Contours can also be drawn from scratch by pressing the Manual Contour button
After contours have been loaded or generated from segmentation lesion analysis is automatically performed. Areas of plaque burden > 40% are identified as lesions. The schematic view provides a quick visual assessment of lumen and plaque area over the entire vessel. Critical info including lesion length, minimum lumen area (MlA) and maximum plaque burden (MPB) are highlighted within this view. Clicking on the MLA or MPB will display the associated image in the cross-sectional view.
A report in the form of a text file can be generated for each frame in the pullback by pressing Write Report. If Gated Frames is checked then the report will only include the end-diastolic images. The report consists of the following variables:
Frame, Lumen area, Plaque area, Vessel area, Plaque burden, Phenotype
➡️ Next proximal image
⬅️ Next distal image
⬆️ Next (gated) proximal image
⬇️ Next (gated) distal image
h Hide contours
j Jiggle current frame
q Quit session
Alternatively to using the GUI DeepIVUS can be used directly from the command line.
deepivus --help
Usage: [OPTIONS] COMMAND [ARGS]...
Options:
--version Show the version and exit
--help Show this message and exit
Commands:
gui Launches the GUI
segment Segment IVUS images
gate Identify end diastolic images
deepivus segment --help
Usage: DeepIVUS segment dicom_path [OPTIONS]
Segment dicom file from the given dicom_path
Options:
-g, --gated Select whether only gated images should be segmented (much quicker)
-f, --fname Output filename for the contours\
--help Show this message
deepivus gate --help
Usage: DeepIVUS gate dicom_path [OPTIONS]
Write end diastolic frames from the given dicom_path
Options:
-w, --write Write gated frames as jpgs
--help Show this message
- Deep ensembles for model uncertainty