smestern / pycedfs Goto Github PK
View Code? Open in Web Editor NEWA very WIP python module to allow reading and import of Ced File System (CFS) electrophysiology files generated by the signal software suit
A very WIP python module to allow reading and import of Ced File System (CFS) electrophysiology files generated by the signal software suit
Hi again,
Since I put together my previous PR, I've done some additional work with the CFS format you might be interested in integrating! Specifically, I was running into some issues with pyCEDFS not parsing all the Data Section variables I wanted in my file (would only read the first 30 or so), so rather than get deep into ctypes debugging I adapted some old EDF-parser code I'd written to create a pure-Python CFS header parser. Once that was together, it was only a little extra work to get it reading Data Section variables and channel data without the DLL too. The end result runs nicely on macOS, and should be fully cross-platform for any systems that support Numpy!
Of course, given how strongly pyCEDFS is based on the ctypes/DLL interface, cleaning up my work for a PR would involve replacing a ton of the existing code which might have various unintended consequences. As such, I'm not sure whether you'd prefer this work be merged into pyCEDFS or exist as a separate project.
I've attached my WIP code so you can take a look. The main function is "read_cfs", which accepts a file path as an argument. It returns a dict with a header and a list of Frame objects (data sections), which contain the data section variables and channel data for each frame. The structure.py
file contains the names and byte widths of each field of each form of header in the file, which the read.py
file uses to grab the bytes associated with each field and convert them to their corresponding data types. The cfs.py
file contains some half-implemented container object types for CFS files and frames.
Let me know what you think!
Hi,
Thanks for sharing this potentially very useful library. Unfortunately, after installing it to give it a try (trying to simplify the toolchain from stfio) I ran into a DLL issue that stopped me when I tried to import the package. Apparently the ctype.CDLL call fails because it can't find the DLL (FileNotFoundError). This is surprising because the CFS64.dll is there, and the path is correct. I tried all the suggestions I could find on Google (be in the directory before loading it, adding the directory to the path, etc.) but not luck. Do you have any other suggestion / idea? Encountered this issue before?
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.