mne_process_raw: event extraction

Hi group,

I have been trying to extract events from my raw data with the mne_process_raw command. I have changed the STI channel from STI 014 to STI101 per Matti's instructions:

'mne_process_raw --raw %s/raw_data/%s_%s_raw.fif --eventsout %s/triggers/%s_%s.eve --digtrig STI_101'

and 0 events are extracted. I receive the following message:

0 events found in /autofs/space/.../raw_data/MVS1_12_B8_raw-eve.fif
Trigger channel : STI 101 max_event : 0

--- Saving events (leading edge) in text format to /autofs/space/.../triggers/MVS1_12_B8.eve ---

No events to save

I have looked into the raw fif files to check to see whether or not the triggers were recorded and they were. Is there something else that I need to do/define in order to extract the events successfully?

Thanks in advance again,

Reid

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

Hey Reid,

We also use STI101. Depending on how the channel is actually named,
you might not need that underscore and should use

--digtrig 'STI101'

That's what works for us---single quotes on each side, no spaces---but
you might need to adjust with/without spaces and/or underscores based
on how your system actually names that channel.

Cheers,
Eric

Hi all again,

Thanks for all your responses. I have tried with/without spaces, and/or underscores, and with single quotes and none of these options allows me to get the channels. I still get this readout:

0 events found in /autofs/space/.../raw_data/MVS1_12_B8_raw-eve.fif
Trigger channel : STI101 max_event : 0

-Reid

I'd suggest loading up MATLAB (or Python, the code will be very
similar) and trying something like this:

inFile = fullfile('raw_dir','MVS1_12_B8_raw.fif');
raw = fiff_setup_read_raw(inFile,true)
STIInd = find(~cellfun(@isempty,strfind(raw.info.ch_names,'STI101')));
picks = fiff_pick_channels(raw.info.ch_names,[],[]);
data = fiff_read_raw_segment(raw,raw.first_samp,raw.last_samp,picks);
trigData = data(STIInd,:);

Then your trigger channel data should be in "trigData". This way you
can also manually examine raw.info.ch_names to see what it's called,
and once you find it, you can look at the raw data to see what's going
on. I had a problem at one point where a high bit (32 I think?) was
stuck on, so no lower-value events (1/2/4/8) were detected, so I had
to pull them out of the raw data myself with a script. Hopefully
that's not your issue, but it could be.

Eric

Hi Reid,
  If you recorded at the Martinos center, try STI102 instead of STI101 to
see if your triggers are there..

Regards,
Hari

Hi Reid,

Did you have both STI101 and STI102 on in your acquisition. If so, STI101 is the trigger box in the stimulus cabinet next to the electronics and STI102 is the one next to the console. Otherwise, the two trigger boxes work in parallel and the triggers will be on STI101.

- Matti

Eric:

I was able to perform your code in Matlab on my dataset and it showed me where exactly STI101 was located, STIInd = 379. We are hoping to not have to create a separate matlab script to extract the events since we are mid-way through a project that has used the mne commands and want to use the same processing stream.

Hari:

I have tried STI102 as well and still receive the 0 events message that I've reported in earlier messages.

Matti:

We only had STI101 on in our acquisition since we do not have many triggers and do not need the parallel trigger box. Using Eric's script, I can see the triggers are in STI101 and that STI102 is not even listed in raw.info.ch_names . In addition to this, I have checked in mne_browse_raw and I can see the triggers under STI101; though, I need to go to Adjust, then Selection in the menu and manually add the STI101 channel to view it. Perhaps this is associated with the mnw_process_raw problem that I also have: while marking bad channels I can visually see the channels in mne_browse_raw, but when I try to mark the bad channels using mne_mark_bad_channels it prints out that in the raw-eve.fif file there is no insertion point and that in the raw.fif file no channel called <> [is] in the data file.

Thanks all for your responses,

-Reid

Eric,

Can you put the file somewhere where it is accessible to me.

- Matti

Hi Reid,

Now I realize what the problem is. The name of the stim channel is STI101, not STI 101 (with space). Therefore, the correct option is

--digtrig STI101

The underscore in the channel name is by convention converted into space as hopefully told in the manual.

- Matti

Hi Matti,

I tried that initially using this command:

mne_process_raw --raw %s/raw_data/%s_%s_raw.fif --eventsout %s/triggers/%s_%s.eve --digtrig STI101

and am still receiving the following message:

0 events found in /autofs/space/.../raw_data/MVS1_12_B8_raw-eve.fif
Trigger channel : STI101 max_event : 0

--- Saving events (leading edge) in text format to /autofs/space/.../triggers/MVS1_12_B8.eve ---

No events to save

Were you able to successfully extract the events from the raw fif that I left for you?

-Reid

Reid,

For me it works fine. Try again after removing MVS1_12_B8_raw-eve.fif first. It should not make a difference, though.

- Matti