Skip to main content

Python-based solution for converting ECG data from XML format to the DICOM(Digital Imaging and Communications in Medicine) format

Project description

XML2DCM-ECG

Description

This repository contains a Python-based solution for converting ECG data from XML format to the DICOM (Digital Imaging and Communications in Medicine) format. The goal of this project is to facilitate the process of transforming clinical ECG data stored in XML files into a standardized, widely-used DICOM format, which is essential for healthcare systems, medical imaging devices, and Electronic Health Record (EHR) systems.

The solution handles the extraction and conversion of ECG information, including patient details, acquisition context, and waveform data, from XML files into the DICOM format. The project also integrates essential metadata such as the type of ECG lead (e.g., Lead I, Lead II), device information (e.g., acquisition device, software versions), and patient demographics.

Installation

You can install XML2DCM-ECG directly from PyPI:

pip install XML2DCM-ECG

Alternatively, you can use uv, a faster Python package manager with built-in script runner:

pip install uv

Usage

After installation, you can run the ECG XML-to-DICOM converter using either of the following methods.

1. Using standard CLI command

Run the following command:

   xml2dcm-ecg --ecg_xml_path /path/to/xml_files --output_dir /path/to/save_dicom --debug True --debug_n 5

2. Using uvx for fast execution

With uv installed, you can use uvx for faster execution:

   uvx xml2dcm-ecg --ecg_xml_path /path/to/xml_files --output_dir /path/to/save_dicom --debug True --debug_n 5

CLI Options

  • --ecg_xml_path: Path to the directory containing the XML files to be converted.
  • --output_dir: Path to the directory where you want the converted DICOM files to be saved. The default is ecg_dicom.
  • --debug: Enable debug mode. The default is False.
  • --debug_n: Number of files to process in debug mode. The default is 5.

Example results

The following are examples of the ECG data converted from XML to DICOM format: ecg_dicom.png

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xml2dcm_ecg-1.1.7.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xml2dcm_ecg-1.1.7-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file xml2dcm_ecg-1.1.7.tar.gz.

File metadata

  • Download URL: xml2dcm_ecg-1.1.7.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for xml2dcm_ecg-1.1.7.tar.gz
Algorithm Hash digest
SHA256 11d279a82b86bfe82e97496246992232389f5313c1d164760fb5e766f35ba496
MD5 0f18461a3aa1a0f3dc5297856a9a951c
BLAKE2b-256 906cb178dafa9468186cc1c1e356a43f3930ae6deafe13b367981e524dd72653

See more details on using hashes here.

File details

Details for the file xml2dcm_ecg-1.1.7-py3-none-any.whl.

File metadata

  • Download URL: xml2dcm_ecg-1.1.7-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for xml2dcm_ecg-1.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 7e20fba169bc1bae1c0d0423cd9ca04c2263ca2110cf7b37c88614a39671c5f3
MD5 9dbfab9b37c125d91038fc6fdc2d5f4d
BLAKE2b-256 409ac808334fd738608e73ecb248367d006b1250ab14633d0894e14f6bbb7846

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page