:hospital: Medical Image Downloader
The presented repository has the source code for the “Medical Imaging Downloader for CornerstoneJS and Orthanc” medium story. It represents the set of scripts to download medical images from a WADO server and PACS. For the purpose, we are using lightweight JavaScript library for displaying medical images in a web browser, called CornerstoneJS. To store and retrieve the medical images, we are using the Orthanc server as a standalone DICOM server. The scripts are reading from the WADO server, linking the image paths to the PACS to retrieve the images from here and download it to a local folder. In other words, the code will know where are the images from the prototype-cornerstone
sample, retrieving the images stored at a Orthanc server.
The following list is showing the required dependencies for this project to run locally:
Here are some tutorials and documentation, if needed, to feel more comfortable about using and playing around with this software:
At this point, the only way to install this software is manual. Eventually, this will be accessible through pip or any other package manager, as mentioned on the roadmap.
Nonetheless, this kind of installation is as simple as cloning this repository. Virtually all Git and GitHub version control tools are capable of doing that. Through the console, we can use the command below, but other ways are also fine.
git clone https://github.com/opprDev/medical-image-downloader.git
Optionally, the mi module/directory can be installed into the designated Python interpreter by moving it into the site-packages directory at the respective Python directory.
Please, feel free to try out our demo. It is a script called download_medical_images.py at the src/demo directory. It can be used as follows:
python download_medical_images.py ./medical_images
Just keep in mind this is just a demo, so it does nothing more than downloading medical images to an arbitrary destination directory if the directory does not exist or does not have any content. Also, we did our best to make the demo as user-friendly as possible, so, above everything else, have fun! 😁
We need to follow the repository goal, by addressing the thereby information. Therefore, it is of chief importance to scale this solution supported by the repository. The repository solution follows the best practices, achieving the Core Infrastructure Initiative (CII) specifications.
This project exists thanks to all the people who contribute. We welcome everyone who wants to help us improve this downloader. Here are some suggestions:
Either as something that seems missing or any need for support, just open a new issue. Regardless of being a simple request or a fully-structured feature, we will do our best to understand them and, eventually, solve them.
We like to develop, but we also like collaboration. You could ask us to add some feature… or you could want to do it yourself and fork this repository. Maybe even do some side-project of your own. If the latter ones, please let us share some insights about what we currently have.
We do TDD. In short, we first identify which are the behaviors this downloader should have and encode it using unittest and unittest.mock, and then implement our code in the most recent stable version of Python and, possibly, refactor it. This is more than optional, of course, but you would have at your disposal our test suite to make you more comfortable about changing our code. You could even add more unit tests.
The textual illustration below shows the folder and file structure of our source code, along with their respective description.
medical-image-downloader/
mi/
download_all.py: File with the main method to download all DICOM files from the Orthanc server
constant.py: File with constants
util/
api.py: File with API-related utility methods
format.py: File with formatting utility methods
url.py: File with URL-related utility methods
test/mi/
download_all_test.py: A test case of download_all.py
mock/: Folder with mocks and their respective parameters, grouped by the module they are mocking
sample/: Folder with all samples, in python, as an output of mocks
demo/
download_medical_images.py: Command/Script to execute download_all.py
We also follow CI/CD practices through GitHub Actions. Here are our workflows:
Use them as you see fit. Just don’t forget to credit us if you publish a fork of this downloader. :grin:
Francisco Maria Calisto [ Website | ResearchGate | GitHub | LinkedIn ] |
A special thanks to Chris Hafey, the propelling person of CornerstoneJS, who also developed the cornerstoneDemo. Not forgetting the three supporters of the CornerstoneJS library, Aloïs Dreyfus, Danny Brown and Erik Ziegler. We also would like to give a special thanks to Erik Ziegler who support several issues during this path.
Thank you to all our backers and sponsors! 🙏
Our organization is a non-profit organization. However, we have many expenses across our activity. From infrastructure to service expenses, we need some money, as well as help, to support our team and projects.
Copyright © 2019 oppr
The medical-image-downloader
repository is distributed under the terms of MIT license and the present information is covered by this. You are free to make changes and use this in either personal or commercial projects. Attribution is not required, but it is welcomed. A little “Thanks!” (or something to that effect) would be much appreciated.