示例#1
0
import streamvis as sv

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 = 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")
示例#2
0
import streamvis as sv

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 = 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,
示例#3
0
def test_saturated_pixels_bad():
    sv_meta = sv.MetadataHandler()
    sv_meta.update({"saturated_pixels": 42})

    assert len(sv_meta.issues_datatable.source.data["issues"]) == 1
示例#4
0
def test_danger_with_issue():
    sv_meta = sv.MetadataHandler()
    sv_meta.add_issue("test")
    sv_meta.update({})

    assert len(sv_meta.issues_datatable.source.data["issues"]) == 1
示例#5
0
def test_is_good_frame_bad():
    sv_meta = sv.MetadataHandler()
    sv_meta.update({"is_good_frame": 0})

    assert len(sv_meta.issues_datatable.source.data["issues"]) == 1
示例#6
0
def test_check_shape_bad(shape):
    sv_meta = sv.MetadataHandler(check_shape=shape)
    sv_meta.update({"shape": (42, 42)})

    assert len(sv_meta.issues_datatable.source.data["issues"]) == 1
ZOOM_WIDTH = 1030
ZOOM_HEIGHT = IMAGE_SIZE_Y

ZOOM1_LEFT = (ZOOM_WIDTH + 6) * 2
ZOOM1_BOTTOM = 0
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,
from bokeh.layouts import column, row
from bokeh.models import Button, Slider, TextInput

import streamvis as sv

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):
示例#9
0
stats = doc.stats

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 = 2200 + 55
MAIN_CANVAS_HEIGHT = 1900 + 64

ZOOM_CANVAS_WIDTH = 800 + 55
ZOOM_CANVAS_HEIGHT = 800 + 30
ZOOM_PROJ_X_CANVAS_HEIGHT = 150 + 11
ZOOM_PROJ_Y_CANVAS_WIDTH = 150 + 31

# Create streamvis components
sv_streamctrl = sv.StreamControl(sv_rt)
sv_metadata = sv.MetadataHandler(datatable_height=230, datatable_width=650)
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, line_color="white")

sv_zoom_proj_v = sv.Projection(sv_zoom,
                               "vertical",
                               plot_height=ZOOM_PROJ_X_CANVAS_HEIGHT)
sv_zoom_proj_v.plot.renderers[0].glyph.line_width = 2

sv_zoom_proj_h = sv.Projection(sv_zoom,