The main goal of this repository is to provide an “easy to use” tool that can be used to detect the patients’ view position in chest x-ray images. So far, it is able to differentiate between frontal
, lateral
and non chest images.
The original implementation of this program has been programmed in Python using the Pytorch deep learning toolkit and the fast.ai library. However, installing deep learning libraries in certain settings can be cumbersome or not convenient. We have simplified this process by encapsulating all the heavy lifting inside a Docker container.
Please follow the guide to install Docker for your operating system:
If you are on Linux a want to use the GPU capabilities of your local machine, please be sure that you install the nvidia-docker (version 2.0) packages. For this particular problem, we discourage it, as in most of our experiments, the software runs in less than 10 seconds without using the GPU.
A Python installation. Then, install all the required packages using pip
as follows:
pip install pyfiglet docker
or using the requirements file:
pip install -r requirements.txt
To use this tool, just run python detect_chest_view.py --help
from the same source folder to see all the available options. The first time you run the software, it will download automatically the automated docker container
from the Docker Hub.
- input_image (
--input_image
): input scan to process. The input scan can be an image file (jpeg
,bmp
, etc…) or a DICOMdcm
file.
- model (
--model
): Model to use. (not implemented yet). - gpu use (
--gpu
): use GPU for faster inference (default=No). - update (
--update
): update the Docker image.
Just an example of how to use the software. Let’s use some of the cases of the examples folder. In the case of jpeg
file:
python detect_chest_view.py --input_image examples/dcm/pneumonia_example.dcm
When finished, the software will generate a file called pneumonia_example.csv
file with the predicted view:
This software is released under the version 3 of the GNU General Public License. Please read the license terms before using the software. A copy of this license is present in the root directory.
Contact: Sergi Valverde, Postodoctoral researcher, University of Girona, Spain.