Issue with read_raw_hitachi and EEG visualization

  • MNE-Python version: 0.24.0
  • operating system: pycharm
    Question 1
    Now I have .csv files which measured by Hitachi ETG 4000 OTS. It gets some errors when using mne.io. read_raw_hitachi to read files.
    The data structure: [redacted]

Code and errors as following pic.

Question 2
It is weriod about the figure I drawed for EEG original data. I don’t know why.

Codes as follows.

import mne
import numpy as np
import scipy.io
import h5py

sampling_freq = 5.2  # in Hertz
ch_names = ['Fp1', 'AF7', 'AF3', 'AF4', 'AF8', 'F7', 'F5', 'F3', 'F4', 'F6', 'F8', 'FC5', 'FC3',
'FC4', 'FC6', 'C5', 'C6', 'T7', 'T8', 'TP7', 'CP5', 'CP6', 'TP8', 'P7', 'P5', 'P6', 'P8', 'PO7', 'PO8'] # +['auxiliary_CH']*4
ch_types = ['eeg'] * 29
info = mne.create_info(ch_names, ch_types=ch_types, sfreq=sampling_freq)
info = info.set_montage('standard_1020')
data = h5py.File(r'E:\ds课程资料\programming\codes\SMD\EEG-Data\Control001-1.mat')['Data']
data = np.transpose(data,(1,0))
raw = mne.io.RawArray(data[:-4],info)
raw.plot(n_channels=29, duration=400, block=True)
raw.plot_psd(average=True)
print('Shape of Dataset: ',raw.get_data().shape)
print('Number of channels: ',raw.info.get('nchan'))

Here is the picture(just for raw.plot() instruction)

I’m a freshman in the research of this area. Hope you can help me. Thank you.

Hello @Esther and welcome to the forum!

For your second question, I believe that it’s just the scaling that is off. MNE expects EEG data to be in Volts; I assume your input data is scaled to µV. To convert it to Volts, do

data = data * 1e-6

Then the visualization should look better.

As to your first question, I’ve removed the screenshot of the data you posted, as it contained personally identifiable information. Please always carefully check any files for participants’ names etc. before sharing them publicly.

Also, generally it’s more helpful to provide a minimal working example (exact code snippets and data you used instead of screenshots of both), as it will allow others to reproduce your issue. Screenshots, generally, are difficult to deal with especially on mobile devices.

Best wishes,
Richard

1 Like

Oh, that’s my mistake! Thanks for reminding!
For Q1, the data structure as follows. Now it hides sensitive information.


Codes:

import mne

raw = mne.io.read_raw_hitachi(r"E:\ds课程资料\programming\codes\SMD\VMData\VM0001_Moto_HBA_Probe1_Deoxy.csv")

The error shows it is constructing for ETG-100, but my data is measured by ETG-4000. Is this the reason why can’t read the data?
For Q2, it still output the same figure as before. My data structure as follows.
1637926499(1)

It seems the data is actually in nV, not in µV. So instead of multiplying it by 1e-6, multiply it by 1e-9 to convert it to Volts.

Best,
Richard

1 Like

After multipling by 1e-9, I think it still abnormal?:cry:

And looking forward to your reply for Q1 :grinning_face_with_smiling_eyes:
Have a nice day!

Be sure to use the correct sampling frequency. I think you used something like 5 which seems much too small.

Thank you so much. I’ll double check about the sampling frequency.