RuntimeError: Cannot fit headshape without digitization , info["dig"] is None results when trying to add simulated eog artifacts to a simulated signal

  • MNE version: .24
  • operating system: Mac OS 11.6.1

First, I greatly appreciate this forum and hope I’m not wearing out my welcome.

I’m wondering if it’s possible to add simulated artifacts using mne.simulation.add_eog to data created itself from a small-scale simulation.

My data has five channels and is created using an MVAR model or order 3, sampling rate of 500 Hz, and 10K data points. Code to generate the data set can be found at Partial Directed Coherence and Direct Transfer Function using MVAR processes · GitHub.

I’ve created the data and stored it in a raw instance using create_info and RawArray

The command mne.simulation.add_eog(raw) results in the error message ending with

RuntimeError: Cannot fit headshape without digitization , info["dig"] is None

Is it possible to use this command to add simulated artifacts to my data, or is it only possible to do so for data coming from a standard montage of some sort, which includes channels near the eyes where one expects blinking?

If it’s not possible, are there general tools to add eog and ecg type artifacts? I’d like to create a take the model above, add artifacts and detect/repair them using ICA. Thanks.

I haven’t looked closely at how you’re generating the data (the gist is 341 lines long, hardly an MWE), but answering conceptually: you can’t simulate artifacts if your channels don’t have spatial locations associated with them — a blink artifact is going to look very different on a forehead channel than on a channel near the nape.

If it makes sense to do so, you can create a custom montage with hand-crafted locations for each channel and apply it to your raw, or you can name your 5 channels with names from a standard montage and apply that standard montage to your raw.

Thanks–I had suspected this. Sorry about the lack of a MWE. How I designed my synthetic data wasn’t really central to my question and perhaps I should have just omitted that part.