Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: draft of mne report command #1261

Closed
wants to merge 61 commits into from
Closed

ENH: draft of mne report command #1261

wants to merge 61 commits into from

Conversation

mainakjas
Copy link
Contributor

Closes #1056

Try

 mne report -p MNE-sample-data/ -i MNE-sample-data/MEG/sample/sample_audvis-ave.fif -d MNE-sample-data/subjects/ -s sample -x -v

and it should generate report.html in MNE-sample-data/

Sample output here: https://dl.dropboxusercontent.com/u/3915954/report.html

TODOS

  • recursive exploration
  • rebase and use read_evokeds
  • extend the support to as many fif files types
    • cov
    • fwd
    • inv
    • raw
    • trans (display head in helmet to check coregistration quality in mne.viz.plot_trans())
    • epo : plot_drop_log
  • check dpi settings
  • Slicer coordinates
  • Table of contents linking to different parts of html?
  • the bootstrap/JS theme should allow to select which type of fif file to display. See jquery toggle
  • also bad fif files should appear in red for example if the fif fname is not standard (evoked should end with -ave.fif, cov with -cov.fif, raw with raw.fif or sss.fiff etc....)
  • banner + footer
  • open the report in a browser when generated


from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
import pylab
Copy link
Member

Choose a reason for hiding this comment

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

use pyplot

Copy link
Member

Choose a reason for hiding this comment

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

and plt shortcut

@agramfort
Copy link
Member

can you update the PR header with tick boxes with the todos that comes to mind?

@mainakjas
Copy link
Contributor Author

@agramfort @dengemann : what do we do about viewing raw data? sliders in mne_browse_raw style? writing binary images may be very cumbersome -- should we hack something in d3 ? something like this: https://github.com/mbostock/d3/wiki/Zoom-Behavior + tempita. Any other suggestions?

@agramfort
Copy link
Member

for now for the Raw just print the REPR and the info repr

a javascript raw browser is beyond the scope for a minimal working PR

@agramfort
Copy link
Member

+1 for Table of contents linking to different parts of html

the bootstrap/JS theme should allow to select which type of fif file to display. See jquery toggle

also bad fif files should appear in red for example if the fif fname is not standard (evoked should end with -ave.fif, cov with -cov.fif, raw with raw.fif or sss.fiff etc....)

@mainakjas
Copy link
Contributor Author

ok, we now have a table of contents + bad file names in red. Does mne.fiff.read_evokeds have a verbose option ? Because I want to turn off logging for that.

@agramfort
Copy link
Member

Does mne.fiff.read_evokeds have a verbose option ? Because I want to turn off logging for that.

if not please open a PR to fix this. Or maybe wait for the io module PR to be merged to avoid a merging/rebasing mess...

@agramfort
Copy link
Member

how about a black banner on top as in :

http://getbootstrap.com/examples/jumbotron/

that says "MNE Report for /path/to/folfer"

in the footer a link saying

"Powered by MNE"

with a link to martinos.org/mne

just coming up with ideas to make it nice and look pro :)

@agramfort
Copy link
Member

you should also think of how to render the -trans.fif files.

it would be great to display head in helmet to check coregistration quality. You'll need a bit of work to make it work. I recommend to do it in another PR with a mne.viz.plot_trans function.

@larsoner
Copy link
Member

+1, that would be awesome. I can also work on this if @mainakjas your time is better spent elsewhere. If you do want to work on it, all the transformations, surfaces, and their relationships that you need you can dig out of the field lines example.

@mainakjas
Copy link
Contributor Author

Thanks @agramfort @Eric89GXL. I am just updating the mne-report with the navbar + footer as we speak + some other minor modifications. Nice idea about checking coregistration quality but I'll check in a day or two to estimate how much effort is required there.

@agramfort
Copy link
Member

Another idea is to open the report in a browser when generated. Look at how "ipython notebook" does it

@mainakjas
Copy link
Contributor Author

ok, sounds good. I have now added the navbar + footer. The button toggling has been included in the navbar now such that all buttons (eve, cov etc) are in the "on" state initially but the user can turn them off as required.

@mainakjas
Copy link
Contributor Author

would you be ok with a dependency on splinter ? I know that can open the browser from python. Not sure if there are other ways.

@maedoc
Copy link
Contributor

maedoc commented May 12, 2014

open browser from Python

Fwiw, this is part of webbrowser in the standard library:

import webbrowser
webbrowser.open_new_tab("http://localhost:8888")

@agramfort
Copy link
Member

beautiful !

thanks for the tip

@mainakjas
Copy link
Contributor Author

@agramfort : just to be sure, what are the coordinates X, Y, Z? Do we need those since the slider values are displayed below the image anyway?

@mainakjas
Copy link
Contributor Author

also, what about the color map selector for *.mgz files? I suppose that'll blow the size of the html file exponentially. Maybe we should just expose the option of selecting color map from python and not html?

@agramfort
Copy link
Member

Drop cmap support and use only gray

@agramfort
Copy link
Member

@agramfort : just to be sure, what are the coordinates X, Y, Z? Do we need those since the slider values are displayed below the image anyway?

Probably not

@agramfort
Copy link
Member

any progress here?

you should address the plot_trans function but in a different PR.

another PR you could write is one that throws warning with saving and reading fif files with non-standard extensions. To force gently the use of our conventions...

@mainakjas
Copy link
Contributor Author

I'm back at this now. Will make new PR soon :)

@dengemann
Copy link
Member

@mainakjas how is it going here? Let me know as soon as you think you could need a hang out.

@mainakjas
Copy link
Contributor Author

I'll look at plot_trans function next unless something else should get higher priority.

@agramfort
Copy link
Member

I'll look at plot_trans function next

+1

jasmainak and others added 24 commits July 19, 2014 01:21
- Use plot_cov to get covariance plots
- Fix tests
- Make _render_eve work without sfreq
FIX1: Use realpath instead of abspath
FIX2: Do not try to render -trans.fif if subjects_dir and subject not provided
FIX3: Pass full path for saving report. Default is self.data_path
@coveralls
Copy link

coveralls commented Jul 19, 2014

Coverage Status

Coverage increased (+8.8%) to 64.483% when pulling 115bff6 on mainakjas:mne-report into 30312d5 on mne-tools:master.

@agramfort
Copy link
Member

you have my +1 for merge !

any other last review?

if you're bored today you could add a -j param to build the html in parallel :)

@agramfort
Copy link
Member

merged by rebase !

awesome work @mainakjas !

@agramfort agramfort closed this Jul 19, 2014
@dengemann
Copy link
Member

@mainakjas hooray!!!

@mainakjas
Copy link
Contributor Author

indeed @dengemann !

On Sat, Jul 19, 2014 at 4:41 PM, Denis A. Engemann <notifications@github.com

wrote:

@mainakjas https://github.com/mainakjas hooray!!!


Reply to this email directly or view it on GitHub
#1261 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Web based viz
9 participants