semvec/pypi-packages huggingface dataset:
binfilepy 0.1.8
Package for read/write binary file (.adibin format)
Requires Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4
Keywords: ECG EKG binary chart adibin

# binfilepy

Software library to read and write binary file (.adibin format).

## Example to write a binary file:
```
from binfilepy import BinFile
from binfilepy import CFWBINARY
from binfilepy import CFWBCHANNEL

with BinFile(filename, "w") as f:
    header = CFWBINARY()
    header.setValue(1.0 / 240.0, 2019, 1, 28, 8, 30, 0.0, 0.0, 2, 0)
    f.setHeader(header)
    channel1 = CFWBCHANNEL()
    channel1.setValue("I", "mmHg", 1.0, 0.0)
    f.addChannel(channel1)
    channel2 = CFWBCHANNEL("II", "mmHg", 1.0, 0.0)
    f.addChannel(channel2)
    chanData = []
    d1 = [1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1]
    d2 = [8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8]
    chanData.append(data1)
    chanData.append(data2)
    f.writeHeader()
    f.writeChannelData(chanData)
    f.updateSamplesPerChannel(16, True)
```

## Example to read a binary file:
```
from binfilepy import BinFile

with BinFile(filename, "r") as f:
    # You must read header first before you can read channel data
    f.readHeader()
    # readChannelData() supports reading in random location (Ex: Read 10 secs of data at 1 min mark)
    data = f.readChannelData(offset=60, length=10, useSecForOffset=True, useSecForLength=True)
```

## File open mode
Currently, there are three modes to open a file:
- "w": For writing to a new file.  You need to make sure the file doesn't exist.
- "r": For reading from an existing file.  You need to make sure the file exists.
- "r+": For appending data to an existing file.  You need to make sure the file exists.

You can use either syntax:
```
with BinFile(filename, "w") as f:
    ...
    ...
```
or
```
f = BinFile(filename, "w")
f.open()
...
...
f.close()
```
read-roi 1.6.0
Read ROI files .zip or .roi generated with ImageJ.

# read-roi

[![PyPI version](https://img.shields.io/pypi/v/read-roi.svg?maxAge=2591000)](https://pypi.org/project/read-roi/)
[![Build Status](https://travis-ci.com/hadim/read-roi.svg?branch=master)](https://travis-ci.com/hadim/read-roi)
[![codecov](https://codecov.io/gh/hadim/read-roi/branch/master/graph/badge.svg)](https://codecov.io/gh/hadim/read-roi)

Read ROI files .zip or .roi generated with ImageJ. Code is largely inspired from : http://rsb.info.nih.gov/ij/developer/source/ij/io/RoiDecoder.java.html

## Functions

```python
from read_roi import read_roi_file
from read_roi import read_roi_zip

roi = read_roi_file(roi_file_path)

# or

rois = read_roi_zip(roi_zip_path)
```

## Note

- Some format specifications are not implemented. See `RoiDecoder.java` for details.
- Most of "normal" ROI files should work.
- Feel free to hack it and send me modifications.

## Requirements

- Python 3.5 and above.

## Install

`pip install read-roi`

Or you can use Anaconda and `conda-forge` :

```
conda config --add channels conda-forge
conda install read-roi
```

## License

Under BSD license. See [LICENSE](LICENSE).

## Authors

- Hadrien Mary <hadrien.mary@gmail.com>

## Release a new version

- Run tests: `pytest -v read_roi/`.
- Install [rever](https://regro.github.io/rever-docs): `conda install -y rever`.
- Run check: `rever check`.
- Bump and release new version: `rever VERSION_NUMBER`.