Code Monkey home page Code Monkey logo

dicomecg_convert's Introduction

ECG Dicom Convert

Dicom ECG Conversion

A python module and relative tool to convert Dicom ECG (waveform) files to PDF, PNG, SVG, etc. The DICOM file can also be specified as studyUID seriesUID objectUID and retrieved by your WADO server.

THE PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY OF ANY KIND.

Try it online first!

You can use the demo site to quickly test the results before installing the software. You can convert your own DICOM files, or use preloaded sample files from different modality models.

Usage of convert.py tool

python convert.py <inputfile> [--layout=LAYOUT] [--output=FILE|--format=FMT] --minor-grid
python convert.py <stu> <ser> <obj> [--layout=LAYOUT] [--output=FILE|--format=FMT] --minor-grid
python convert.py --help

For example the file anonymous_ecg_3x4_1.png is generated by:

python convert.py sample_files/anonymous_ecg.dcm -o sample_files/anonymous_ecg_4x3_1.pdf

The input can be a file or the triplet studyUID, seriesUID, objectUID. In the latter case dicom file is downloaded via WADO.

The ouput format is deduced from the extension of the FILE, if --output is given. If the output file is not given --format must be defined. Supported output formats are: eps, jpeg, jpg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff.

By default the 5mm grid is drawn, --minor-grid add the minor grid (1mm).

The signals are filtered using a lowpass (40 Hz) butterworth filter of order 2.

LAYOUT can be one of: 3x4_1 (that is 3 rows for 4 columns plus 1 row), 3x4, 6x2, 12x1 (default: 3x4_1). New layouts can be defined adding the corresponding matrix in LAYOUT dictionary in config.py.

Install

You first have to install some system library and a fortran compiler. On a Debian machine:

sudo apt-get install libpng12-dev
sudo apt-get install libblas-dev
sudo apt-get install liblapack-dev 
sudo apt-get install gfortran

Global installation

sudo pip install -r requirements.txt
git clone [email protected]:marcodebe/dicomecg_convert.git
cd dicomecg_convert
sudo python setup.py install

Inside a virtualenv

git clone [email protected]:marcodebe/dicomecg_convert.git
cd dicomecg_convert
virtualenv .
. bin/activate
pip install -r requirements.txt
python setup.py install

Documentation

To generate documentation use epydoc packages:

cd path/to/dicomecg_convert
epydoc --html -o docs ecg.py

Read epydoc manual for other output formats and options:

epydoc -h

To install the epydoc package on:

sudo pip install epydoc

or download the installation package from Epydoc and follow the instructions.

References

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.