DICOM electrocardiography (ECG) rendering for Node.js and browser using dcmjs
npm install dcmjs-ecg[![NPM version][npm-version-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url] [![build][build-image]][build-url] [![MIT License][license-image]][license-url]
js
// Import objects in Node.js
const dcmjsEcg = require('dcmjs-ecg');
const { DicomEcg } = dcmjsEcg;
// Import objects in Browser
const { DicomEcg } = window.dcmjsEcg;
// Create an ArrayBuffer with the contents of the DICOM P10 ECG byte stream.
const ecg = new DicomEcg(arrayBuffer);
// Create rendering options.
const renderingOpts = {
// Optionally provide the rendering speed in millimeter per second.
// If not provided, the default value of 25 millimeter per second is used.
speed: 25.0,
// Optionally provide the rendering amplitude in millimeter per millivolt.
// If not provided, the default value of 5 millimeter per millivolt is used.
amplitude: 5.0,
// Optionally apply a Butterworth low pass filter with 40Hz cut off frequency.
// If not provided, the filter is not applied.
applyLowPassFilter: false
};
// Render ECG.
const renderingResult = ecg.render(renderingOpts);
// Rendered waveform in SVG format.
const svg = renderingResult.svg;
// Array of key-value-unit objects containing waveform information and interpretation.
const info = renderingResult.info;
``