Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fc60d21832 | |||
| 8b10afa373 | |||
| 1e21e42e1f | |||
| 2b13153cbc | |||
| 872e915459 | |||
| 65225e3e4d | |||
| e2926f5337 | |||
| 3351bc0844 | |||
| 0eebb43d97 | |||
| 357cbf5c31 | |||
| 6b46d55024 | |||
| 75aada2c19 | |||
| 2627502753 | |||
| 0d56633b5f | |||
| fc64a1ff88 | |||
| 2de0275243 | |||
| 82dced0d80 | |||
| 8fec724f7c | |||
| 0b7ed7c07a | |||
| dfb4baf29e | |||
| bfa66416f1 | |||
| 7b2002a5f5 | |||
| e4296cd812 | |||
| 498812a68d | |||
| 880a2c5a32 | |||
| 2baea40cde | |||
| 4bf3c5959f | |||
| f2b0ad1ea0 |
+1
-1
@@ -1,4 +1,4 @@
|
||||
Copyright © 2011, authors of MNE-Python
|
||||
Copyright © 2011-2014, authors of MNE-Python
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -9,7 +9,12 @@ recursive-include mne/data *.sel
|
||||
recursive-include mne/data *.fif.gz
|
||||
recursive-include mne/layouts *.lout
|
||||
recursive-include mne/layouts *.lay
|
||||
recursive-include mne/html *.js
|
||||
recursive-include mne/html *.css
|
||||
recursive-exclude examples/MNE-sample-data *
|
||||
recursive-exclude examples/MNE-testing-data *
|
||||
recursive-exclude examples/MNE-spm-face *
|
||||
recursive-exclude examples/MNE-somato-data *
|
||||
# recursive-include mne/fiff/tests/data *
|
||||
recursive-exclude mne/fiff/tests/data *
|
||||
recursive-exclude mne/fiff/bti/tests/data *
|
||||
|
||||
@@ -1,15 +1,3 @@
|
||||
==========================
|
||||
Google Summer of Code 2014
|
||||
==========================
|
||||
|
||||
For the Google Summer of Code 2014 (GSOC) we are looking for two ambitious
|
||||
students with strong Python skills and a background and / or interest in brain
|
||||
imaging research. If you feel addressed or happen to know someone who might be
|
||||
interested please get in touch with us or forward this message to her / him.
|
||||
Here are our our `GSOC projects <http://goo.gl/4KkmRC>`_.
|
||||
`Registration <http://goo.gl/KMPQRf>`_ opens on March 10, 2014, 7 p.m. UTC.
|
||||
|
||||
|
||||
========
|
||||
MNE Home
|
||||
========
|
||||
|
||||
@@ -122,6 +122,8 @@ Functions:
|
||||
File I/O
|
||||
========
|
||||
|
||||
.. currentmodule:: mne
|
||||
|
||||
Functions:
|
||||
|
||||
.. autosummary::
|
||||
@@ -132,7 +134,7 @@ Functions:
|
||||
get_head_surf
|
||||
get_meg_helmet_surf
|
||||
parse_config
|
||||
read_annot
|
||||
read_labels_from_annot
|
||||
read_bem_solution
|
||||
read_bem_surfaces
|
||||
read_cov
|
||||
@@ -151,7 +153,7 @@ Functions:
|
||||
read_surface
|
||||
read_trans
|
||||
save_stc_as_volume
|
||||
write_annot
|
||||
write_labels_to_annot
|
||||
write_bem_surface
|
||||
write_cov
|
||||
write_events
|
||||
@@ -723,7 +725,19 @@ Decoding
|
||||
|
||||
.. automodule:: mne.decoding
|
||||
:no-members:
|
||||
:no-inherited-members:
|
||||
|
||||
Classes:
|
||||
|
||||
.. autosummary::
|
||||
:toctree: generated/
|
||||
:template: class.rst
|
||||
|
||||
Scaler
|
||||
ConcatenateChannels
|
||||
PSDEstimator
|
||||
FilterEstimator
|
||||
CSP
|
||||
|
||||
Realtime
|
||||
========
|
||||
@@ -732,6 +746,20 @@ Realtime
|
||||
|
||||
.. automodule:: mne.realtime
|
||||
:no-members:
|
||||
:no-inherited-members:
|
||||
|
||||
Classes:
|
||||
|
||||
.. autosummary::
|
||||
:toctree: generated/
|
||||
:template: class.rst
|
||||
|
||||
RtEpochs
|
||||
RtClient
|
||||
MockRtClient
|
||||
FieldTripClient
|
||||
StimServer
|
||||
StimClient
|
||||
|
||||
MNE-Report
|
||||
==========
|
||||
|
||||
+33
-36
@@ -143,15 +143,13 @@ API
|
||||
|
||||
- Deprecate Epochs.drop_picks in favor of a new method called drop_channels
|
||||
|
||||
- Deprecate `labels_from_parc` and `parc_from_labels` in favor of `read_annot` and `write_annot`
|
||||
- Deprecate `labels_from_parc` and `parc_from_labels` in favor of `read_labels_from_annot` and `write_labels_to_annot`
|
||||
|
||||
- The default of the new add_dist option of `setup_source_space` to add patch information will change from False to True in MNE-Python 0.9
|
||||
|
||||
- Deprecate `read_evoked` and `write_evoked` in favor of `read_evokeds` and `write_evokeds`.
|
||||
read_evokeds will return all Evoked instances in a file by default.
|
||||
- Deprecate `read_evoked` and `write_evoked` in favor of `read_evokeds` and `write_evokeds`. read_evokeds will return all Evoked instances in a file by default.
|
||||
|
||||
- Deprecate `setno` in favor of `condition` in the initialization of an Evoked instance. This
|
||||
affects 'mne.fiff.Evoked' and 'read_evokeds', but not 'read_evoked'.
|
||||
- Deprecate `setno` in favor of `condition` in the initialization of an Evoked instance. This affects 'mne.fiff.Evoked' and 'read_evokeds', but not 'read_evoked'.
|
||||
|
||||
- Deprecate `mne.fiff` module, use `mne.io` instead e.g. `mne.io.Raw` instead of `mne.fiff.Raw`.
|
||||
|
||||
@@ -166,38 +164,37 @@ affects 'mne.fiff.Evoked' and 'read_evokeds', but not 'read_evoked'.
|
||||
Authors
|
||||
~~~~~~~~~
|
||||
|
||||
The committer list for this release is the following (preceded by number
|
||||
of commits):
|
||||
The committer list for this release is the following (preceded by number of commits):
|
||||
|
||||
418 Denis A. Engemann
|
||||
284 Alexandre Gramfort
|
||||
242 Eric Larson
|
||||
155 Christian Brodbeck
|
||||
144 Mainak Jas
|
||||
49 Martin Billinger
|
||||
49 Andrew Dykstra
|
||||
44 Tal Linzen
|
||||
37 Dan G. Wakeman
|
||||
36 Martin Luessi
|
||||
26 Teon Brooks
|
||||
20 Cathy Nangini
|
||||
15 Hari Bharadwaj
|
||||
15 Roman Goj
|
||||
10 Ross Maddox
|
||||
9 Marmaduke Woodman
|
||||
8 Praveen Sripad
|
||||
8 Tanay
|
||||
8 Roan LaPlante
|
||||
5 Saket Choudhary
|
||||
4 Nick Ward
|
||||
4 Mads Jensen
|
||||
3 Olaf Hauk
|
||||
3 Brad Buran
|
||||
2 Daniel Strohmeier
|
||||
2 Federico Raimondo
|
||||
2 Alan Leggitt
|
||||
1 Jean-Remi King
|
||||
1 Matti Hamalainen
|
||||
* 418 Denis A. Engemann
|
||||
* 284 Alexandre Gramfort
|
||||
* 242 Eric Larson
|
||||
* 155 Christian Brodbeck
|
||||
* 144 Mainak Jas
|
||||
* 49 Martin Billinger
|
||||
* 49 Andrew Dykstra
|
||||
* 44 Tal Linzen
|
||||
* 37 Dan G. Wakeman
|
||||
* 36 Martin Luessi
|
||||
* 26 Teon Brooks
|
||||
* 20 Cathy Nangini
|
||||
* 15 Hari Bharadwaj
|
||||
* 15 Roman Goj
|
||||
* 10 Ross Maddox
|
||||
* 9 Marmaduke Woodman
|
||||
* 8 Praveen Sripad
|
||||
* 8 Tanay
|
||||
* 8 Roan LaPlante
|
||||
* 5 Saket Choudhary
|
||||
* 4 Nick Ward
|
||||
* 4 Mads Jensen
|
||||
* 3 Olaf Hauk
|
||||
* 3 Brad Buran
|
||||
* 2 Daniel Strohmeier
|
||||
* 2 Federico Raimondo
|
||||
* 2 Alan Leggitt
|
||||
* 1 Jean-Remi King
|
||||
* 1 Matti Hamalainen
|
||||
|
||||
|
||||
.. _changes_0_7:
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
"""MNE for MEG and EEG data analysis
|
||||
"""
|
||||
|
||||
__version__ = '0.8'
|
||||
__version__ = '0.8.6'
|
||||
|
||||
# have to import verbose first since it's needed by many things
|
||||
from .utils import (set_log_level, set_log_file, verbose, set_config,
|
||||
|
||||
+7
-2
@@ -92,10 +92,11 @@ def equalize_channels(candidates, verbose=None):
|
||||
from .io.base import _BaseRaw
|
||||
from .epochs import Epochs
|
||||
from .evoked import Evoked
|
||||
from .time_frequency import AverageTFR
|
||||
|
||||
if not all([isinstance(c, (_BaseRaw, Epochs, Evoked))
|
||||
if not all([isinstance(c, (_BaseRaw, Epochs, Evoked, AverageTFR))
|
||||
for c in candidates]):
|
||||
valid = ['Raw', 'Epochs', 'Evoked']
|
||||
valid = ['Raw', 'Epochs', 'Evoked', 'AverageTFR']
|
||||
raise ValueError('candidates must be ' + ' or '.join(valid))
|
||||
|
||||
chan_max_idx = np.argmax([c.info['nchan'] for c in candidates])
|
||||
@@ -175,6 +176,8 @@ class PickDropChannelsMixin(object):
|
||||
from .io.base import _BaseRaw
|
||||
from .epochs import Epochs
|
||||
from .evoked import Evoked
|
||||
from .time_frequency import AverageTFR
|
||||
|
||||
if isinstance(self, _BaseRaw):
|
||||
if not self.preload:
|
||||
raise RuntimeError('Raw data must be preloaded to drop or pick'
|
||||
@@ -197,6 +200,8 @@ class PickDropChannelsMixin(object):
|
||||
self._data = self._data[idx, :]
|
||||
elif isinstance(self, Epochs) and inst_has('_data'):
|
||||
self._data = self._data[:, idx, :]
|
||||
elif isinstance(self, AverageTFR) and inst_has('data'):
|
||||
self.data = self.data[idx, :, :]
|
||||
elif isinstance(self, Evoked):
|
||||
self.data = self.data[idx, :]
|
||||
|
||||
|
||||
+2
-1
@@ -1150,6 +1150,7 @@ def scale_source_space(subject_to, src_name, subject_from=None, scale=None,
|
||||
|
||||
if add_dist:
|
||||
logger.info("Recomputing distances, this might take a while")
|
||||
add_source_space_distances(sss, sss[0]['dist_limit'], n_jobs)
|
||||
dist_limit = np.asscalar(sss[0]['dist_limit'])
|
||||
add_source_space_distances(sss, dist_limit, n_jobs)
|
||||
|
||||
write_source_spaces(dst, sss)
|
||||
|
||||
+20
-18
@@ -118,18 +118,19 @@ def set_fs_home():
|
||||
return True
|
||||
|
||||
def _fs_home_problem(fs_home):
|
||||
"Check FREESURFER_HOME path"
|
||||
test_dir = os.path.join(fs_home, 'subjects', 'fsaverage')
|
||||
"""Check FREESURFER_HOME path
|
||||
|
||||
Return str describing problem or None if the path is okay.
|
||||
"""
|
||||
if fs_home is None:
|
||||
problem = "FREESURFER_HOME is not set."
|
||||
return "FREESURFER_HOME is not set."
|
||||
elif not os.path.exists(fs_home):
|
||||
problem = "FREESURFER_HOME (%s) does not exist." % fs_home
|
||||
elif not os.path.exists(test_dir):
|
||||
problem = ("FREESURFER_HOME (%s) does not contain the fsaverage "
|
||||
"subject." % fs_home)
|
||||
return "FREESURFER_HOME (%s) does not exist." % fs_home
|
||||
else:
|
||||
problem = None
|
||||
return problem
|
||||
test_dir = os.path.join(fs_home, 'subjects', 'fsaverage')
|
||||
if not os.path.exists(test_dir):
|
||||
return ("FREESURFER_HOME (%s) does not contain the fsaverage "
|
||||
"subject." % fs_home)
|
||||
|
||||
|
||||
def get_mne_root():
|
||||
@@ -197,18 +198,19 @@ def set_mne_root(set_mne_bin=False):
|
||||
return True
|
||||
|
||||
def _mne_root_problem(mne_root):
|
||||
"Check MNE_ROOT path"
|
||||
test_dir = os.path.join(mne_root, 'share', 'mne', 'mne_analyze')
|
||||
"""Check MNE_ROOT path
|
||||
|
||||
Return str describing problem or None if the path is okay.
|
||||
"""
|
||||
if mne_root is None:
|
||||
problem = "MNE_ROOT is not set."
|
||||
return "MNE_ROOT is not set."
|
||||
elif not os.path.exists(mne_root):
|
||||
problem = "MNE_ROOT (%s) does not exist." % mne_root
|
||||
elif not os.path.exists(test_dir):
|
||||
problem = ("MNE_ROOT (%s) is missing files. If this is your MNE "
|
||||
"installation, consider reinstalling." % mne_root)
|
||||
return "MNE_ROOT (%s) does not exist." % mne_root
|
||||
else:
|
||||
problem = None
|
||||
return problem
|
||||
test_dir = os.path.join(mne_root, 'share', 'mne', 'mne_analyze')
|
||||
if not os.path.exists(test_dir):
|
||||
return ("MNE_ROOT (%s) is missing files. If this is your MNE "
|
||||
"installation, consider reinstalling." % mne_root)
|
||||
|
||||
|
||||
class BemSource(HasTraits):
|
||||
|
||||
+4
-4
@@ -1445,8 +1445,6 @@ def _write_raw(fname, raw, info, picks, format, data_type, reset_range, start,
|
||||
logger.info('Writing %s' % use_fname)
|
||||
|
||||
meas_id = info['meas_id']
|
||||
if meas_id is None:
|
||||
meas_id = 0
|
||||
|
||||
fid, cals = _start_writing_raw(use_fname, info, picks, data_type,
|
||||
reset_range)
|
||||
@@ -1460,7 +1458,8 @@ def _write_raw(fname, raw, info, picks, format, data_type, reset_range, start,
|
||||
start_block(fid, FIFF.FIFFB_REF)
|
||||
write_int(fid, FIFF.FIFF_REF_ROLE, FIFF.FIFFV_ROLE_PREV_FILE)
|
||||
write_string(fid, FIFF.FIFF_REF_FILE_NAME, prev_fname)
|
||||
write_id(fid, FIFF.FIFF_REF_FILE_ID, meas_id)
|
||||
if meas_id is not None:
|
||||
write_id(fid, FIFF.FIFF_REF_FILE_ID, meas_id)
|
||||
write_int(fid, FIFF.FIFF_REF_FILE_NUM, part_idx - 1)
|
||||
end_block(fid, FIFF.FIFFB_REF)
|
||||
|
||||
@@ -1509,7 +1508,8 @@ def _write_raw(fname, raw, info, picks, format, data_type, reset_range, start,
|
||||
start_block(fid, FIFF.FIFFB_REF)
|
||||
write_int(fid, FIFF.FIFF_REF_ROLE, FIFF.FIFFV_ROLE_NEXT_FILE)
|
||||
write_string(fid, FIFF.FIFF_REF_FILE_NAME, op.basename(next_fname))
|
||||
write_id(fid, FIFF.FIFF_REF_FILE_ID, meas_id)
|
||||
if meas_id is not None:
|
||||
write_id(fid, FIFF.FIFF_REF_FILE_ID, meas_id)
|
||||
write_int(fid, FIFF.FIFF_REF_FILE_NUM, next_idx)
|
||||
end_block(fid, FIFF.FIFFB_REF)
|
||||
break
|
||||
|
||||
+2
-2
@@ -590,8 +590,8 @@ def _get_edf_info(fname, n_eeg, stim_channel, annot, annotmap, tal_channel,
|
||||
chan_info['cal'] = cal
|
||||
chan_info['logno'] = idx
|
||||
chan_info['scanno'] = idx
|
||||
chan_info['range'] = physical_range
|
||||
chan_info['unit_mul'] = unit_mul
|
||||
chan_info['range'] = physical_range * (10 ** unit_mul)
|
||||
chan_info['unit_mul'] = 0.
|
||||
chan_info['ch_name'] = ch_name
|
||||
chan_info['unit'] = FIFF.FIFF_UNIT_V
|
||||
chan_info['coord_frame'] = FIFF.FIFFV_COORD_HEAD
|
||||
|
||||
+8
-6
@@ -10,12 +10,14 @@ import os
|
||||
import os.path as op
|
||||
import fnmatch
|
||||
import re
|
||||
import numpy as np
|
||||
import codecs
|
||||
import time
|
||||
from glob import glob
|
||||
import warnings
|
||||
import base64
|
||||
|
||||
import numpy as np
|
||||
|
||||
from . import read_evokeds, read_events, Covariance
|
||||
from .io import Raw, read_info
|
||||
from .utils import _TempDir, logger, verbose, get_subjects_dir
|
||||
@@ -108,7 +110,7 @@ def _fig_to_mrislice(function, orig_size, sl, **kwargs):
|
||||
format='png')
|
||||
output = BytesIO()
|
||||
Image.open(temp_sl_fname).save(output, format='png')
|
||||
return output.getvalue().encode('base64')
|
||||
return base64.b64encode(output.getvalue()).decode('ascii')
|
||||
|
||||
|
||||
@_check_report_mode
|
||||
@@ -291,7 +293,7 @@ def _build_image(data, cmap='gray'):
|
||||
fig.figimage(data, cmap=cmap)
|
||||
output = BytesIO()
|
||||
fig.savefig(output, dpi=1.0, format='png')
|
||||
return output.getvalue().encode('base64')
|
||||
return base64.b64encode(output.getvalue()).decode('ascii')
|
||||
|
||||
|
||||
def _iterate_sagittal_slices(array, limits=None):
|
||||
@@ -404,7 +406,7 @@ slider_template = HTMLTemplate(u"""
|
||||
def _build_html_slider(slices_range, slides_klass, slider_id):
|
||||
"""Build an html slider for a given slices range and a slices klass.
|
||||
"""
|
||||
startvalue = (slices_range[0] + slices_range[-1]) / 2 + 1
|
||||
startvalue = (slices_range[0] + slices_range[-1]) // 2 + 1
|
||||
return slider_template.substitute(slider_id=slider_id,
|
||||
klass=slides_klass,
|
||||
minvalue=slices_range[0],
|
||||
@@ -831,8 +833,8 @@ class Report(object):
|
||||
|
||||
if overwrite or not op.isfile(fname):
|
||||
logger.info('Saving report to location %s' % fname)
|
||||
fobj = open(fname, 'w')
|
||||
fobj.write(_fix_global_ids(''.join(self.html)))
|
||||
fobj = codecs.open(fname, 'w', 'utf-8')
|
||||
fobj.write(_fix_global_ids(u''.join(self.html)))
|
||||
fobj.close()
|
||||
|
||||
# remove header, TOC and footer to allow more saves
|
||||
|
||||
@@ -263,7 +263,7 @@ def test_fetch_file():
|
||||
# Skipping test if no internet connection available
|
||||
try:
|
||||
urllib.request.urlopen("http://github.com", timeout=2)
|
||||
except urllib.request.URLError:
|
||||
except:
|
||||
from nose.plugins.skip import SkipTest
|
||||
raise SkipTest('No internet connection, skipping download test.')
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"""
|
||||
|
||||
from .tfr import induced_power, single_trial_power, morlet, tfr_morlet
|
||||
from .tfr import AverageTFR
|
||||
from .psd import compute_raw_psd, compute_epochs_psd
|
||||
from .csd import CrossSpectralDensity, compute_epochs_csd
|
||||
from .ar import yule_walker, ar_raw, iir_filter_raw
|
||||
|
||||
@@ -3,6 +3,7 @@ import os.path as op
|
||||
from numpy.testing import assert_array_almost_equal
|
||||
from nose.tools import assert_true, assert_false, assert_equal
|
||||
|
||||
import mne
|
||||
from mne import io, Epochs, read_events, pick_types
|
||||
from mne.time_frequency import single_trial_power
|
||||
from mne.time_frequency.tfr import cwt_morlet, morlet, tfr_morlet
|
||||
@@ -51,6 +52,10 @@ def test_time_frequency():
|
||||
freqs = np.arange(6, 20, 5) # define frequencies of interest
|
||||
n_cycles = freqs / 4.
|
||||
|
||||
# Test first with a single epoch
|
||||
power, itc = tfr_morlet(epochs[0], freqs=freqs, n_cycles=n_cycles,
|
||||
use_fft=True, return_itc=True)
|
||||
|
||||
power, itc = tfr_morlet(epochs, freqs=freqs, n_cycles=n_cycles,
|
||||
use_fft=True, return_itc=True)
|
||||
|
||||
@@ -91,3 +96,14 @@ def test_time_frequency():
|
||||
n_cycles=2)
|
||||
|
||||
assert_array_almost_equal(np.mean(single_power), power.data)
|
||||
|
||||
power_pick = power.pick_channels(power.ch_names[:10:2])
|
||||
assert_equal(len(power_pick.ch_names), len(power.ch_names[:10:2]))
|
||||
assert_equal(power_pick.data.shape[0], len(power.ch_names[:10:2]))
|
||||
power_drop = power.drop_channels(power.ch_names[1:10:2])
|
||||
assert_equal(power_drop.ch_names, power_pick.ch_names)
|
||||
assert_equal(power_pick.data.shape[0], len(power_drop.ch_names))
|
||||
|
||||
mne.equalize_channels([power_pick, power_drop])
|
||||
assert_equal(power_pick.ch_names, power_drop.ch_names)
|
||||
assert_equal(power_pick.data.shape, power_drop.data.shape)
|
||||
|
||||
@@ -386,7 +386,7 @@ def _induced_power(data, Fs, frequencies, use_fft=True, n_cycles=7,
|
||||
plf = np.empty((n_channels, n_frequencies, n_times), dtype=np.complex)
|
||||
|
||||
for c in range(n_channels):
|
||||
X = np.squeeze(data[:, c, :])
|
||||
X = data[:, c, :]
|
||||
this_psd, this_plf = _time_frequency(X, Ws, use_fft)
|
||||
psd[c], plf[c] = this_psd[:, ::decim], this_plf[:, ::decim]
|
||||
else:
|
||||
@@ -476,6 +476,9 @@ def _preproc_tfr(data, times, freqs, tmin, tmax, fmin, fmax, mode,
|
||||
|
||||
freqs = freqs[ifmin:ifmax]
|
||||
|
||||
# crop data
|
||||
data = data[:, ifmin:ifmax, itmin:itmax]
|
||||
|
||||
times *= 1e3
|
||||
if dB:
|
||||
data = 20 * np.log10(data)
|
||||
|
||||
+1
-1
@@ -365,7 +365,7 @@ def plot_raw(raw, events=None, duration=10.0, start=0.0, n_channels=None,
|
||||
for t in ['grad', 'mag']:
|
||||
inds += [pick_types(info, meg=t, ref_meg=False, exclude=[])]
|
||||
types += [t] * len(inds[-1])
|
||||
pick_kwargs = dict(meg=False, exclude=[])
|
||||
pick_kwargs = dict(meg=False, ref_meg=False, exclude=[])
|
||||
for t in ['eeg', 'eog', 'ecg', 'emg', 'ref_meg', 'stim', 'resp',
|
||||
'misc', 'chpi', 'syst', 'ias', 'exci']:
|
||||
pick_kwargs[t] = True
|
||||
|
||||
Reference in New Issue
Block a user