Home

Awesome

pycfslib

pycfslib is a python library to read, write and create compressed feature set (CFS) file/stream from raw PSG data. Python 3 is now supported. The CFS format is an open standard for communication with the Z3Score and NEO sleep scoring system (https://z3score.com). Instead of using polysomnography data in European Data Format (EDF, https://en.wikipedia.org/wiki/European_Data_Format), the Z3Score system uses CFS files. CFS files are on an average 18X smaller than corresponding EDF files. This reduces data overhead significantly. The format does not allow any user identifiable information ensuring anonymity. The code is released under GPL v3. (c)-2018 Neurobit Technologies Pte Ltd - Amiya Patanaik

Updates

Added electrode fall off detection. Two new functions added, qc_cfs and qc_stream

Now supports CFS v2, CFS v2 is a new specification that works with the NEO prediction system. NEO replaces the Z3Score prediction system which is now deprecated.

Installation

    pip install pycfslib

Usage

Z3Score provides a RESTful API to access the sleep scoring services. Read about the API here: https://github.com/neurobittechnologies/z3score-api Sample code using the CFS library is provided in the repository.

Important Functions

    save_stream_v2(file_name, C3, C4, EOGL, EOGR, EMG, sampling_rates, compressionbit=True, hashbit=True, check_quality=True)
    create_stream_v2(C3, C4, EOGL, EOGR, EMG, sampling_rates, compressionbit=True, hashbit=True, check_quality=True)
    stream = save_stream(file_name, EEG_data, sampling_rate, compressionbit=True, hashbit=True, check_quality=True)
    stream = create_stream(EEG_data, sampling_rate, compressionbit=True, hashbit=True, check_quality=True)
    dataStream, header = read_stream(stream, check_quality=True)
    dataStream, header = read_cfs(cfs_file, check_quality=True)
    header = read_header(stream):
    status, quality, message = qc_cfs(cfs_file, threshold = 10):
    status, quality, message = qc_stream(stream, threshold = 10):

License

GPL V3