def test_json_view_to_html(black_bg, cbar): data, json_view = _get_data_and_json_view(black_bg, cbar) json_view['params'] = html_stat_map._json_view_params( data.shape, np.eye(4), vmin=0, vmax=1, cut_slices=[1, 1, 1], black_bg=True, opacity=1, draw_cross=True, annotate=False, title="test", colorbar=True) # Create a viewer html_view = html_stat_map._json_view_to_html(json_view) _check_html(html_view)
def test_json_view_params(): # Try to generate some sprite parameters params = html_stat_map._json_view_params( shape=[4, 4, 4], affine=np.eye(4), vmin=0, vmax=1, cut_slices=[1, 1, 1], black_bg=True, opacity=0.5, draw_cross=False, annotate=True, title="A test", colorbar=True, value=True) # Just check that a structure was generated, # and test a single parameter assert params['overlay']['opacity'] == 0.5
def test_json_view_to_html(): # Re use the data simulated in another test json_view, data = test_json_view_data() json_view['params'] = html_stat_map._json_view_params( data.shape, np.eye(4), vmin=0, vmax=1, cut_slices=[1, 1, 1], black_bg=True, opacity=1, draw_cross=True, annotate=False, title="test", colorbar=True) # Create a viewer html_view = html_stat_map._json_view_to_html(json_view) _check_html(html_view)
def test_json_view_to_html(): # Re use the data simulated in another test json_view, data = test_json_view_data() json_view['params'] = html_stat_map._json_view_params(data.shape, np.eye(4), vmin=0, vmax=1, cut_slices=[1, 1, 1], black_bg=True, opacity=1, draw_cross=True, annotate=False, title="test", colorbar=True) # Create a viewer html_view = html_stat_map._json_view_to_html(json_view) _check_html(html_view)