Skip to content

mne python real-time - #213

Closed
chdinh wants to merge 11 commits into
mne-tools:masterfrom
chdinh:mne_rt
Closed

chdinh wants to merge 11 commits into
mne-tools:masterfrom
chdinh:mne_rt

Conversation

@chdinh

@chdinh chdinh commented Dec 4, 2012

Copy link
Copy Markdown
Member

for review - not ready to merge

Comment thread mne/fiff/realtime.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is overwritten by the line below

@agramfort

Copy link
Copy Markdown
Member

@mluessi @chdinh can we skype to discuss how to proceed with this?

topics I'd like to discuss are usecases and regarding the code : testing, code duplication, style (pep8, naming, etc.)

Glad to see @chdinh on the python side. Although the code looks a bit like C++ so far ;)

Comment thread mne/fiff/realtime.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one line space between methods, two between functions.

@dengemann

Copy link
Copy Markdown
Member

Very exciting Chris, glad to see this. As @agramfort indicated some pep8 / style issues are pending. Try to equip your editor of choice with a related plugin: http://pypi.python.org/pypi/pep8.

@mluessi

mluessi commented Dec 4, 2012

Copy link
Copy Markdown
Contributor

@chdinh looks great so far.. I was too tired last night to properly look at the code, so I only commented on one line ;-).

I think what we should aim for is something that abstracts away the network related things, such that the real time client behaves like a Raw/Epochs object and normal mne-python functions can be used to process the data.

@agramfort we can have a skype meeting today, I'm available most of the time.

@chdinh: have a look at http://pypi.python.org/pypi/flake8/ for style/syntax checking.

@mluessi

mluessi commented Jan 12, 2013

Copy link
Copy Markdown
Contributor

@chdinh it seems that there is something wrong with the channels. When running the example and then I do:

info['ch_names'] = [ch['ch_name'] for ch in info['chs']]
picks = mne.fiff.pick_types(info, meg='mag') 
import pylab as pl
pl.plot(raw_buffer[picks, :400].T)

I get:

rawbuff

As expected, the scales are wrong since the callibration haven't been applied. But some of the mag channels seem to be almost while others are always positive. This is not just the case for mag, but also other types, e.g. EEG:

rawbuff_eeg

Can you look into this? I think it may be a bug on the server side (I'm using the fiff file simulator).

PS: For the others, I'm currently reworking this PR, hopefully it should be ready for comments in a few days. The new version will have realtime Epochs class which can directly be used with the rest of me-python. The class will continuously receive data from the server, detect events, and maintain a FIFO queue of epochs. This (should) make realtime processing with mne-python very straightforward.

@chdinh

chdinh commented Jan 13, 2013

Copy link
Copy Markdown
Member Author

I'll look into it - seems something is wrong with the calibration...

@mluessi

mluessi commented Jan 13, 2013

Copy link
Copy Markdown
Contributor

Thanks. There is no calibration applied, so the values are much larger than expected. What's strange is that the waveforms don't look as expected (some are almost zero, others always positive) and there are these periodic spikes. It looks similar after calibration.

@dengemann

Copy link
Copy Markdown
Member

could also be some indexing bug.
had something similar looking for the pandas exportes, timeslices were picked instead of channels. just an idea

On 13.01.2013, at 21:12, Martin Luessi [email protected] wrote:

Thanks. There is no calibration applied, so the values are much larger than expected. What's strange is that the waveforms don't look as expected (some are almost zero, others always positive) and there are these periodic spikes. It looks similar after calibration.

—
Reply to this email directly or view it on GitHub.

@mluessi

mluessi commented Jan 14, 2013

Copy link
Copy Markdown
Contributor

Yes.. it was indeed just a simple reshape bug (I assumed the "nchan x n_times" raw buffer is in row-major order but it isn't, well, it is, but the shape is "n_times x nchan")

@dengemann

Copy link
Copy Markdown
Member

We should make a bug gallery somewhere, so one has a less hard time
identifying trouble ;-)

On Mon, Jan 14, 2013 at 4:05 PM, Martin Luessi [email protected]:

Yes.. it was indeed just a simple reshape bug (I assumed the "nchan x
n_times" raw buffer is in row-major order but it isn't, well, it is, but
the shape is "n_times x nchan")

—
Reply to this email directly or view it on GitHubhttps://github.com//pull/213#issuecomment-12221905.

@chdinh

chdinh commented Jan 14, 2013

Copy link
Copy Markdown
Member Author

Yes. How can we make it? - Is it possible inside github?
Something like Qt's tracker: https://bugreports.qt-project.org/browse/QTBUG

@dengemann

Copy link
Copy Markdown
Member

Or just using the wiki and posting an ugly bug / artifact image with the
explanation...

On Mon, Jan 14, 2013 at 4:30 PM, Christoph Dinh [email protected]:

Yes. How can we make it? - Is it possible inside github?
Something like Qt's tracker:
https://bugreports.qt-project.org/browse/QTBUG

—
Reply to this email directly or view it on GitHubhttps://github.com//pull/213#issuecomment-12223193.

@mluessi

mluessi commented Jan 14, 2013

Copy link
Copy Markdown
Contributor

Honestly, I think that would be a bit of an overkill.. I was a bit dense to not realize what's going on ;-) and it's not like we always run into the same problems.

@dengemann

Copy link
Copy Markdown
Member

Actually I was joking in parts ;-) then wanted to see where this goes. It's
already good that we post stuff here and read each others posts ;-)

On Mon, Jan 14, 2013 at 4:45 PM, Martin Luessi [email protected]:

Honestly, I think that would be a bit of an overkill.. I was a bit dense
to not realize what's going on ;-) and it's not like we always run into the
same problems.

—
Reply to this email directly or view it on GitHubhttps://github.com//pull/213#issuecomment-12223930.

@mluessi

mluessi commented Jan 14, 2013

Copy link
Copy Markdown
Contributor

Good. I assumed you were joking ;-)

@mluessi mluessi mentioned this pull request Jan 14, 2013
@larsoner

Copy link
Copy Markdown
Member

@chdinh can we close this since @mluessi has a new PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants