diff --git a/environment.yml b/environment.yml index d721476..1478aa6 100644 --- a/environment.yml +++ b/environment.yml @@ -1,16 +1,14 @@ name: mne channels: - defaults -- clinicalgraphics # Needed for VTK dependencies: -- python=3.6.1 +- python>=3.6 - pip - mkl - numpy - scipy - matplotlib - pyqt=5 -- vtk>=7 - nose - coverage - pytest @@ -18,6 +16,7 @@ dependencies: - flake8 - pygments - pip: + - vtk - "git+https://github.com/enthought/traits.git@a7a83182048c08923953e302658b51b68c802132" - "git+https://github.com/enthought/pyface.git@13a064de48adda3c880350545717d8cf8929afad" - "git+https://github.com/enthought/traitsui.git@ee8ef0a34dfc1db18a8e2c0301cc18d96b7a3e2f" diff --git a/examples/plot_label.py b/examples/plot_label.py index 21067ca..8083347 100644 --- a/examples/plot_label.py +++ b/examples/plot_label.py @@ -26,7 +26,7 @@ brain.add_label("BA1_exvivo", color="blue", scalar_thresh=.5) # Or you can give a path to a label in an arbitrary location -subj_dir = os.environ["SUBJECTS_DIR"] +subj_dir = brain.subjects_dir label_file = os.path.join(subj_dir, subject_id, "label", "%s.MT_exvivo.label" % hemi) brain.add_label(label_file) diff --git a/surfer/tests/test_viz.py b/surfer/tests/test_viz.py index 1e78df6..0414168 100644 --- a/surfer/tests/test_viz.py +++ b/surfer/tests/test_viz.py @@ -81,10 +81,12 @@ def test_image(): brain.close() brain = Brain(*std_args, size=100) + if sys.platform == 'darwin' and os.getenv('TRAVIS', '') == 'true': + raise SkipTest('image saving on OSX travis is not supported') brain.save_image(tmp_name) brain.save_image(tmp_name, 'rgba', True) brain.screenshot() - if not os.getenv('TRAVIS', 'false') == 'true': + if os.getenv('TRAVIS', '') != 'true': # for some reason these fail on Travis sometimes brain.save_montage(tmp_name, ['l', 'v', 'm'], orientation='v') brain.save_montage(tmp_name, ['l', 'v', 'm'], orientation='h') @@ -340,6 +342,8 @@ def test_movie(): smoothing_steps=10, time=time, time_label='time=%0.2f ms') brain.scale_data_colormap(fmin=13, fmid=18, fmax=22, transparent=True) + if sys.platform == 'darwin' and os.getenv('TRAVIS', '') == 'true': + raise SkipTest('movie saving on OSX Travis is not supported') # save movies with different options tempdir = mkdtemp() try: diff --git a/surfer/viz.py b/surfer/viz.py index 4d0da8f..3684343 100644 --- a/surfer/viz.py +++ b/surfer/viz.py @@ -3257,7 +3257,10 @@ def add_label(self, label, label_name, color, alpha): color = colorConverter.to_rgba(color, alpha) cmap = np.array([(0, 0, 0, 0,), color]) l_m = surf.module_manager.scalar_lut_manager - l_m.load_lut_from_list(cmap) + # for some reason (traits?) using `load_lut_from_list` here does + # not work (.data_range needs to be tweaked in this case), + # but setting the table directly does: + l_m.lut.table = np.round(cmap * 255).astype(np.uint8) return array_id, surf def add_morphometry(self, morph_data, colormap, measure,