The doubts of beginner when using MNE-HCP documents

  • MNE version: 1.3.0,mne-hcp version: 0.1.dev12
  • operating system: Ubuntu 18.04

Hi,all
I was first exposed to MNE data processing and currently use HCP MEG data. When learning the MNE-HCP document and testing the code of example-Visualize evoked data, an error was reported. I don’t know how to solve it?
https://mne.tools/mne-hcp/auto_examples/plot_evoked_data.html#sphx-glr-auto-examples-plot-evoked-data-py

storage_dir = op.expanduser(‘~/mne-hcp-data’)
hcp_path = op.join(storage_dir, ‘HCP’)
recordings_path = op.join(storage_dir, ‘hcp-meg’)
subjects_dir = op.join(storage_dir, ‘hcp-subjects’)
subject = ‘105923’ # our test subject
data_type = ‘task_working_memory’
run_index = 0
hcp_evokeds = hcp.read_evokeds(onset=‘stim’, subject=subject,
data_type=data_type, hcp_path=hcp_path)

【out】
Reading 4D PDF file /data/public/qht/mne/HCP/100307/unprocessed/MEG/6-Wrkmem/4D/c,rfDC…
Creating Neuromag info structure …
… Setting channel info structure.
… no headshape file supplied, doing nothing.
Currently direct inclusion of 4D weight tables is not supported. For critical use cases please take into account the MNE command “mne_create_comp_data” to include weights as printed out by the 4D “print_table” routine.


RuntimeError Traceback (most recent call last)
/tmp/ipykernel_21302/80213811.py in
1 hcp_evokeds = hcp.read_evokeds(onset=‘stim’, subject=subject,
----> 2 data_type=data_type, hcp_path=hcp_path)
3 for evoked in hcp_evokeds:
4 if not evoked.comment == ‘Wrkmem_LM-TIM-face_BT-diff_MODE-mag’:
5 continue

/data/public/python3.7/site-packages/mne_hcp-0.1.dev12-py3.7.egg/hcp/io/read.py in read_evokeds(subject, data_type, onset, sensor_mode, hcp_path, kind)
879 subject=subject, data_type=data_type, onset=onset,
880 output=‘evoked’, sensor_mode=sensor_mode, hcp_path=hcp_path):
→ 881 evoked_files.extend(_read_evoked(fname, sensor_mode, info, kind))
882 return evoked_files
883

/data/public/python3.7/site-packages/mne_hcp-0.1.dev12-py3.7.egg/hcp/io/read.py in _read_evoked(fname, sensor_mode, info, kind)
892
893 info = _hcp_pick_info(info, ch_names)
→ 894 info[‘sfreq’] = sfreq
895
896 out = list()

/data/public/python3.7/site-packages/mne/io/meas_info.py in setitem(self, key, val)
881 if isinstance(self._attributes[key], str):
882 if not unlocked:
→ 883 raise RuntimeError(self._attributes[key])
884 else:
885 val = self._attributeskey # attribute checker function

RuntimeError: sfreq cannot be set directly. Please use method inst.resample() instead.

I have no idea about how to use this inst.resample()…

There is another problem. I just learned MNE, and now my main purpose is to use pipeline to process the HCP MEG data(from preprocessing to get source estimation). Should I learn the MNE document completely first, or refer to the MNE-HCP section directly? Is the content of MNE-HCP enough to support me to complete the processing of all HCP MEG data?

I would appreciate any help and suggestions
Thanks,

Hello @jshlyz, it seems that MNE-HCP needs to be updated to work with the most recent versions of MNE-Python. Apparently, the project hasn’t received any updates in 6 years. I am not sure if it is still maintained …

Best wishes,
Richard

cc @agramfort @Denis

The project is currently not maintained and yes, it needs to be updated. Is there anyone who would like to help maintaining the project? Please let me know.