Skip to content

inodb/dicom-flask-uploader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status codecov Deploy

dicom-flask-uploader

Python Web Server in Flask that allows users to upload & browse DICOM images. Under the hood mudicom and gdcm are used to get key/value info from the DICOM files. The pillow library is used to make the thumbnail.

See an example running at:

DICOM GIF

http://dicom-flask-uploader.herokuapp.com/

How to run

Using conda + pip

To Deploy, install the dependencies

conda create -p env/
source activate env/
# You need to install gdcm
conda config --add channels conda-forge
conda install --file requirements/conda.txt
pip install -e .

Then run

export FLASK_APP=dicom_flask_uploader.runapp
flask initdb
flask importdb
flask run

To Run Tests

source activate env/
pip install -r requirements/development.txt
py.test

Design choices

  • Using simple sqlite db at the moment for quick prototyping, but could be changed for any other type of relational db that flask-sqlalchemy supports.
    • Data element key/value sizes picked arbitrarily. Not sure what max limits are for DICOM
    • Might actually be better to use nosql db for this, since key/values can be different between DICOMs
  • Use gdcm so compressed DICOM images can be handled
    • There was a conda binary already available, so was easy to use that. Saw there were some Dockerfile images available as well
  • Storing thumbnails/dcm on /tmp/ so I don't get charged for uploading/storing files
    • For persistent storage on Heroku, could've also stored them in the db but that is generally considered bad practice
  • Using Jinja2 templating with flask for quick prototyping
  • A few tests to show system works, no reason to test a prototype super thoroughly

Further Ideas

  • Use that lovely flask-resty library to create REST API
  • Add authentication
  • Store static files in a persistent manner using flask-annex
  • Seems like some thumbnails are not always properly converted, probably issue in mudicom or gdcm
  • Add better error checking (for uploading incorrect image type for instance)
  • Validate DICOM files and show info to user
  • Query DICOM key/value

About

DICOM Image upload website using Flask

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published