Beispiel #1
0
def imshow(items, title=""):
    gridparam = make.gridparam(background="black",
                               minor_enabled=(False, False),
                               major_style=(".", "gray", 1))
    win = ImageDialog(edit=False,
                      toolbar=True,
                      wintitle=title,
                      options=dict(gridparam=gridparam))
    nc = int(np.sqrt(len(items)) + 1.0)
    maxy = 0
    y = 0
    x = 0
    w = None
    plot = win.get_plot()
    print("-" * 80)
    for i, item in enumerate(items):
        h = item.boundingRect().height()
        if i % nc == 0:
            x = 0
            y += maxy
            maxy = h
        else:
            x += w
            maxy = max(maxy, h)
        w = item.boundingRect().width()

        item.set_transform(x, y, 0.0)
        print("Adding item #%d..." % i, end=' ')
        plot.add_item(item)
        print("Done")
    win.show()
    win.exec_()
Beispiel #2
0
def imshow(items, title=""):
    gridparam = make.gridparam(background="black", minor_enabled=(False, False),
                               major_style=(".", "gray", 1))
    win = ImageDialog(edit=False, toolbar=True, wintitle=title,
                      options=dict(gridparam=gridparam))
    nc = int(np.sqrt(len(items))+1.0)
    maxy = 0
    y = 0
    x = 0
    w = None
    plot = win.get_plot()
    print("-"*80)
    for i, item in enumerate(items):
        h = item.boundingRect().height()
        if i%nc==0:
            x = 0
            y += maxy
            maxy = h
        else:
            x += w
            maxy = max(maxy, h)
        w = item.boundingRect().width()

        item.set_transform(x, y, 0.0)
        print("Adding item #%d..." % i, end=' ')
        plot.add_item(item)
        print("Done")
    win.show()
    win.exec_()
Beispiel #3
0
def create_window():
    gridparam = make.gridparam(background="black", minor_enabled=(False, False), major_style=(".", "gray", 1))
    win = ImageDialog(
        edit=False, toolbar=True, wintitle="Region of interest (ROI) test", options=dict(gridparam=gridparam)
    )
    for toolklass in (RectangleTool, EllipseTool, FreeFormTool, PlaceAxesTool):
        win.add_tool(toolklass)
    return win
Beispiel #4
0
def create_window():
    gridparam = make.gridparam(background="black", minor_enabled=(False, False),
                               major_style=(".", "gray", 1))
    win = ImageDialog(edit=False, toolbar=True,
                      wintitle="Region of interest (ROI) test",
                      options=dict(gridparam=gridparam))
    for toolklass in (RectangleTool, EllipseTool, FreeFormTool, PlaceAxesTool):
        win.add_tool(toolklass)
    return win
Beispiel #5
0
def create_window():
    gridparam = make.gridparam(background="black",
                               minor_enabled=(False, False),
                               major_style=(".", "gray", 1))
    win = ImageDialog(edit=False, toolbar=True,
                      wintitle="All image and plot tools test",
                      options=dict(gridparam=gridparam))
    for toolklass in (RectangleTool, EllipseTool, SegmentTool,
                      MultiLineTool, FreeFormTool):
        win.add_tool(toolklass, handle_final_shape_cb=customize_shape)
    return win
Beispiel #6
0
def create_window():
    gridparam = make.gridparam(background="black",
                               minor_enabled=(False, False),
                               major_style=(".", "gray", 1))
    win = ImageDialog(edit=False,
                      toolbar=True,
                      wintitle="All image and plot tools test",
                      options=dict(gridparam=gridparam))
    for toolklass in (RectangleTool, EllipseTool, SegmentTool, MultiLineTool,
                      FreeFormTool):
        win.add_tool(toolklass, handle_final_shape_cb=customize_shape)
    return win