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
# Currently, it's possible to control only a canvas size, but not a size of the plotting area. MAIN_CANVAS_WIDTH = 1030 + 53 MAIN_CANVAS_HEIGHT = 514 + 67 ZOOM_CANVAS_WIDTH = 514 + 53 ZOOM_CANVAS_HEIGHT = 514 + 28 # Create streamvis components sv_streamctrl = sv.StreamControl(sv_rt) sv_metadata = sv.MetadataHandler(datatable_width=500) sv_metadata.issues_datatable.height = 100 sv_main = sv.ImageView( plot_height=MAIN_CANVAS_HEIGHT, plot_width=MAIN_CANVAS_WIDTH, image_height=514, 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_rt = sv.Runtime() # Currently, it's possible to control only a canvas size, but not a size of the plotting area. MAIN_CANVAS_WIDTH = 800 + 55 MAIN_CANVAS_HEIGHT = 800 + 60 ZOOM_CANVAS_WIDTH = 600 + 55 ZOOM_CANVAS_HEIGHT = 600 + 30 # Create streamvis components sv_streamctrl = sv.StreamControl(sv_rt) sv_metadata = sv.MetadataHandler() sv_metadata.issues_datatable.height = 100 sv_main = sv.ImageView(plot_height=MAIN_CANVAS_HEIGHT, plot_width=MAIN_CANVAS_WIDTH) sv_zoom = sv.ImageView(plot_height=ZOOM_CANVAS_HEIGHT, plot_width=ZOOM_CANVAS_WIDTH) sv_zoom.proj_toggle = sv_main.proj_toggle sv_main.add_as_zoom(sv_zoom) sv_zoom_proj_v = sv.Projection(sv_zoom, "vertical") sv_zoom_proj_h = sv.Projection(sv_zoom, "horizontal") 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,
ZOOM1_RIGHT = ZOOM1_LEFT + ZOOM_WIDTH ZOOM1_TOP = ZOOM1_BOTTOM + ZOOM_HEIGHT ZOOM2_LEFT = (ZOOM_WIDTH + 6) * 6 ZOOM2_BOTTOM = 0 ZOOM2_RIGHT = ZOOM2_LEFT + ZOOM_WIDTH ZOOM2_TOP = ZOOM2_BOTTOM + ZOOM_HEIGHT # Create streamvis components sv_streamctrl = sv.StreamControl(sv_rt) sv_metadata = sv.MetadataHandler(datatable_height=430, datatable_width=800) sv_metadata.issues_datatable.height = 100 sv_main = sv.ImageView( plot_height=MAIN_CANVAS_HEIGHT, plot_width=MAIN_CANVAS_WIDTH, image_height=IMAGE_SIZE_Y, image_width=IMAGE_SIZE_X, ) sv_zoom1 = sv.ImageView( plot_height=ZOOM_CANVAS_HEIGHT, plot_width=ZOOM_CANVAS_WIDTH, image_height=IMAGE_SIZE_Y, image_width=IMAGE_SIZE_X, x_start=ZOOM1_LEFT, x_end=ZOOM1_RIGHT, y_start=ZOOM1_BOTTOM, y_end=ZOOM1_TOP, ) sv_zoom1.proj_toggle = sv_main.proj_toggle sv_main.add_as_zoom(sv_zoom1, line_color="red")
def _im_plot_with_cm(): im_plot = sv.ImageView() yield im_plot