ENH: Add source links, fix CSS

This commit is contained in:
Eric Larson
2016-10-18 22:09:24 -04:00
parent 65a4eb0407
commit 45104f7cfd
17 changed files with 594 additions and 558 deletions
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 37 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 868 B

After

Width:  |  Height:  |  Size: 980 B

+46 -122
View File
@@ -1,138 +1,62 @@
body {
font-family: 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', 'Verdana', sans-serif;
/* Override bootstrap.min.css to avoid .. container:: padding problems */
.nosize {
width: auto;
}
.nopad {
padding: 0px;
}
.halfpad {
margin-left: 1%;
margin-right: 1%;
width: 48%;
padding: 0px;
margin: 10px;
float: left;
}
/* Display content (e.g., images) in the middle center of a div */
.midcenter {
display: table-cell;
vertical-align:middle;
text-align: center;
float: none;
height: 300px;
}
/* Omit the version in the navbar */
.navbar-version {
display: none;
}
a {
color: rgb(41, 122, 204);
text-decoration: none;
}
a:hover {
color: rgb(102, 179, 255);
}
h2 a {
color: rgb(0,0,0);
text-decoration: none;
}
h1 {
font-weight: 1000;
}
h2 {
background-color: rgb(255,255,255);
font-size: 140%;
font-weight: 800;
}
h3 {
font-size: 110%;
font-weight: 600;
}
/* Many Sphinx-rendered things are put in blockquotes, don't change size*/
blockquote {
font-size: 100% !important;
}
code {
color: rgb(61, 107, 153) !important;
background-color: rgb(230, 242, 255) !important;
}
/* This is our dev warning bar */
.devbar {
background-color: rgb(242, 80, 80);
color: white;
font-weight:bold;
text-align: center;
padding: 10px;
min-width: 910px;
vertical-align: middle;
}
.devbar a {
color: rgb(255, 238, 0);
text-decoration: none;
/* Override the sphinx-gallery download ugliness */
div.sphx-glr-download a {
background-color: inherit;
background-image: inherit;
border-radius: inherit;
border: 1px solid #000;
color: inherit;
display: inherit;
/* Not valid in old browser, hence we keep the line above to override */
display: inherit;
font-weight: inherit;
padding: inherit;
text-align: inherit;
}
.devbar a:hover {
color: black;
text-decoration: underline;
}
#navbar a:hover {
color: rgb(242, 80, 80);
}
.note a {
color: rgb(0,0,255);
}
.note {
background-color: rgb(204, 230, 255);
color: rgb(0, 0, 0);
border: none;
}
.note pre {
background-color: rgb(242, 249, 255);
}
blockquote {
padding: 0 0 0 15px;
margin: 0 0 20px;
border-left: 5px solid #eeeeee;
}
.span.box {
width: 47%;
height: 230px;
float: left;
border-radius: 20px;
background: rgb(242, 249, 255);
border-style: solid;
border-color: rgb(143, 173, 204);
margin: 5px;
padding: 0px 0px 0px 10px;
}
.span h2 {
background: rgb(242, 249, 255);
}
.span.box code {
background-color: rgb(204, 230, 255) !important;
}
/* OVERRIDES */
.sphx-glr-download {
background-color: rgb(204, 230, 255);
border-radius: 10px;
border-style: solid;
border-color: rgb(143, 173, 204);
max-width: 55ex;
}
.highlight pre {
background-color: rgb(242, 249, 255) !important;
}
.warning {
background-color: rgb(230, 57, 57);
color: white;
}
.warning a {
color: rgb(255, 238, 0);
}
dt:target, .highlighted {
background-color: rgb(255, 238, 0);
}
dt:target code {
color: inherit !important;
background-color: inherit !important;
}
.label { /* Necessary for multiple refs, from bootstrap.min.css:7 */
color: #2c3e50;
}
div.sphx-glr-download a:hover {
box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 5px rgba(0,0,0,.25);
text-decoration: none;
background-image: none;
background-color: inherit;
}
+2 -2
View File
@@ -44,8 +44,8 @@
{% block relbar1 %}
{% if build_dev_html|tobool %}
<div class="devbar">
This documentation is for the development version ({{ release }}) - <a href="http://martinos.org/mne/stable">Stable version</a>
<div class="row devbar alert alert-danger">
This documentation is for the <strong>development version ({{ release }})</strong> - <a href="http://martinos.org/mne/stable">switch to Stable</a>
</div>
{% endif %}
-17
View File
@@ -1,17 +0,0 @@
.. _cite:
How to cite MNE
---------------
If you use the implementations provided by the MNE software in your research, you should cite:
[1] A. Gramfort, M. Luessi, E. Larson, D. Engemann, D. Strohmeier, C. Brodbeck, L. Parkkonen, M. Hämäläinen, `MNE software for processing MEG and EEG data <http://www.ncbi.nlm.nih.gov/pubmed/24161808>`_, NeuroImage, Volume 86, 1 February 2014, Pages 446-460, ISSN 1053-8119, `[DOI] <http://dx.doi.org/10.1016/j.neuroimage.2013.10.027>`__
If you use the Python code you should cite as well:
[2] A. Gramfort, M. Luessi, E. Larson, D. Engemann, D. Strohmeier, C. Brodbeck, R. Goj, M. Jas, T. Brooks, L. Parkkonen, M. Hämäläinen, `MEG and EEG data analysis with MNE-Python <http://journal.frontiersin.org/article/10.3389/fnins.2013.00267/abstract>`_, Frontiers in Neuroscience, Volume 7, 2013, ISSN 1662-453X, `[DOI] <http://dx.doi.org/10.3389/fnins.2013.00267>`__
To cite specific versions of the software, you can use the DOIs provided by
`Zenodo <https://zenodo.org/search?ln=en&p=mne-python>`_.
You should as well cite the related method papers, some of which are listed in :ref:`ch_reading`.
+84 -19
View File
@@ -12,11 +12,15 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import inspect
import os
from os.path import relpath, dirname
import sys
from datetime import date
import sphinx_gallery
import sphinx_gallery # noqa
import sphinx_bootstrap_theme
from numpydoc import numpydoc, docscrape # noqa
import mne
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
@@ -25,7 +29,6 @@ curdir = os.path.dirname(__file__)
sys.path.append(os.path.abspath(os.path.join(curdir, '..', 'mne')))
sys.path.append(os.path.abspath(os.path.join(curdir, 'sphinxext')))
import mne
if not os.path.isdir('_images'):
os.mkdir('_images')
@@ -34,26 +37,26 @@ if not os.path.isdir('_images'):
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# XXX This hack defines what extra methods numpydoc will document
docscrape.ClassDoc.extra_public_methods = mne.utils._doc_special_members
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
from numpydoc import numpydoc, docscrape
docscrape.ClassDoc.extra_public_methods = mne.utils._doc_special_members
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.coverage',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.linkcode',
'sphinx.ext.mathjax',
'sphinx.ext.todo',
'sphinx_gallery.gen_gallery',
'numpydoc',
'gen_commands',
]
extensions += ['numpydoc']
extensions += ['gen_commands'] # auto generate the doc for the python commands
# extensions += ['flow_diagram] # generate flow chart in cookbook
autosummary_generate = True
autodoc_default_flags = ['inherited-members']
@@ -118,7 +121,7 @@ exclude_patterns = ['source/generated']
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = 'manni' # friendly, manni, murphy, tango
# A list of ignored prefixes for module index sorting.
modindex_common_prefix = ['mne.']
@@ -137,17 +140,20 @@ html_theme = 'bootstrap'
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {
'navbar_title': ' ',
'source_link_position': "footer",
'bootswatch_theme': "flatly",
'navbar_sidebarrel': False,
'bootstrap_version': "3",
'navbar_title': ' ', # we replace this with an image
'source_link_position': "nav", # default
'bootswatch_theme': "cerulean", # yeti paper lumen
'navbar_sidebarrel': False, # Render the next/prev links in navbar?
'navbar_pagenav': False,
'navbar_class': "navbar navbar-inverse",
'bootstrap_version': "3", # default
'navbar_links': [
("Get started", "getting_started"),
("Tutorials", "tutorials"),
("Gallery", "auto_examples/index"),
("API", "python_reference"),
("Manual", "manual/index"),
("Contribute", "contributing"),
("FAQ", "faq"),
],
}
@@ -272,6 +278,8 @@ intersphinx_mapping = {
'python': ('http://docs.python.org/', None),
'numpy': ('http://docs.scipy.org/doc/numpy-dev/', None),
'scipy': ('http://scipy.github.io/devdocs/', None),
'sklearn': ('http://scikit-learn.org/stable/', None),
'matplotlib': ('http://matplotlib.org/', None),
}
examples_dirs = ['../examples', '../tutorials']
@@ -291,8 +299,8 @@ sphinx_gallery_conf = {
'reference_url': {
'mne': None,
'matplotlib': 'http://matplotlib.org',
'numpy': 'http://docs.scipy.org/doc/numpy-1.10.1',
'scipy': 'http://docs.scipy.org/doc/scipy-0.17.0/reference',
'numpy': 'http://docs.scipy.org/doc/numpy/reference',
'scipy': 'http://docs.scipy.org/doc/scipy/reference',
'mayavi': 'http://docs.enthought.com/mayavi/mayavi'},
'examples_dirs': examples_dirs,
'gallery_dirs': gallery_dirs,
@@ -302,3 +310,60 @@ sphinx_gallery_conf = {
}
numpydoc_class_members_toctree = False
# -----------------------------------------------------------------------------
# Source code links (adapted from SciPy (doc/source/conf.py))
# -----------------------------------------------------------------------------
def linkcode_resolve(domain, info):
"""
Determine the URL corresponding to Python object
"""
if domain != 'py':
return None
modname = info['module']
fullname = info['fullname']
submod = sys.modules.get(modname)
if submod is None:
return None
obj = submod
for part in fullname.split('.'):
try:
obj = getattr(obj, part)
except:
return None
try:
fn = inspect.getsourcefile(obj)
except:
fn = None
if not fn:
try:
fn = inspect.getsourcefile(sys.modules[obj.__module__])
except:
fn = None
if not fn:
return None
try:
source, lineno = inspect.getsourcelines(obj)
except:
lineno = None
if lineno:
linespec = "#L%d-L%d" % (lineno, lineno + len(source) - 1)
else:
linespec = ""
fn = relpath(fn, start=dirname(mne.__file__))
if 'git' in mne.__version__:
return "http://github.com/mne-tools/mne-python/blob/master/mne/%s%s" % ( # noqa
fn, linespec)
else:
return "http://github.com/mne-tools/mne-python/blob/maint/%s/mne/%s%s" % ( # noqa
mne.__version__, fn, linespec)
+46
View File
@@ -19,6 +19,32 @@ Help! I can't get Python and MNE-Python working!
Check out our section on how to get Anaconda up and running over at the
:ref:`getting started page <install_interpreter>`.
I still can't get it to work!
-----------------------------
For analysis talk, join the `MNE mailing list`_. File specific feature
requests or bug reports `on GitHub <https://github.com/mne-tools/mne-python/issues/>`_.
You can also chat with developers `on Gitter <https://gitter.im/mne-tools/mne-python>`_.
How do I contribute?
--------------------
Check out the :ref:`contributing` page.
How do I cite MNE?
------------------
If you use the implementations provided by the MNE software in your research,
you should cite:
- A. Gramfort, M. Luessi, E. Larson, D. Engemann, D. Strohmeier, C. Brodbeck, L. Parkkonen, M. Hämäläinen, `MNE software for processing MEG and EEG data <http://www.ncbi.nlm.nih.gov/pubmed/24161808>`_, NeuroImage, Volume 86, 1 February 2014, Pages 446-460, ISSN 1053-8119, `[DOI] <http://dx.doi.org/10.1016/j.neuroimage.2013.10.027>`__
If you use the Python code you should cite as well:
- A. Gramfort, M. Luessi, E. Larson, D. Engemann, D. Strohmeier, C. Brodbeck, R. Goj, M. Jas, T. Brooks, L. Parkkonen, M. Hämäläinen, `MEG and EEG data analysis with MNE-Python <http://journal.frontiersin.org/article/10.3389/fnins.2013.00267/abstract>`_, Frontiers in Neuroscience, Volume 7, 2013, ISSN 1662-453X, `[DOI] <http://dx.doi.org/10.3389/fnins.2013.00267>`__
To cite specific versions of the software, you can use the DOIs provided by
`Zenodo <https://zenodo.org/search?ln=en&p=mne-python>`_.
You should as well cite the related method papers, some of which are listed in :ref:`ch_reading`.
I'm not sure how to do *X* analysis step with my *Y* data...
------------------------------------------------------------
@@ -87,6 +113,26 @@ which is based on the
h5py_, to save data in a fast, future-compatible, standard format.
I downloaded a dataset once, but MNE-Python is asking to download it again. What gives?
------------------------------------------------------------------------------------------
The default location for the MNE-sample data is ``~/mne_data``.
If you downloaded data and an example asks you whether to download it again,
make sure the data reside in the examples directory and that you run the
script from its current directory:
.. code-block:: bash
$ cd examples/preprocessing
Then in Python you can do::
In [1]: %run plot_find_ecg_artifacts.py
See :ref:`datasets` for a list of all available datasets and some advanced
configuration options, e.g. to specify a custom location for storing the
datasets.
Resampling and decimating data
==============================
+96 -78
View File
@@ -1,32 +1,9 @@
.. include:: links.inc
.. _getting_started:
.. _get_started:
Getting started
===============
.. _introduction_to_mne:
**MNE** is an academic software package that aims to provide data analysis
pipelines encompassing all phases of M/EEG data processing.
MNE started as tool written in C by Matti Hämäläinen while at MGH in Boston.
MNE was then extended with the Python programming language to implement
nearly all MNE-Cs functionality, offer transparent scripting, and
:ref:`extend MNE-Cs functionality considerably <what_can_you_do>`.
A basic :ref:`ch_matlab` is also available mostly
to allow reading and write MNE files. The sister :ref:`mne_cpp` project
aims to provide modular and open-source tools for acquisition,
visualization, and analysis.
.. note:: This package is based on the FIF file format from Neuromag. But, it
can read and convert CTF, BTI/4D, KIT and various EEG formats to
FIF (see :ref:`IO functions <ch_convert>`).
If you have been using MNE-C, there is no need to convert your fif
files to a new system or database -- MNE-Python works nicely with
the historical fif files.
Get started
============
Installation
------------
@@ -35,67 +12,74 @@ To get started with MNE, visit the installation instructions for
:ref:`MNE-Python <install_python_and_mne_python>` and
:ref:`MNE-C <install_mne_c>`:
.. container:: span box
.. container:: row
.. raw:: html
.. container:: panel panel-default halfpad
<h3>MNE-Python</h3>
.. container:: panel-heading nosize
.. toctree::
:maxdepth: 2
MNE-Python
install_mne_python
.. container:: panel-body nosize
.. container:: span box
.. toctree::
:maxdepth: 2
.. raw:: html
install_mne_python
<h3>MNE-C</h3>
.. container:: panel panel-default halfpad
.. toctree::
:maxdepth: 2
.. container:: panel-heading nosize
install_mne_c
MNE-C
.. container:: panel-body nosize
.. toctree::
:maxdepth: 2
install_mne_c
.. container:: row
.. container:: col-md-8
.. _what_can_you_do:
.. raw:: html
<h2>What can you do with MNE-Python?</h2>
- **Raw data visualization** to visualize recordings
(see :ref:`general_examples` for more).
- **Epoching**: Define epochs, baseline correction, handle conditions etc.
- **Averaging** to get Evoked data.
- **Compute SSP projectors** to remove ECG and EOG artifacts.
- **Compute ICA** to remove artifacts or select latent sources.
- **Maxwell filtering** to remove environmental noise.
- **Boundary Element Modeling**: single and three-layer BEM model
creation and solution computation.
- **Forward modeling**: BEM computation and mesh creation
(see :ref:`ch_forward`).
- **Linear inverse solvers** (dSPM, sLORETA, MNE, LCMV, DICS).
- **Sparse inverse solvers** (L1/L2 mixed norm MxNE, Gamma Map,
Time-Frequency MxNE, RAP-MUSIC).
- **Connectivity estimation** in sensor and source space.
- **Visualization of sensor and source space data**
- **Time-frequency** analysis with Morlet wavelets (induced power,
intertrial coherence, phase lock value) also in the source space.
- **Spectrum estimation** using multi-taper method.
- **Mixed Source Models** combining cortical and subcortical structures.
- **Dipole Fitting**
- **Decoding** multivariate pattern analysis of M/EEG topographies.
- **Compute contrasts** between conditions, between sensors, across
subjects etc.
- **Non-parametric statistics** in time, space and frequency
(including cluster-level).
- **Scripting** (batch and parallel computing)
.. _what_can_you_do:
What can you do with MNE using Python?
--------------------------------------
- **Raw data visualization** to visualize recordings
(see :ref:`general_examples` for more).
- **Epoching**: Define epochs, baseline correction, handle conditions etc.
- **Averaging** to get Evoked data.
- **Compute SSP projectors** to remove ECG and EOG artifacts.
- **Compute ICA** to remove artifacts or select latent sources.
- **Maxwell filtering** to remove environmental noise.
- **Boundary Element Modeling**: single and three-layer BEM model
creation and solution computation.
- **Forward modeling**: BEM computation and mesh creation
(see :ref:`ch_forward`).
- **Linear inverse solvers** (dSPM, sLORETA, MNE, LCMV, DICS).
- **Sparse inverse solvers** (L1/L2 mixed norm MxNE, Gamma Map,
Time-Frequency MxNE, RAP-MUSIC).
- **Connectivity estimation** in sensor and source space.
- **Visualization of sensor and source space data**
- **Time-frequency** analysis with Morlet wavelets (induced power,
intertrial coherence, phase lock value) also in the source space.
- **Spectrum estimation** using multi-taper method.
- **Mixed Source Models** combining cortical and subcortical structures.
- **Dipole Fitting**
- **Decoding** multivariate pattern analysis of M/EEG topographies.
- **Compute contrasts** between conditions, between sensors, across
subjects etc.
- **Non-parametric statistics** in time, space and frequency
(including cluster-level).
- **Scripting** (batch and parallel computing)
Is that all you can do with MNE-Python?
---------------------------------------
Short answer is **No**! You can also do:
There is much more beyond these general categories such as:
- detect heart beat QRS component
- detect eye blinks and EOG artifacts
@@ -116,8 +100,42 @@ Short answer is **No**! You can also do:
- and many more things ...
What you're not supposed to do with MNE-Python
----------------------------------------------
What you're not supposed to do with MNE-Python:
- **Brain and head surface segmentation** for use with BEM
models -- use Freesurfer_.
.. container:: col-md-4
.. container:: panel panel-info nosize nopad
.. container:: panel-heading nosize
Historical notes
.. container:: panel-body nosize
MNE started as tool written in C by Matti Hämäläinen while at MGH in
Boston.
- :ref:`MNE-C <c_reference>` is Matti's C code.
- MNE-Python was built in the Python programming language to reimplement
all MNE-Cs functionality, offer transparent scripting, and extend
MNE-Cs functionality considerably (see left). Thus it is the
primary focus of this documentation.
- :ref:`ch_matlab` is available mostly to allow reading and writing
FIF files.
- :ref:`mne_cpp` aims to provide modular and open-source tools for
real-time acquisition, visualization, and analysis. It provides
a :ref:`separate website <mne_cpp>` for documentation and releases.
The MNE tools are based on the FIF file format from Neuromag.
However, MNE-Python can read native CTF, BTI/4D, KIT and various
EEG formats (see :ref:`IO functions <ch_convert>`).
If you have been using MNE-C, there is no need to convert your fif
files to a new system or database -- MNE-Python works nicely with
the historical fif files.
+106 -123
View File
@@ -2,151 +2,134 @@
.. include:: links.inc
.. raw:: html
.. container:: row extra-bottom-padding
<div class="container"><div class="row">
<div class="col-md-8"><div style="text-align: center; height: 270px">
<span style="display: inline-block; height: 100%; vertical-align: middle"></span>
<a href="index.html"><img src="_static/mne_logo.png" border="0" alt="MNE" style="vertical-align: middle"></a>
</div></div>
<div class="col-md-4"><div style="float: left">
<a href="index.html"><img src="_static/institutions.png"" border="0" alt="Institutions"/></a>
</div></div>
</div></div>
.. container:: col-md-8 nopad
.. raw:: html
.. container:: midcenter nopad
<div class="container-fluid">
<div class="row">
<div class="col-md-8">
<br>
.. image:: _static/mne_logo.png
:alt: MNE
MNE is a community-driven software package designed for **processing
electroencephalography (EEG) and magnetoencephalography (MEG) data**
providing comprehensive tools and workflows for
(:ref:`among other things <what_can_you_do>`):
.. container:: col-md-4 nopad
1. Preprocessing and denoising
2. Source estimation
3. Timefrequency analysis
4. Statistical testing
5. Estimation of functional connectivity
6. Applying machine learning algorithms
7. Visualization of sensor- and source-space data
.. container:: col-md-8 midcenter nopad
MNE includes a comprehensive Python_ package supplemented by tools compiled
from C code for the LINUX and Mac OSX operating systems, as well as a MATLAB toolbox.
**From raw data to source estimates in about 30 lines of code** (Try it :ref:`by installing it <getting_started>` or `in an experimental online demo <http://mybinder.org/repo/mne-tools/mne-binder/notebooks/plot_introduction.ipynb>`_!):
.. code:: python
>>> import mne # doctest: +SKIP
>>> raw = mne.io.read_raw_fif('raw.fif', preload=True) # load data # doctest: +SKIP
>>> raw.info['bads'] = ['MEG 2443', 'EEG 053'] # mark bad channels # doctest: +SKIP
>>> raw.filter(l_freq=None, h_freq=40.0) # low-pass filter data # doctest: +SKIP
>>> # Extract epochs and save them:
>>> picks = mne.pick_types(raw.info, meg=True, eeg=True, eog=True, # doctest: +SKIP
>>> exclude='bads') # doctest: +SKIP
>>> events = mne.find_events(raw) # doctest: +SKIP
>>> reject = dict(grad=4000e-13, mag=4e-12, eog=150e-6) # doctest: +SKIP
>>> epochs = mne.Epochs(raw, events, event_id=1, tmin=-0.2, tmax=0.5, # doctest: +SKIP
>>> proj=True, picks=picks, baseline=(None, 0), # doctest: +SKIP
>>> preload=True, reject=reject) # doctest: +SKIP
>>> # Compute evoked response and noise covariance
>>> evoked = epochs.average() # doctest: +SKIP
>>> cov = mne.compute_covariance(epochs, tmax=0) # doctest: +SKIP
>>> evoked.plot() # plot evoked # doctest: +SKIP
>>> # Compute inverse operator:
>>> fwd_fname = 'sample_audvismegeegoct6fwd.fif' # doctest: +SKIP
>>> fwd = mne.read_forward_solution(fwd_fname, surf_ori=True) # doctest: +SKIP
>>> inv = mne.minimum_norm.make_inverse_operator(raw.info, fwd, # doctest: +SKIP
>>> cov, loose=0.2) # doctest: +SKIP
>>> # Compute inverse solution:
>>> stc = mne.minimum_norm.apply_inverse(evoked, inv, lambda2=1./9., # doctest: +SKIP
>>> method='dSPM') # doctest: +SKIP
>>> # Morph it to average brain for group study and plot it
>>> stc_avg = mne.morph_data('sample', 'fsaverage', stc, 5, smooth=5) # doctest: +SKIP
>>> stc_avg.plot() # doctest: +SKIP
MNE development is driven by :ref:`extensive contributions from the community <whats_new>`.
Direct financial support for the project has been provided by:
- (US) National Institute of Biomedical Imaging and Bioengineering (NIBIB)
grants 5R01EB009048 and P41EB015896 (Center for Functional Neuroimaging
Technologies)
- (US) NSF awards 0958669 and 1042134.
- (US) NCRR *Center for Functional Neuroimaging Technologies* P41RR14075-06
- (US) NIH grants 1R01EB009048-01, R01 EB006385-A101, 1R01 HD40712-A1, 1R01
NS44319-01, and 2R01 NS37462-05
- (US) Department of Energy Award Number DE-FG02-99ER62764 to The MIND
Institute.
- (FR) IDEX Paris-Saclay, ANR-11-IDEX-0003-02, via the
`Center for Data Science <http://www.datascience-paris-saclay.fr/>`_.
- (FR) European Research Council (ERC) Starting Grant (ERC-YStG-263584).
- (FR) French National Research Agency (ANR-14-NEUC-0002-01).
- (FR) European Research Council (ERC) Starting Grant (ERC-YStG-676943).
- Amazon Web Services - Research Grant issued to Denis A. Engemann
.. raw:: html
<div class="col-md-8">
<script type="text/javascript" src="http://www.ohloh.net/p/586838/widgets/project_basic_stats.js"></script>
</div>
.. image:: _static/institutions.png
:alt: Institutions
.. raw:: html
.. container:: row
</div>
<div class="col-md-4">
<h2>Documentation</h2>
.. container:: col-md-8
.. toctree::
:maxdepth: 1
Community-driven software for **processing time-resolved neural
signals including magneto- and electro-encephalography (MEG, EEG)**,
offering comprehensive data analysis tools for Windows, OSX, and Linux:
getting_started
tutorials
auto_examples/index
faq
contributing
- Preprocessing and denoising
- Source estimation
- Timefrequency analysis
- Statistical testing
- Functional connectivity
- Machine learning
- Visualization of sensor- and source-space data
- And :ref:`much more <get_started>`
.. toctree::
:maxdepth: 1
From raw data to source estimates **in about 20 lines of code** (try it `in an experimental online demo <http://mybinder.org/repo/mne-tools/mne-binder/notebooks/plot_introduction.ipynb>`_!)::
python_reference
manual/index
whats_new
>>> import mne # doctest: +SKIP
>>> from scipy.signal import lfilter
>>> raw = mne.io.read_raw_fif('raw.fif') # load data # doctest: +SKIP
>>> raw.info['bads'] = ['MEG 2443', 'EEG 053'] # mark bad channels # doctest: +SKIP
>>> raw.filter(l_freq=None, h_freq=40.0) # low-pass filter # doctest: +SKIP
>>> events = mne.find_events(raw, 'STI014') # extract events and epoch data # doctest: +SKIP
>>> epochs = mne.Epochs(raw, events, event_id=1, tmin=-0.2, tmax=0.5, # doctest: +SKIP
>>> reject=dict(grad=4000e-13, mag=4e-12, eog=150e-6)) # doctest: +SKIP
>>> evoked = epochs.average() # compute evoked # doctest: +SKIP
>>> evoked.plot() # butterfly plot the evoked data # doctest: +SKIP
>>> cov = mne.compute_covariance(epochs, tmax=0, method='shrunk') # doctest: +SKIP
>>> fwd = mne.read_forward_solution(fwd_fname, surf_ori=True) # doctest: +SKIP
>>> inv = mne.minimum_norm.make_inverse_operator( # doctest: +SKIP
>>> raw.info, fwd, cov, loose=0.2) # compute inverse operator # doctest: +SKIP
>>> stc = mne.minimum_norm.apply_inverse(
>>> evoked, inv, lambda2=1. / 9., method='dSPM') # apply it # doctest: +SKIP
>>> stc_fs = stc.morph('fsaverage') # morph to fsaverage # doctest: +SKIP
>>> stc_fs.plot() # plot source data on fsaverage's brain # doctest: +SKIP
.. toctree::
:maxdepth: 1
Direct financial support for MNE has been provided by the United States:
cite
references
cited
- NIH National Institute of Biomedical Imaging and Bioengineering
*5R01EB009048* and *P41EB015896* (Center for Functional Neuroimaging
Technologies)
- NSF awards *0958669* and *1042134*.
- NCRR *P41RR14075-06* (Center for Functional Neuroimaging Technologies)
- NIH *1R01EB009048-01*, *R01EB006385-A101*, *1R01HD40712-A1*,
*1R01NS44319-01*, *2R01NS37462-05*
- Department of Energy Award Number *DE-FG02-99ER62764* (The MIND
Institute)
- Amazon Web Services - *Research Grant* issued to Denis A. Engemann
.. raw:: html
And France:
<h2>Community</h2>
- IDEX Paris-Saclay, *ANR-11-IDEX-0003-02*, via the
`Center for Data Science <http://www.datascience-paris-saclay.fr/>`_.
- European Research Council Starting Grant *ERC-YStG-263584* and
*ERC-YStG-676943*
- French National Research Agency *ANR-14-NEUC-0002-01*.
* Analysis talk: join the `MNE mailing list`_
.. container:: col-md-8 midcenter
* `Feature requests and bug reports on GitHub <https://github.com/mne-tools/mne-python/issues/>`_
.. raw:: html
* `Chat with developers on Gitter <https://gitter.im/mne-tools/mne-python>`_
<script type="text/javascript" src="http://www.ohloh.net/p/586838/widgets/project_basic_stats.js"></script>
.. raw:: html
.. container:: col-md-4
<h2>Versions</h2>
.. container:: panel panel-default nosize nopad
<ul>
<li><a href=http://martinos.org/mne/stable>Stable</a></li>
<li><a href=http://martinos.org/mne/dev>Development</a></li>
</ul>
.. raw:: html
<div style="float: left; padding: 10px; width: 100%;">
<a class="twitter-timeline" href="https://twitter.com/mne_python" data-widget-id="317730454184804352">Tweets by @mne_python</a>
</div>
<div class="panel-heading"><h3 class="panel-title">Documentation</h3></div>
</div>
</div>
</div>
.. container:: panel-body nosize
- :ref:`get_started`
- :ref:`tutorials`
- :ref:`general_examples`
- :ref:`API Reference <api_reference>`
- :ref:`manual`
- :ref:`contributing`
- :ref:`FAQ`
- :ref:`whats_new`
- :ref:`cited`
.. container:: panel panel-default nosize nopad
.. raw:: html
<div class="panel-heading"><h3 class="panel-title">Community</h3></div>
.. container:: panel-body nosize nopad
- `MNE mailing list`_ for analysis talk
- `GitHub <https://github.com/mne-tools/mne-python/issues/>`_ for
requests and bug reports
- `Gitter <https://gitter.im/mne-tools/mne-python>`_ to chat with devs
.. container:: panel panel-default nosize nopad
.. raw:: html
<div class="panel-heading"><h3 class="panel-title">Versions</h3></div>
.. container:: panel-body nosize nopad
- `Stable <http://martinos.org/mne/stable>`_
- `Development <http://martinos.org/mne/dev>`_
.. container:: panel panel-default nosize nopad
.. raw:: html
<a class="twitter-timeline" href="https://twitter.com/mne_python" data-widget-id="317730454184804352">Tweets by @mne_python</a>
+1 -1
View File
@@ -701,7 +701,7 @@ MNE software and setup for individual users:
- The setup scripts have changed.
The installation and user-level effects of the new software
organization are discussed in :ref:`getting_started`.
organization are discussed in :ref:`install_mne_c`.
In addition, several minor bugs have been fixed in the source
code. Most relevant changes visible to the user are listed below.
+37 -50
View File
@@ -11,22 +11,20 @@ and class usage information.
.. contents:: Contents
:local:
:depth: 1
:depth: 2
.. raw:: html
<h2>Cookbook</h2>
A quick run-through of the basic steps involved in M/EEG source analysis.
Cookbook
--------
A quick run-through of the basic steps involved in M/EEG source analysis.
.. toctree::
:maxdepth: 2
cookbook
.. raw:: html
<h2>Reading your data</h2>
How to get your raw data loaded in MNE.
Reading your data
-----------------
How to get your raw data loaded in MNE.
.. toctree::
:maxdepth: 1
@@ -34,10 +32,9 @@ and class usage information.
io
memory
.. raw:: html
<h2>Preprocessing</h2>
Dealing with artifacts and noise sources in data.
Preprocessing
-------------
Dealing with artifacts and noise sources in data.
.. toctree::
:maxdepth: 1
@@ -47,10 +44,9 @@ and class usage information.
preprocessing/ssp
channel_interpolation
.. raw:: html
<h2>Source localization</h2>
Projecting raw data into source (brain) space.
Source localization
-------------------
Projecting raw data into source (brain) space.
.. toctree::
:maxdepth: 1
@@ -59,67 +55,61 @@ and class usage information.
source_localization/inverse
source_localization/morph
.. raw:: html
<h2>Time-frequency analysis</h2>
Decomposing time-domain signals into time-frequency representations.
Time-frequency analysis
-----------------------
Decomposing time-domain signals into time-frequency representations.
.. toctree::
:maxdepth: 2
time_frequency
.. raw:: html
<h2>Statistics</h2>
Using parametric and non-parametric tests with M/EEG data.
Statistics
----------
Using parametric and non-parametric tests with M/EEG data.
.. toctree::
:maxdepth: 2
statistics
.. raw:: html
<h2>Decoding</h2>
Decoding
--------
How to do decoding in MNE-Python.
.. toctree::
:maxdepth: 2
decoding
.. raw:: html
<h2>Datasets</h2>
How to use dataset fetchers for public data
Datasets
--------
How to use dataset fetchers for public data
.. toctree::
:maxdepth: 2
datasets_index
.. raw:: html
<h2>Migrating</h2>
Migrating
---------
Migrating from other software packages.
.. toctree::
:maxdepth: 1
migrating
.. raw:: html
<h2>Pitfalls</h2>
Pitfalls
--------
.. toctree::
:maxdepth: 2
pitfalls
.. raw:: html
<h2>C Tools</h2>
C Tools
-------
Additional information about various MNE-C tools.
.. toctree::
@@ -129,20 +119,17 @@ Additional information about various MNE-C tools.
gui/analyze
gui/browse
.. raw:: html
<h2>MATLAB Tools</h2>
Information about the MATLAB toolbox.
MNE-MATLAB
----------
Information about the MATLAB toolbox.
.. toctree::
:maxdepth: 2
matlab
.. raw:: html
<h2>Appendices</h2>
Appendices
----------
More details about our implementations and software.
.. toctree::
+1 -3
View File
@@ -21,6 +21,4 @@ For further information please visit the MNE-CPP project pages:
.. raw:: html
<div>
<script type="text/javascript" src="http://www.openhub.net/p/687714/widgets/project_basic_stats.js"></script>
</div>
<div><script type="text/javascript" src="http://www.openhub.net/p/687714/widgets/project_basic_stats.js"></script></div>
+143 -114
View File
@@ -19,174 +19,203 @@ For further reading:
- For details about analysis steps: :ref:`manual`
- For details about specific functions and classes: :ref:`api_reference`
.. note:: The default location for the MNE-sample data is
my-path-to/mne-python/examples. If you downloaded data and an
example asks you whether to download it again, make sure
the data reside in the examples directory
and that you run the script from its current directory.
.. code-block:: bash
$ cd examples/preprocessing
Then in Python you can do::
In [1]: %run plot_find_ecg_artifacts.py
.. contents:: Categories
:local:
:depth: 1
See :ref:`datasets` for a list of all available datasets and some
advanced configuration options, e.g. to specify a custom
location for storing the datasets.
.. container:: row
.. container:: span box
.. container:: panel panel-default halfpad
.. raw:: html
.. raw:: html
<h2>Introduction to MNE and Python</h2>
<div class="panel-heading"><h3 class="panel-title">Introduction to MNE and Python</h3></div>
.. toctree::
:maxdepth: 1
.. container:: panel-body nosize
auto_tutorials/plot_python_intro.rst
tutorials/seven_stories_about_mne.rst
auto_tutorials/plot_introduction.rst
.. toctree::
:maxdepth: 1
.. container:: span box
auto_tutorials/plot_python_intro.rst
tutorials/seven_stories_about_mne.rst
auto_tutorials/plot_introduction.rst
.. raw:: html
<h2>Background information</h2>
.. container:: row
.. toctree::
:maxdepth: 1
.. container:: panel panel-default halfpad
auto_tutorials/plot_background_filtering.rst
.. raw:: html
.. container:: span box
<div class="panel-heading"><h3 class="panel-title">Background Information</h3></div>
.. raw:: html
.. container:: panel-body nosize
<h2>Preprocessing</h2>
.. toctree::
:maxdepth: 1
.. toctree::
:maxdepth: 1
auto_tutorials/plot_background_filtering.rst
auto_tutorials/plot_artifacts_detection.rst
auto_tutorials/plot_artifacts_correction_filtering.rst
auto_tutorials/plot_artifacts_correction_rejection.rst
auto_tutorials/plot_artifacts_correction_ssp.rst
auto_tutorials/plot_artifacts_correction_ica.rst
auto_tutorials/plot_artifacts_correction_maxwell_filtering.rst
.. container:: span box
.. container:: panel panel-default halfpad
.. raw:: html
.. raw:: html
<h2>Sensor-level analysis</h2>
<div class="panel-heading"><h3 class="panel-title">Preprocessing</h3></div>
.. toctree::
:maxdepth: 1
.. container:: panel-body nosize
auto_tutorials/plot_epoching_and_averaging.rst
auto_tutorials/plot_eeg_erp.rst
auto_tutorials/plot_sensors_time_frequency.rst
auto_tutorials/plot_sensors_decoding.rst
.. toctree::
:maxdepth: 1
.. container:: span box
auto_tutorials/plot_artifacts_detection.rst
auto_tutorials/plot_artifacts_correction_filtering.rst
auto_tutorials/plot_artifacts_correction_rejection.rst
auto_tutorials/plot_artifacts_correction_ssp.rst
auto_tutorials/plot_artifacts_correction_ica.rst
auto_tutorials/plot_artifacts_correction_maxwell_filtering.rst
.. raw:: html
<h2>Visualization and Reporting</h2>
.. container:: row
.. toctree::
:maxdepth: 1
.. container:: panel panel-default halfpad
auto_tutorials/plot_visualize_raw.rst
auto_tutorials/plot_visualize_epochs.rst
auto_tutorials/plot_visualize_evoked.rst
tutorials/report.rst
.. raw:: html
.. container:: span box
<div class="panel-heading"><h3 class="panel-title">Data Structures and Containers</h3></div>
.. raw:: html
.. container:: panel-body nosize
<h2>Manipulating Data Structures and Containers</h2>
.. toctree::
:maxdepth: 1
.. toctree::
:maxdepth: 1
auto_tutorials/plot_object_raw.rst
auto_tutorials/plot_modifying_data_inplace.rst
auto_tutorials/plot_object_epochs.rst
auto_tutorials/plot_object_evoked.rst
auto_tutorials/plot_creating_data_structures.rst
auto_tutorials/plot_info.rst
auto_tutorials/plot_object_raw.rst
auto_tutorials/plot_modifying_data_inplace.rst
auto_tutorials/plot_object_epochs.rst
auto_tutorials/plot_object_evoked.rst
auto_tutorials/plot_creating_data_structures.rst
auto_tutorials/plot_info.rst
.. container:: span box
.. container:: panel panel-default halfpad
.. raw:: html
.. raw:: html
<h2>Source-level analysis</h2>
<div class="panel-heading"><h3 class="panel-title">Visualization and Reporting</h3></div>
.. toctree::
:maxdepth: 1
.. container:: panel-body nosize
auto_tutorials/plot_forward.rst
auto_tutorials/plot_compute_covariance.rst
auto_tutorials/plot_mne_dspm_source_localization.rst
auto_tutorials/plot_dipole_fit.rst
auto_tutorials/plot_brainstorm_auditory.rst
auto_tutorials/plot_brainstorm_phantom_ctf.rst
auto_tutorials/plot_brainstorm_phantom_elekta.rst
auto_tutorials/plot_point_spread.rst
.. toctree::
:maxdepth: 1
.. container:: span box
auto_tutorials/plot_visualize_raw.rst
auto_tutorials/plot_visualize_epochs.rst
auto_tutorials/plot_visualize_evoked.rst
tutorials/report.rst
.. raw:: html
<h2>Sensor-space Univariate Statistics</h2>
.. container:: row
.. toctree::
:maxdepth: 1
.. container:: panel panel-default halfpad
auto_tutorials/plot_stats_cluster_methods.rst
auto_tutorials/plot_stats_spatio_temporal_cluster_sensors.rst
auto_tutorials/plot_stats_cluster_1samp_test_time_frequency.rst
auto_tutorials/plot_stats_cluster_time_frequency.rst
.. raw:: html
.. container:: span box
<div class="panel-heading"><h3 class="panel-title">Sensor analysis</h3></div>
.. raw:: html
.. container:: panel-body nosize
<h2>Source-space Univariate Statistics</h2>
.. toctree::
:maxdepth: 1
.. toctree::
:maxdepth: 1
auto_tutorials/plot_epoching_and_averaging.rst
auto_tutorials/plot_eeg_erp.rst
auto_tutorials/plot_sensors_time_frequency.rst
auto_tutorials/plot_sensors_decoding.rst
auto_tutorials/plot_stats_cluster_time_frequency_repeated_measures_anova.rst
auto_tutorials/plot_stats_cluster_spatio_temporal_2samp.rst
auto_tutorials/plot_stats_cluster_spatio_temporal_repeated_measures_anova.rst
auto_tutorials/plot_stats_cluster_spatio_temporal.rst
.. container:: panel panel-default halfpad
.. container:: span box
.. raw:: html
.. raw:: html
<div class="panel-heading"><h3 class="panel-title">Source Analysis</h3></div>
<h2>Multivariate Statistics - Decoding</h2>
.. container:: panel-body nosize
.. toctree::
:maxdepth: 1
.. toctree::
:maxdepth: 1
auto_tutorials/plot_sensors_decoding.rst
auto_tutorials/plot_forward.rst
auto_tutorials/plot_compute_covariance.rst
auto_tutorials/plot_mne_dspm_source_localization.rst
auto_tutorials/plot_dipole_fit.rst
auto_tutorials/plot_brainstorm_auditory.rst
auto_tutorials/plot_brainstorm_phantom_ctf.rst
auto_tutorials/plot_brainstorm_phantom_elekta.rst
auto_tutorials/plot_point_spread.rst
.. container:: span box
.. container:: row
.. raw:: html
.. container:: panel panel-default halfpad
<h2>Command line tools</h2>
.. raw:: html
.. toctree::
:maxdepth: 1
<div class="panel-heading"><h3 class="panel-title">Sensor-space Statistics</h3></div>
tutorials/command_line.rst
generated/commands.rst
.. container:: panel-body nosize
.. toctree::
:maxdepth: 1
auto_tutorials/plot_stats_cluster_methods.rst
auto_tutorials/plot_stats_spatio_temporal_cluster_sensors.rst
auto_tutorials/plot_stats_cluster_1samp_test_time_frequency.rst
auto_tutorials/plot_stats_cluster_time_frequency.rst
.. container:: panel panel-default halfpad
.. raw:: html
<div class="panel-heading"><h3 class="panel-title">Source-space Statistics</h3></div>
.. container:: panel-body nosize
.. toctree::
:maxdepth: 1
auto_tutorials/plot_stats_cluster_time_frequency_repeated_measures_anova.rst
auto_tutorials/plot_stats_cluster_spatio_temporal_2samp.rst
auto_tutorials/plot_stats_cluster_spatio_temporal_repeated_measures_anova.rst
auto_tutorials/plot_stats_cluster_spatio_temporal.rst
.. container:: row
.. container:: panel panel-default halfpad
.. raw:: html
<div class="panel-heading"><h3 class="panel-title">Decoding</h3></div>
.. container:: panel-body nosize
.. toctree::
:maxdepth: 1
auto_tutorials/plot_sensors_decoding.rst
.. container:: row
.. container:: panel panel-default halfpad
.. raw:: html
<div class="panel-heading"><h3 class="panel-title">Command-line Tools</h3></div>
.. container:: panel-body nosize
.. toctree::
:maxdepth: 1
generated/commands.rst
tutorials/command_line.rst
+12 -10
View File
@@ -51,7 +51,12 @@ Z1 = bivariate_normal(X, Y, 8.0, 7.0, -5.0, 0.9, 1.0)
Z2 = bivariate_normal(X, Y, 15.0, 2.5, 2.6, -2.5, 2.5)
Z = Z2 - 0.7 * Z1
# color map: field gradient (yellow-red-transparent-blue-cyan)
# color map: field gradient (yellow-red-gray-blue-cyan)
# yrtbc = {
# 'red': ((0, 1, 1), (0.4, 1, 1), (0.5, 0.5, 0.5), (0.6, 0, 0), (1, 0, 0)),
# 'blue': ((0, 0, 0), (0.4, 0, 0), (0.5, 0.5, 0.5), (0.6, 1, 1), (1, 1, 1)), # noqa
# 'green': ((0, 1, 1), (0.4, 0, 0), (0.5, 0.5, 0.5), (0.6, 0, 0), (1, 1, 1)), # noqa
# }
yrtbc = {'red': ((0.0, 1.0, 1.0), (0.5, 1.0, 0.0), (1.0, 0.0, 0.0)),
'blue': ((0.0, 0.0, 0.0), (0.5, 0.0, 1.0), (1.0, 1.0, 1.0)),
'green': ((0.0, 1.0, 1.0), (0.5, 0.0, 0.0), (1.0, 1.0, 1.0)),
@@ -78,6 +83,7 @@ mult = (plot_dims / dims).min()
mult = [mult, -mult] # y axis is inverted (origin at top left)
offset = plot_dims / 2. - center_fudge
mne_clip = Path(offset + vert * mult, mne_path.codes)
ax.add_patch(PathPatch(mne_clip, color='w', zorder=0, linewidth=0))
# apply clipping mask to field gradient and lines
im.set_clip_path(mne_clip, transform=im.get_transform())
for coll in cs.collections:
@@ -103,11 +109,8 @@ yy = np.max([tag_clip.vertices.max(0)[-1],
ax.set_ylim(np.ceil(yy), yl[-1])
# only save actual image extent plus a bit of padding
extent = Bbox(np.c_[ax.get_xlim(), ax.get_ylim()])
extent = extent.transformed(ax.transData + fig.dpi_scale_trans.inverted())
plt.draw()
plt.savefig(op.join(static_dir, 'mne_logo.png'),
bbox_inches=extent.expanded(1.2, 1.))
plt.savefig(op.join(static_dir, 'mne_logo.png'), transparent=True)
plt.close()
# 92x22 image
@@ -125,7 +128,9 @@ ax = plt.Axes(fig, [0., 0., 1., 1.])
ax.set_axis_off()
fig.add_axes(ax)
# plot rainbow
im = plt.imshow(X, cmap=mne_field_grad_cols, aspect='equal')
im = ax.imshow(X, cmap=mne_field_grad_cols, aspect='equal', zorder=1)
im = ax.imshow(np.ones_like(X) * 0.5, cmap='Greys', aspect='equal', zorder=0,
clim=[0, 1])
plot_dims = np.r_[np.diff(ax.get_xbound()), np.diff(ax.get_ybound())]
# MNE text in white
mne_path = TextPath((0, 0), 'MNE')
@@ -148,9 +153,6 @@ xpad = np.abs(np.diff([xmin, xl[1]])) / 20.
ypad = np.abs(np.diff([ymax, ymin])) / 20.
ax.set_xlim(xmin - xpad, xl[1] + xpad)
ax.set_ylim(ymax + ypad, ymin - ypad)
extent = Bbox(np.c_[ax.get_xlim(), ax.get_ylim()])
extent = extent.transformed(ax.transData + fig.dpi_scale_trans.inverted())
plt.draw()
plt.savefig(op.join(static_dir, 'mne_logo_small.png'), transparent=True,
bbox_inches=extent)
plt.savefig(op.join(static_dir, 'mne_logo_small.png'), transparent=True)
plt.close()
+1 -1
View File
@@ -300,7 +300,7 @@ tlim = [center - 0.2, center + 0.2]
tticks = [tlim[0], center, tlim[1]]
flim = [20, 70]
x = np.zeros(int(sfreq * dur))
x = np.zeros(int(sfreq * dur) + 1)
blip = morlet(sfreq, [morlet_freq], n_cycles=7)[0].imag / 20.
n_onset = int(center * sfreq) - len(blip) // 2
x[n_onset:n_onset + len(blip)] += blip
+2 -3
View File
@@ -50,7 +50,6 @@ What you're not supposed to do with MNE Python
- **Brain and head surface segmentation** for use with BEM
models -- use Freesurfer.
- **Raw movement compensation** -- use Elekta Maxfilter™
.. note:: This package is based on the FIF file format from Neuromag. It
@@ -61,10 +60,10 @@ What you're not supposed to do with MNE Python
Installation of the required materials
---------------------------------------
See :ref:`getting_started` with Python.
See :ref:`install_python_and_mne_python`.
.. note:: The expected location for the MNE-sample data is
my-path-to/mne-python/examples. If you downloaded data and an example asks
``~/mne_data``. If you downloaded data and an example asks
you whether to download it again, make sure
the data reside in the examples directory and you run the script from its
current directory.
+17 -15
View File
@@ -6,24 +6,15 @@
Permutation t-test on toy data with spatial clustering
======================================================
Following the illustrative example of Ridgway et al. 2012,
Following the illustrative example of Ridgway et al. 2012 [1]_,
this demonstrates some basic ideas behind both the "hat"
variance adjustment method, as well as threshold-free
cluster enhancement (TFCE) methods in mne-python.
cluster enhancement (TFCE) [2]_ methods in mne-python.
This toy dataset consists of a 40 x 40 square with a "signal"
present in the center (at pixel [20, 20]) with white noise
added and a 5-pixel-SD normal smoothing kernel applied.
For more information, see:
Ridgway et al. 2012, "The problem of low variance voxels in
statistical parametric mapping; a new hat avoids a 'haircut'",
NeuroImage. 2012 Feb 1;59(3):2131-41.
Smith and Nichols 2009, "Threshold-free cluster enhancement:
addressing problems of smoothing, threshold dependence, and
localisation in cluster inference", NeuroImage 44 (2009) 83-98.
In the top row plot the T statistic over space, peaking toward the
center. Note that it has peaky edges. Second, with the "hat" variance
correction/regularization, the peak becomes correctly centered. Third,
@@ -49,8 +40,8 @@ methods tightens the area declared significant (again FWER corrected),
and allows for evaluation of each point independently instead of as
a single, broad cluster.
Note that this example does quite a bit of processing, so even on a
fast machine it can take a few minutes to complete.
.. note:: This example does quite a bit of processing, so even on a
fast machine it can take a few minutes to complete.
"""
# Authors: Eric Larson <larson.eric.d@gmail.com>
# License: BSD (3-clause)
@@ -145,7 +136,7 @@ T_obs_hat, clusters, p_values, H0 = \
spatio_temporal_cluster_1samp_test(X, n_jobs=1, threshold=threshold,
connectivity=connectivity,
tail=1, n_permutations=n_permutations,
stat_fun=stat_fun)
stat_fun=stat_fun, buffer_size=None)
# Let's put the cluster data in a readable format
ps_hat = np.zeros(width * width)
@@ -167,7 +158,7 @@ T_obs_tfce_hat, clusters, p_values, H0 = \
spatio_temporal_cluster_1samp_test(X, n_jobs=1, threshold=threshold_tfce,
connectivity=connectivity,
tail=1, n_permutations=n_permutations,
stat_fun=stat_fun)
stat_fun=stat_fun, buffer_size=None)
T_obs_tfce_hat = T_obs_tfce_hat.reshape((width, width))
ps_tfce_hat = -np.log10(p_values.reshape((width, width)))
@@ -210,3 +201,14 @@ for ax in axs:
cbar.set_ticklabels(['%0.1f' % p for p in p_lims])
plt.show()
###############################################################################
# References
# ----------
# .. [1] Ridgway et al. 2012, "The problem of low variance voxels in
# statistical parametric mapping; a new hat avoids a 'haircut'",
# NeuroImage. 2012 Feb 1;59(3):2131-41.
#
# .. [2] Smith and Nichols 2009, "Threshold-free cluster enhancement:
# addressing problems of smoothing, threshold dependence, and
# localisation in cluster inference", NeuroImage 44 (2009) 83-98.