[Mne_analysis] Problem with reading events from .fif-file

Maria Hakonen maria.hakonen at gmail.com
Thu Nov 16 04:18:10 EST 2017
Search archives:

Dear mne experts,


I am trying to read events from MEG data as follows:

raw=mne.io.read_raw_fif('/m/nbe/scratch/alex/subjects/' + subject +
'/neuromag/t' + str(c) + '_' + subject + '_trans_sss.fif')

events=mne.find_events(raw)


However, with one file I am getting an error pasted below. mne.find_events
works without problems for other files. I have been wondering if the file
could be somehow corrupted but at least meg signals and the trigger channel
looked normal when I plotted them. Any ideas what might be wrong?


The error message:


---> 27         events=mne.find_events(raw)

     28         events[:,0]=events[:,0]-raw.first_samp

     29         i = 0



/u/01/mhhakone/unix/.local/lib/python2.7/site-packages/mne/event.pyc in
find_events(raw, stim_channel, output, consecutive,
min_duration                                , shortest_event, mask,
uint_cast, mask_type, verbose)



/u/01/mhhakone/unix/.local/lib/python2.7/site-packages/mne/utils.pyc in
verbose(function, *args, **kwargs)

    705         with use_log_level(verbose_level):

    706             return function(*args, **kwargs)

--> 707     return function(*args, **kwargs)

    708

    709



/u/01/mhhakone/unix/.local/lib/python2.7/site-packages/mne/event.pyc in
find_events(raw, stim_channel, output, consecutive,
min_duration                                , shortest_event, mask,
uint_cast, mask_type, verbose)

    648     if len(pick) == 0:

    649         raise ValueError('No stim channel found to extract event
triggers.')

--> 650     data, _ = raw[pick, :]

    651

    652     events = _find_events(data, raw.first_samp, verbose=verbose,
output=output,



/u/01/mhhakone/unix/.local/lib/python2.7/site-packages/mne/io/base.pyc in
__getitem__(self, item)

    826             data = self._read_segment(start=start, stop=stop,
sel=sel,

    827                                       projector=self._projector,

--> 828                                       verbose=self.verbose)

    829         times = self.times[start:stop]

    830         return data, times



/u/01/mhhakone/unix/.local/lib/python2.7/site-packages/mne/io/base.pyc in
_read_segment(self, start, stop, sel, data_buffer,
projector,                                 verbose)

    515             self._read_segment_file(data[:, this_sl], idx, fi,

    516                                     int(start_file), int(stop_file),

--> 517                                     cals, mult)

    518             offset += n_read

    519         return data



/u/01/mhhakone/unix/.local/lib/python2.7/site-packages/mne/io/fiff/raw.pyc
in _read_segment_file(self, data, idx, fi, start, stop,
cals,                                 mult)

    393                                                   self.info
['nchan']),

    394                                            rlims=(first_pick,
last_pick)).data

--> 395                             one.shape = (picksamp, self.info
['nchan'])

    396                             _mult_cal_one(data[:, offset:(offset +
picksamp)],

    397                                           one.T, idx, cals, mult)



AttributeError: 'NoneType' object has no attribute 'shape'


Best,

Maria
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20171116/d08487eb/attachment.html 


More information about the Mne_analysis mailing list