Neuroimaging.jl
Neuroimaging.jl copied to clipboard
Switch to EDF.jl
The current reader used is https://github.com/sam81/BDF.jl which hasn't been updated since 2018, this is only an issue as it is requiring old package dependencies.
Best plan seems to be to switch over to https://github.com/beacon-biosignals/EDF.jl/pull/46 once its merged.
Or fork and maintain BDF.jl, but that's less than ideal
FYI since you linked the PR, EDF.jl v0.6.3 supports reading and writing BDF files :slightly_smiling_face:
That's amazing! Thanks so much for your hard work @ararslan. I will switch to your package when I have a spare few hours. I appreciate your contribution greatly!
I played with this a few weeks ago and imported data with no issue, however, I was unable to extract annotation information. This seems to have been because I was reading old documentation, but is now fixed in https://github.com/beacon-biosignals/EDF.jl/issues/52. So I should try and extract annotation information again.
Once this is working I would like to refactor the BDF reading code as there is lots of code repetition. And I would like to make the read functions more agnostic of the datatype being read.
If I understand correctly, it seems that the status channel in BDF cannot be correctly handled by EDF.jl for now.
If I understand correctly, it seems that the
statuschannel inBDFcannot be correctly handled byEDF.jlfor now.
Oh no. That's bad news. We need the status channel for BDF.
What about for BDF+? Does EDF.jl correctly extract triggers for BDF+ files?
The BDF+ and EDF+ trigger information specified as Annotations can be handled. But the BDF status channel specified by biosemi is not correctly handled for now.
Thanks for the summary @likanzhan! So I will continue with my plan to refactor the current reading code to be less BDF specific (remove hard coding of parameters, remove repeated code, modularise tasks). Then we can add EDF.jl to enable reading of EDF and BDF+ files. And use BDF.jl and EDF.jl concurrently.
I will report back here when its done. But feel free to try and tackle it in the meantime (its just that part of the code is pretty BDF specific, sorry)
@likanzhan, can you open an issue on EDF.jl with some details about the status channel not working? Without supporting that, BDF support is technically incomplete, so I'll see if I can get that fixed. I don't have access to any BDF files with a status channel though.
Hi @rob-luke, when refactoring the reading code, is it possible to use the format being described as Onda.jl?
Hi @rob-luke,
The branch https://github.com/beacon-biosignals/EDF.jl/pull/61 (not released yet) can now handle the status channel.
Apologies, I've not been able to get back to that PR for a while. One question I have for the folks who would be using it is what behavior would be desirable for calling EDF.decode on the trigger status channel. It could decode the individual bits, as BioSemi's description mentions that information is encoded via bit masks. I lack sufficient context to know what makes sense for the trigger status.