Open dominikbach opened 2 years ago
Very weird! Any chance we can see one of the affected files?
We hit this error on some MR2 subjects over in Stacey's land.
I can't figure out a pattern and don't have time to do a version regression to find out what changed, but here's a sample file.
What I know: acq2mat
ran on this with bioread v1.0.4 (the default on BI servers) generates a file Matlab can read. Same process with bioread 3.0.1 writes a .mat file that Matlab does not load.
Dominik is correct above, if I do m = matfile("sample_3.0.1.mat")
I can confirm that m.headers
is the bit that dies; the data from the channels loads fine. So, that's a possible workaround for folks who stumble on this; it wouldn't be too hard to write a matfile
wrapper that fills in fake headers instead of trying to read whatever's broken.
The headers
do look different if I diff a hex dump, but I don't know what's actually wrong.
Thanks for writing this dang library, Nate, it is endlessly useful. Maybe someday I'll have time to contribute back some fixes... :heart:
Interesting! The sample file is gonna be helpful here. I wonder if it would replicate with octave...
oh no I am trying to brew install octave
over a cell link
One last question -- to confirm, using --data-only
does not fix this, right? It's something in the headers structure itself, not the markers?
I think we're writing more stuff to headers than is needed though — we shouldn't need the graph or foreign headers at all
Confirmed, --data-only
has no effect and the file is still unreadable.
On Wed, Feb 28, 2024 at 8:29 AM Nate Vack @.***> wrote:
One last question -- to confirm, using --data-only does not fix this, right? It's something in the headers structure itself, not the markers?
I think we're writing more stuff to headers than is needed though — we shouldn't need the graph or foreign headers at all
— Reply to this email directly, view it on GitHub https://github.com/uwmadison-chm/bioread/issues/39#issuecomment-1969107690, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAAV4BBJRESUQPRCEK6K4TYV45LXAVCNFSM5VBATQE2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJWHEYTANZWHEYA . You are receiving this because you commented.Message ID: @.***>
For some acq files,
acq2mat
andMatlabWriter.py
produce unreadable matlab files.For data acquired with the same settings, the error occurs for a small subset of files, with no clear pattern why. For a given file, the error is reproducible on different computers, Matlab versions, and system versions (all under Windows), and for the two conversion methods. We tried to open and save the acq files again in Acqknowledge but the error still occurs.
The error is:
Error using load
Cannot read file ...
Using
matfile.m
, it is the variableheaders
which cannot be read from file and produces the error withload
.