Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot handle Status channel recorded in a bdf file #60

Open
likanzhan opened this issue Nov 2, 2021 · 3 comments
Open

Cannot handle Status channel recorded in a bdf file #60

likanzhan opened this issue Nov 2, 2021 · 3 comments

Comments

@likanzhan
Copy link
Contributor

Hi @ararslan and @rob-luke

Here is description of the problem. We can use the sample bdf data provided in Neuroimaging.jl.

In the sample data named test_Hz19.5-testing.bdf there are 7 channels in total: The first 6 channels are the normal signal channels and the last channel with the label name Status is a trigger channel as being specified in biosemi. In the sample data, there are 3 different triggers and 59 triggers in total. The trigger information can be correctly retrieved with BDF, but not with EDF.

using BDF, EDF, Downloads

url = "https://github.com/rob-luke/Neuroimaging.jl/blob/main/test/data/test_Hz19.5-testing.bdf?raw=true"
dt = Downloads.download(url)
  • When the data is read in with readBDF(), the actual data contains only 6 channels. The last channel Status is converted into triggers.
header = BDF.readBDFHeader(dt)
header["chanLabels"] # seven channels, the last one is `Status`

data, triggers, trigger_channel, system_code_channel = readBDF(dt)
size(data) # (6, 237568)
length(unique(triggers["code"])) # 3
length(unique(triggers["idx"]))   # 59
  • When the data is read with EDF.read(), the last channel was treated as a normal channel, and the trigger information as being described earlier cannot be retrieved.
edf = EDF.read(dt)
status = last(edf.signals)
status.header.label # "Status"
unique(status.samples)

Related discussions: Switch to EDF.jl #91.

@rob-luke
Copy link

rob-luke commented Nov 2, 2021

You can find another test file at https://github.com/rob-luke/Neuroimaging.jl-example-data

@likanzhan
Copy link
Contributor Author

Do we have an update on this?

@ararslan
Copy link
Member

I've not had time to get around to this yet but I have some ideas for how to implement it.

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

No branches or pull requests

3 participants