Coder Social home page Coder Social logo

marcodebe / dicom-ecg-plot Goto Github PK

View Code? Open in Web Editor NEW
133.0 14.0 70.0 4.22 MB

Dicom ECG Viewer and Converter. Convert to PDF, PNG, JPG, SVG, ...

Home Page: https://ecg.galliera.it

License: MIT License

Python 100.00%
dicom python ecg-signal viewer wado svg pdf waveform-visualizer ecg ecg-signal-python

dicom-ecg-plot's Introduction

ECG Dicom Convert

Dicom ECG plot

A python tool to plot Dicom ECG.

The DICOM file can also be specified as studyUID seriesUID objectUID and retrieved from your WADO server.

Github repository: here

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

Online demo

demo site You can convert your own DICOM files or use preloaded sample files from different modality models.

Install

python3 -m venv ecg
. ecg/bin/activate
pip install dicom-ecg-plot

Usage of dicom-ecg-plot tool

dicom-ecg-plot <inputfile> [--layout=LAYOUT] [--output=FILE|--format=FMT] --minor-grid
dicom-ecg-plot <stu> <ser> <obj> [--layout=LAYOUT] [--output=FILE|--format=FMT] --minor-grid
dicom-ecg-plot --help

Examples:

dicom-ecg-plot anonymous_ecg.dcm -o anonymous_ecg.pdf
dicom-ecg-plot anonymous_ecg.dcm --layout 6x2 --output anonymous_ecg.png
dicom-ecg-plot anonymous_ecg.dcm --format svg > anonymous_ecg.svg

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

If --output is given the ouput format is deduced from the extension of the FILE. 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.

References

dicom-ecg-plot's People

Contributors

anishp avatar ant9000 avatar darthunix avatar marcodebe avatar simoferre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dicom-ecg-plot's Issues

no attribute 'WaveformSequence'

run dicom-ecg-plot 000.dcm abc.dcm

Traceback (most recent call last):
File "c:\Users\jiangyl\Anaconda3\Scripts\dicom-ecg-plot", line 62, in
minor_axis, interpretation)
File "c:\Users\jiangyl\Anaconda3\Scripts\dicom-ecg-plot", line 38, in convert
ecg = ECG(source)
File "F:\Users\jiangyl\Anaconda3\lib\site-packages\ecg\ecg.py", line 183, in init
sequence_item = self.dicom.WaveformSequence[0]
File "F:\Users\jiangyl\Anaconda3\lib\site-packages\pydicom\dataset.py", line 783, in getattr
return object.getattribute(self, name)
AttributeError: 'FileDataset' object has no attribute 'WaveformSequence'

TypeError: must be real number, not str

I am getting following error while running dicom-ecg-plot.exe program on windows
Kindly anyone help me to fix this issue
Sample file is attached here with for the reference

dicom-ecg-plot.exe C:\ecg.dcm --layout 6x2 --output c:\result.png`

[ecg.zip](https://github.com/marcodebe/dicom-ecg-plot/files/8012811/ecg.zip)

Matplotlib is building the font cache; this may take a moment.
Traceback (most recent call last):
  File "dicom-ecg-plot.py", line 62, in <module>
  File "dicom-ecg-plot.py", line 39, in convert
  File "ecg\ecg.py", line 588, in draw
  File "ecg\ecg.py", line 456, in print_info
  File "ecg\ecg.py", line 367, in legend
TypeError: must be real number, not str
[10348] Failed to execute script 'dicom-ecg-plot' due to unhandled exception!

Differences python script vs Online demo

Hi!!

When plotting the same ECG type DICOM object, we noticed differences in the generated result.

Basically it is in relation to where the boxes are painted with the structured information that is extracted from the DICOM object (demographics and ECG metadata). Is there a way so that what is generated through the python script is the same as what is generated by the web?

It is cleaner and more legible if the information is left off the "paper" on which the ECG waveforms are painted.

Thank you!!

Python script:
pECG

Online demo:
wECG

Missing dependencies

These dependencies are missing:

  • The system package libpng12-dev (in debian), needed to build matplotlib
  • The system package liblapack-3.so (in debian), required by numpy
  • The fortran compiler (gfortran in debian)
  • The python library docopt
  • The python library requests

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.