Skip to content

run_unfold throws an error if the data does not only include eeg (but for example also eye-tracking data). #108

@jschepers

Description

@jschepers

I tried using UnfoldBIDS with our co-registered EEG + ET data and run_unfold throws the following error:
Image

I looked into the stacktrace and the problem is that the internal function raw_to_data calls the MNE get_data function with "uV" as units argument.

raw_to_data(raw; channels::AbstractVector{<:Union{String,Integer}}=[])
Function to get data from MNE raw object. Can choose specific channels; default loads all channels.
"""
function raw_to_data(raw; channels::AbstractVector{<:Union{String,Integer}} = ["all"])
return pyconvert(Array, raw.get_data(picks = pylist(channels), units = "uV"))
end

However this does not work if there are not only eeg data channels.

Possible fixes could be:

  1. Use pick on the Raw object beforehand to only choose eeg channels.
  2. Use picks within the get_data function and set it by default to "eeg".
  3. Inform the user that they have to remove other channels from their data (but I don't like this option).

Cheers,
Judith

P.S. I don't have time to do a PR right now, but I could do it in two weeks from now. But I wanted to hear your opinion about the issue first anyway :)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions