Convert ISHNE ECG Holter files to timestamped CSV format
Project description
ISHNE to CSV Converter
A Python package and CLI to convert ISHNE Holter ECG files (.ISHNE) to CSV format with timestamped entries.
ISHNE Format
| Description | Data Type | No. of Bytes |
|---|---|---|
| Size (in bytes) of variable-length block | long int | 4 |
| Size (in samples) of ECG | long int | 4 |
| Offset of variable-length block (from beginning of file) | long int | 4 |
| Offset of ECG block (from beginning of file) | long int | 4 |
| Version of the file | short int | 2 |
| Subject First Name | char[40] | 40 |
| Subject Last Name | char[40] | 40 |
| Subject ID | char[20] | 20 |
| Subject Sex (0: unknown, 1: male, 2: female) | short int | 2 |
| Race (0: unknown, 1: Caucasian, 2: Black, 3: Oriental, 4–9: Reserved) | short int | 2 |
| Date of Birth (day, month, year) | 3 × short int | 6 |
| Date of Recording (day, month, year) | 3 × short int | 6 |
| Date of Output File Creation (day, month, year) | 3 × short int | 6 |
| Start Time (hour [0–23], minute, second) | 3 × short int | 6 |
| Number of Stored Leads | short int | 2 |
| Lead Specification (see lead specification table) | 12 × short int | 24 |
| Lead Quality (see lead quality table) | 12 × short int | 24 |
| Amplitude Resolution (integer number of nV) | 12 × short int | 24 |
| Pacemaker Code (see description) | short int | 2 |
| Type of Recorder (analog or digital) | char[40] | 40 |
| Sampling Rate (in Hz) | short int | 2 |
| Proprietary Information (if any) | char[80] | 80 |
| Copyright & Restriction of Diffusion (if any) | char[80] | 80 |
| Reserved | char[88] | 88 |
For complete details of the ISHNE format, please refer to The ISHNE Holter Standard Output File Format.
Features
- Converts all leads with correct timestamp for each sample
- Timestamps are calculated using the start time and sampling rate
- Progress bar to track conversion of large datasets
- Metadata printed and saved in a readable JSON format (name, date, time, leads, etc.)
- CLI support for direct command-line use
- Output CSV includes
timecolumn as the first column (nanoseconds)
Installation
Install from PyPI:
pip install ishne_to_csv
Usage
As a Python Module
from ishne_to_csv import ishne_to_csv
# Basic usage
ishne_to_csv("ECG.ISHNE") # Save as ECG.csv
# With parameters
ishne_to_csv("ECG.ISHNE", output_file="example.csv", metadata_file="patient_1.json", verbose=True)
CLI Usage
python -m ishne_to_csv <input_file> [-o <output_file>] [-m <metadata_file] [-q]
CLI Parameters
| Argument | Description |
|---|---|
input_file |
Path to the input ISHNE file (required) |
--output, -o <file_path> |
Optional output file path (default: same as input file but with .csv format at last) |
--metadata, -m <file_path> |
Saves Metadata to file in JSON (default: same as input file but with .json format at last ) |
--quiet, -q |
Suppress console output (default: False) |
Change Log
v1.1
- Removed datetime overflow bug
- Added support to save metadata information
License
MIT License
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ishne_to_csv-1.2.tar.gz.
File metadata
- Download URL: ishne_to_csv-1.2.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c5073540047f2c9cb98408bfd6d34bc6604a0063a94de7aa1529c76f5ce0d67
|
|
| MD5 |
c700b4b1f54d05acceb889fa760a4d15
|
|
| BLAKE2b-256 |
cc0b38ec4c91e7a80a947caec6186d2fa7a5e34714ba0f219719079c0e1a3212
|
File details
Details for the file ishne_to_csv-1.2-py3-none-any.whl.
File metadata
- Download URL: ishne_to_csv-1.2-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b95d6762fcffb7349706d0f1c9a59c6f4d13a168ea0ee56042d1b436657713a
|
|
| MD5 |
7c63f97ca8f86536599140d0bfe06504
|
|
| BLAKE2b-256 |
14b93046c902dee0219ab753134f1dcca6682d7279e4f34de64d409bf975596b
|