def test_update_lin_no_auto(disp_min, disp_max): im = sv.ImageView() sv_cm = sv.ColorMapper([im], disp_min=disp_min, disp_max=disp_max) sv_cm.update(test_image) assert sv_cm.display_min_spinner.value == disp_min assert sv_cm.display_max_spinner.value == disp_max
def test_update_log_no_auto(disp_min, disp_max): im = sv.ImageView() sv_cm = sv.ColorMapper([im], disp_min=disp_min, disp_max=disp_max) sv_cm.scale_radiobuttongroup.active = 1 sv_cm.update(test_image) assert sv_cm.display_min_spinner.value == disp_min assert sv_cm.display_max_spinner.value == disp_max
def test_update_lin_auto(disp_min, disp_max): im = sv.ImageView() sv_cm = sv.ColorMapper([im], disp_min=disp_min, disp_max=disp_max) sv_cm.auto_toggle.active = [0] # True sv_cm.update(test_image) assert sv_cm.display_min_spinner.value == 1 assert sv_cm.display_max_spinner.value == 6
image_width=1030, ) sv_zoom = sv.ImageView( plot_height=ZOOM_CANVAS_HEIGHT, plot_width=ZOOM_CANVAS_WIDTH, image_height=514, image_width=1030, x_start=258, x_end=772, ) sv_zoom.proj_toggle = sv_main.proj_toggle sv_main.add_as_zoom(sv_zoom) sv_colormapper = sv.ColorMapper([sv_main, sv_zoom]) sv_colormapper.color_bar.width = MAIN_CANVAS_WIDTH // 2 sv_main.plot.add_layout(sv_colormapper.color_bar, place="below") sv_resolrings = sv.ResolutionRings([sv_main, sv_zoom], sv_metadata, sv_streamctrl) sv_intensity_roi = sv.IntensityROI([sv_main, sv_zoom], sv_metadata, sv_streamctrl) sv_saturated_pixels = sv.SaturatedPixels([sv_main, sv_zoom], sv_metadata, sv_streamctrl) sv_spots = sv.Spots([sv_main], sv_metadata, sv_streamctrl) sv_disabled_modules = sv.DisabledModules([sv_main], sv_streamctrl) sv_hist = sv.Histogram(nplots=2, plot_height=200, plot_width=700) sv_hist.plots[0].title = Title(text="Full image") sv_hist.plots[1].title = Title(text="Roi")
doc = curdoc() sv_rt = sv.Runtime() # Currently, it's possible to control only a canvas size, but not a size of the plotting area. MAIN_CANVAS_WIDTH = 1000 + 55 MAIN_CANVAS_HEIGHT = 1000 + 59 # Create streamvis components sv_metadata = sv.MetadataHandler(datatable_height=300, datatable_width=400) sv_main = sv.ImageView(plot_height=MAIN_CANVAS_HEIGHT, plot_width=MAIN_CANVAS_WIDTH) sv_colormapper = sv.ColorMapper([sv_main]) sv_colormapper.color_bar.width = MAIN_CANVAS_WIDTH // 2 sv_main.plot.add_layout(sv_colormapper.color_bar, place="below") sv_hist = sv.Histogram(nplots=1, plot_height=400, plot_width=700) file_path = TextInput(title="File Path:", value="/") dataset_path = TextInput(title="Dataset Path:", value="/") def _load_image_from_dataset(file, dataset, index): with h5py.File(file, "r") as f: image = f[dataset][index].astype("float32") metadata = dict(shape=list(image.shape))