Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Failing to read metadata.npy for TTL events in this specific setup #104

Open
cjthomas-opensource opened this issue Jan 24, 2023 · 4 comments
Assignees

Comments

@cjthomas-opensource
Copy link
Contributor

I'm getting errors from readNPYheader.m when trying to read an Open Ephys save. I augmented readNPYheader.m to report the line that it had trouble parsing (pull request accepted; if you feel the change is useful, please update your version link). It seems to be failing to read "metadata.npy" for TTL events that were saved. I have no idea why.

I've attached the error message (which includes the NPY format string it had trouble with), a file list of the save tree, both of the settings.xml files that were at the top level, and both of the metadata.npy files that were present.

This setup was run under version 0.5, but there's a good chance version 0.6 has the problem as well.
file-tree.txt
matlab-output-excerpt.txt
metadata-and-settings.zip

@cjthomas-opensource
Copy link
Contributor Author

A screenshot of the signal chain is attached. This is a partial mockup of a closed-loop setup. I'm loading previously-saved experiment data, splitting off one fork for LFP visualization, and running the other fork through the TNE Lab's phase calculator plugin. I'm then running two instances of a modified version of the TNE Lab's crossing detector plugin to identify power excursions and target phases, and am using my conditional trigger logic plugin to generate TTL events from that. These get saved and also sent to a visualizer.

The metadata issue is happening when I read the saved data into a script intended to evaluate this setup's performance/accuracy. The events themselves are read without trouble; it's just complaining about not being able to read the metadata file.
20230120-closed-loop-mockup

@medengineer
Copy link
Member

The npy-matlab library doesn't support npy files with structured array data, which the CrossingDetector events metadata file contains. We’ll have to add a custom parser to handle this case.

@medengineer medengineer self-assigned this Jan 26, 2023
@cjthomas-opensource
Copy link
Contributor Author

As an interim mitigation approach, I submitted a pull request for "analysis-tools" that calls Matlab's "warning" instead of using "fprintf" directly. This makes it trivial for users like me to turn off the warning text if desired (per above the data itself is read without trouble).

@cjthomas-opensource
Copy link
Contributor Author

Thanks for the merge!

This resolves the issue on my side. It's up to you and the TNE Lab people to decide whether any further action is needed/desired for load_open_ephys_binary.m or for the crossing detector (such as having it save metadata in a format that npy-matlab can read).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants