def test_view_img_on_surf(): img = _get_img() surfaces = datasets.fetch_surf_fsaverage() html = html_surface.view_img_on_surf(img, threshold='92.3%') check_html(html) html = html_surface.view_img_on_surf(img, threshold=0, surf_mesh=surfaces) check_html(html) html = html_surface.view_img_on_surf(img, threshold=.4, title="SOME_TITLE") assert "SOME_TITLE" in html.html check_html(html) html = html_surface.view_img_on_surf( img, threshold=.4, cmap='hot', black_bg=True) check_html(html) with pytest.raises(DimensionError): html_surface.view_img_on_surf([img, img]) img_4d = image.new_img_like(img, get_data(img)[:, :, :, np.newaxis]) assert len(img_4d.shape) == 4 html = html_surface.view_img_on_surf(img, threshold='92.3%') check_html(html) np.clip(get_data(img), 0, None, out=get_data(img)) html = html_surface.view_img_on_surf(img, symmetric_cmap=False) check_html(html) html = html_surface.view_img_on_surf(img, symmetric_cmap=False, vol_to_surf_kwargs={ "n_samples": 1, "radius": 0., "interpolation": "nearest"}) check_html(html)
def test_view_img_on_surf(): img = _get_img() fsaverage = dict(fetch_surf_fsaverage()) html = html_surface.view_img_on_surf(img, threshold='92.3%') check_html(html) html = html_surface.view_img_on_surf(img, threshold=0, surf_mesh=fsaverage) check_html(html) html = html_surface.view_img_on_surf(img, threshold=.4, title="SOME_TITLE") assert "SOME_TITLE" in html.html check_html(html) html = html_surface.view_img_on_surf(img, threshold=.4, cmap='hot', black_bg=True) check_html(html) html = html_surface.view_img_on_surf(img, surf_mesh='fsaverage') check_html(html) with pytest.raises(DimensionError): html_surface.view_img_on_surf([img, img]) img_4d = image.new_img_like(img, get_data(img)[:, :, :, np.newaxis]) assert len(img_4d.shape) == 4 html = html_surface.view_img_on_surf(img, threshold='92.3%') check_html(html) np.clip(get_data(img), 0, None, out=get_data(img)) html = html_surface.view_img_on_surf(img, symmetric_cmap=False) check_html(html)
def test_view_img_on_surf(): img = _get_img() fsaverage = dict(fetch_surf_fsaverage()) html = html_surface.view_img_on_surf(img, threshold='92.3%') check_html(html) html = html_surface.view_img_on_surf(img, threshold=0, surf_mesh=fsaverage) check_html(html) html = html_surface.view_img_on_surf(img, threshold=.4) check_html(html) html = html_surface.view_img_on_surf( img, threshold=.4, cmap='hot', black_bg=True) check_html(html) html = html_surface.view_img_on_surf(img, surf_mesh='fsaverage') check_html(html) assert_raises(DimensionError, html_surface.view_img_on_surf, [img, img])
def test_view_img_on_surf(): img = _get_img() fsaverage = dict(fetch_surf_fsaverage()) html = html_surface.view_img_on_surf(img, threshold='92.3%') check_html(html) html = html_surface.view_img_on_surf(img, threshold=0, surf_mesh=fsaverage) check_html(html) html = html_surface.view_img_on_surf(img, threshold=.4) check_html(html) html = html_surface.view_img_on_surf( img, threshold=.4, cmap='hot', black_bg=True) check_html(html) html = html_surface.view_img_on_surf(img, surf_mesh='fsaverage') check_html(html) assert_raises(DimensionError, html_surface.view_img_on_surf, [img, img]) img_4d = image.new_img_like(img, img.get_data()[:, :, :, np.newaxis]) assert len(img_4d.shape) == 4 html = html_surface.view_img_on_surf(img, threshold='92.3%') check_html(html) np.clip(img.get_data(), 0, None, out=img.get_data()) html = html_surface.view_img_on_surf(img, symmetric_cmap=False) check_html(html)
def test_view_img_on_surf(): img = _get_img() fsaverage = dict(fetch_surf_fsaverage()) html = html_surface.view_img_on_surf(img, threshold='92.3%') check_html(html) html = html_surface.view_img_on_surf(img, threshold=0, surf_mesh=fsaverage) check_html(html) html = html_surface.view_img_on_surf(img, threshold=.4) check_html(html) html = html_surface.view_img_on_surf( img, threshold=.4, cmap='hot', black_bg=True) check_html(html) html = html_surface.view_img_on_surf(img, surf_mesh='fsaverage') check_html(html) assert_raises(DimensionError, html_surface.view_img_on_surf, [img, img]) img_4d = image.new_img_like(img, img.get_data()[:, :, :, np.newaxis]) assert len(img_4d.shape) == 4 html = html_surface.view_img_on_surf(img, threshold='92.3%') check_html(html)