[Mne_analysis] Error when reading back saved epoch and evoked data derived from CTF file

Johan Wessberg johan.wessberg at gu.se
Mon Oct 31 18:11:27 EDT 2016
Search archives:

Hi!

Is there anyone out there who is using MNE with CTF data? I can read files, and save epochs and evokeds to files, but I cannot read them back without errors. I have not been able to find this problem in the Archives.


Details:

I can read my datasets using mne.io.read_raw_ctf(), all data are there, and all analyses using MNE-Python work just fine.

I can save epochs using epochs_save(epochs_fname). I get a file that seem to be of the correct size, no error messages. I use the suggested file name ending, ’-epo.fif’.


However, I cannot recover epochs using epochs = mne.read_epochs(epochs_fname). There is a long traceback, but if I cut out the middle part:


epochs = mne.read_epochs(epochs_fname)

Reading /analysis/ctf_test/my_ctf_testfile-epo.fif ...
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-136-c6eb3ebc7c69> in <module>()
----> 1 epochs = mne.read_epochs(epochs_fname)


…


/Users/johan/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/mne/io/ctf_comp.pyc in read_ctf_comp(fid, node, chs, verbose)
    108         if not calibrated:
    109             #   Calibrate...
--> 110             _calibrate_comp(one, chs, mat['row_names'], mat['col_names'])
    111         else:
    112             one['rowcals'] = np.ones(mat['data'].shape[0], dtype=np.float)

/Users/johan/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/mne/io/ctf_comp.pyc in _calibrate_comp(comp, chs, row_names, col_names, mult_keys, flip)
     42             if p != 1:
     43                 raise RuntimeError('Channel %s does not appear exactly once '
---> 44                                    'in data' % names[ii])
     45             idx = ch_names.index(names[ii])
     46             val = chs[idx][mult_keys[0]] * chs[idx][mult_keys[1]]

RuntimeError: Channel BG1-4122 does not appear exactly once in data


So the error traces back to read_ctf_comp() and then what appears to be a duplicate filename in _calibrate_comp()


Checking the original epochs object, BG1-4122 is not even in epochs.info[’ch_names’]. For the epochs, I picked only the meg channels.

In raw.info, the BG1-4122 channel is at index 01 (the first after the system clock), it is one of the REF_MEG channels? It does not occur more than once in the channel list.


I get the same error when trying read back saved evoked objects using mne.read_evokeds(ave_fname). Again, I used the suggested file name ending ’–ave.fif’


So does anyone have any idea what am I doing wrong? Is there some CTF-related information that is missing or wrong in the saved objects?


Best,
Johan Wessberg
Inst. Of neuroscience and Physiology
Univ. of Gothenburg, Sweden

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20161031/04da8e01/attachment-0001.html 


More information about the Mne_analysis mailing list