当前位置: 首页>>代码示例>>Python>>正文


Python ImageDialog.get_plot方法代码示例

本文整理汇总了Python中guiqwt.plot.ImageDialog.get_plot方法的典型用法代码示例。如果您正苦于以下问题:Python ImageDialog.get_plot方法的具体用法?Python ImageDialog.get_plot怎么用?Python ImageDialog.get_plot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在guiqwt.plot.ImageDialog的用法示例。


在下文中一共展示了ImageDialog.get_plot方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: imshow

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import get_plot [as 别名]
def imshow(data, title=None, hold=False):
    dlg = ImageDialog(wintitle=title)
    dlg.get_plot().add_item(make.image(data))
    if hold:
        dlg.show()
    else:
        dlg.exec_()
开发者ID:HaMF,项目名称:guiqwt,代码行数:9,代码来源:rotatecrop.py

示例2: test

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import get_plot [as 别名]
def test():
    win = ImageDialog(edit=True, toolbar=True,
                      wintitle="Sample multi-polygon item")
    plot = win.get_plot()
    plot.set_aspect_ratio(lock=True)
    plot.set_antialiasing(False)
    plot.set_axis_direction('left', False)
    plot.set_axis_title("bottom", "Lon")
    plot.set_axis_title("left", "Lat")
    
    points = []
    offsets = zeros( (NCIRC, 2), int32)
    colors = zeros( (NCIRC, 2), uint32)
    npts = 0
    for k in range(NCIRC):
        pts = create_circle()
        offsets[k, 0] = k
        offsets[k, 1] = npts
        npts += pts.shape[0]
        points.append(pts)
        colors[k, 0] = COLORS[k%len(COLORS)][0]
        colors[k, 1] = COLORS[(3*k)%len(COLORS)][1]
    points = concatenate(points)
    
    print(NCIRC, "Polygons")
    print(points.shape[0], "Points")
    
    crv = PolygonMapItem()
    crv.set_data(points, offsets, colors)
    plot.add_item(crv, z=0)
    win.show()
    win.exec_()
开发者ID:HaMF,项目名称:guiqwt,代码行数:34,代码来源:polygons.py

示例3: imshow

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import get_plot [as 别名]
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_()
开发者ID:alimuldal,项目名称:guiqwt,代码行数:31,代码来源:transform.py

示例4: imshow

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import get_plot [as 别名]
def imshow(filename):
    win = ImageDialog(edit=False, toolbar=True, wintitle="RGB image item test")
    item = make.rgbimage(filename=filename, xdata=[-1, 1], ydata=[-1, 1])
    plot = win.get_plot()
    plot.add_item(item)
    win.show()
    win.exec_()
开发者ID:HaMF,项目名称:guiqwt,代码行数:9,代码来源:image_rgb.py

示例5: imshow

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import get_plot [as 别名]
def imshow( items ):
    win = ImageDialog(edit=False, toolbar=True, options={"yreverse": False},
                      wintitle="Pcolor test")
    plot = win.get_plot()
    for item in items:
        plot.add_item(item)
    win.show()
    win.exec_()
开发者ID:HaMF,项目名称:guiqwt,代码行数:10,代码来源:pcolor.py

示例6: imshow

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import get_plot [as 别名]
def imshow( data ):
    win = ImageDialog(edit=False, toolbar=True, wintitle="ImageDialog test",
                      options=dict(xlabel='Concentration', xunit='ppm'))
    item = make.image(data)
    plot = win.get_plot()
    plot.add_item(item)
    win.show()
    win.exec_()
开发者ID:alimuldal,项目名称:guiqwt,代码行数:10,代码来源:image.py

示例7: imshow

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import get_plot [as 别名]
def imshow( x, y, data ):
    win = ImageDialog(edit=False, toolbar=True,
                      wintitle="Image with custom X/Y axes scales",
                      options=dict(xlabel="x (a.u.)", ylabel="y (a.u.)",
                                   yreverse=False))
    item = make.xyimage(x, y, data)
    plot = win.get_plot()
    plot.add_item(item)
    win.show()
    win.exec_()
开发者ID:HaMF,项目名称:guiqwt,代码行数:12,代码来源:imagexy.py

示例8: mandel

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import get_plot [as 别名]
def mandel():
    win = ImageDialog(edit=True, toolbar=True, wintitle="Mandelbrot",
                      options=dict(yreverse=False))
    mandel = MandelItem(-1.5, .5, -1., 1.)
    win.add_tool(FullScale, mandel)
    plot = win.get_plot()
    plot.set_aspect_ratio(lock=False)
    plot.add_item(mandel)
    plot.set_full_scale(mandel)
    win.show()
    win.exec_()
开发者ID:HaMF,项目名称:guiqwt,代码行数:13,代码来源:mandelbrot.py

示例9: test

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import get_plot [as 别名]
def test():
    filename = osp.join(osp.dirname(__file__), "mr-brain.dcm")
    image = make.image(filename=filename, title="DICOM img", colormap='gray')
    win = ImageDialog(edit=False, toolbar=True, wintitle="DICOM I/O test",
                      options=dict(show_contrast=True))
    plot = win.get_plot()
    plot.add_item(image)
    plot.select_item(image)
    contrast = win.get_contrast_panel()
    contrast.histogram.eliminate_outliers(54.)
    win.resize(600, 700)
    return win
开发者ID:alimuldal,项目名称:guiqwt,代码行数:14,代码来源:dicom_image.py

示例10: hist2d_func

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import get_plot [as 别名]
def hist2d_func(X, Y, Z):
    win = ImageDialog(edit=True, toolbar=True, wintitle="2-D Histogram X0=(0,1), X1=(-1,-1)")
    hist2d = make.histogram2D(X, Y, 200, 200, Z=Z, computation=2)
    curve = make.curve(X[::50], Y[::50], linestyle="", marker="+", title=_("Markers"))
    plot = win.get_plot()
    plot.set_aspect_ratio(lock=False)
    plot.set_antialiasing(False)
    plot.add_item(hist2d)
    plot.add_item(curve)
    plot.set_item_visible(curve, False)
    win.show()
    win.exec_()
开发者ID:gyenney,项目名称:Tools,代码行数:14,代码来源:hist2d_func.py

示例11: taurusImageMain

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import get_plot [as 别名]
def taurusImageMain():
    from guiqwt.tools import (RectangleTool, EllipseTool, HRangeTool, PlaceAxesTool,
                              MultiLineTool, FreeFormTool, SegmentTool, CircleTool,
                              AnnotatedRectangleTool, AnnotatedEllipseTool,
                              AnnotatedSegmentTool, AnnotatedCircleTool, LabelTool,
                              AnnotatedPointTool, ObliqueRectangleTool,
                              AnnotatedObliqueRectangleTool)
    try:  # In newer guiqwt versions, Annotated*CursorTool have been replaced by *CursorTool
        from guiqwt.tools import AnnotatedVCursorTool, AnnotatedHCursorTool
        VCursorTool, HCursorTool = AnnotatedVCursorTool, AnnotatedHCursorTool
    except ImportError:
        from guiqwt.tools import VCursorTool, HCursorTool

    from taurus.qt.qtgui.extra_guiqwt.tools import TaurusImageChooserTool
    from guiqwt.plot import ImageDialog
    from taurus.qt.qtgui.extra_guiqwt.builder import make
    from taurus.qt.qtgui.application import TaurusApplication
    import taurus.core.util.argparse
    import sys

    parser = taurus.core.util.argparse.get_taurus_parser()
    parser.set_usage("%prog [options] [<model1> [<model2>] ...]")
    parser.set_description("a taurus application for plotting 2D data sets")
    app = TaurusApplication(
        cmd_line_parser=parser, app_name="taurusimage", app_version=taurus.Release.version)
    args = app.get_command_line_args()

    # create a dialog with a plot and add the images
    win = ImageDialog(edit=False, toolbar=True, wintitle="Taurus Image",
                      options=dict(show_xsection=False, show_ysection=False))

    # add tools
    for toolklass in (TaurusImageChooserTool,
                      LabelTool, HRangeTool,
                      MultiLineTool, FreeFormTool, PlaceAxesTool,
                      AnnotatedObliqueRectangleTool,
                      AnnotatedEllipseTool, AnnotatedSegmentTool,
                      AnnotatedPointTool, VCursorTool,
                      HCursorTool):
        win.add_tool(toolklass)

    # add images from given models
    plot = win.get_plot()
    for m in args:
        img = make.image(taurusmodel=m)
        plot.add_item(img)
        # IMPORTANT: connect the cross section plots to the taurusimage so that
        # they are updated when the taurus data changes
        img.dataChanged.connect(win.update_cross_sections)

    win.exec_()
开发者ID:cmft,项目名称:taurus,代码行数:53,代码来源:image.py

示例12: imshow

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import get_plot [as 别名]
def imshow(x, y, data, filter_area, yreverse=True):
    win = ImageDialog(edit=False, toolbar=True, wintitle="Image filter demo",
                      options=dict(xlabel="x (cm)", ylabel="y (cm)",
                                   yreverse=yreverse))
    image = make.xyimage(x, y, data)
    plot = win.get_plot()
    plot.add_item(image)
    xmin, xmax, ymin, ymax = filter_area
    flt = make.imagefilter(xmin, xmax, ymin, ymax, image,
                           filter=lambda x, y, data: gaussian_filter(data, 5))
    plot.add_item(flt, z=1)
    plot.replot()
    win.show()
    win.exec_()
开发者ID:CaptainAL,项目名称:Spyder,代码行数:16,代码来源:imagefilter.py

示例13: plotImage

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import get_plot [as 别名]
def plotImage(x,y,z,wintitle="Contour Plot",options={"lock_aspect_ratio":False,"yreverse":False}):
    options.update(dict(show_xsection=True, show_ysection=True))
    """Test"""
    # -- Create QApplication    
    _app = guidata.qapplication()
    # --
    win = ImageDialog(edit=True, toolbar=True, wintitle=wintitle,
                      options=options)
    win.resize(1500, 1000)
    item = make.xyimage(x, y, z,interpolation="linear")    
    plot = win.get_plot()
    plot.add_item(item)        
    win.plot_widget.xcsw_splitter.setSizes([400,600])
    win.show()
    return win
开发者ID:gsehrlich,项目名称:diffusive-ta,代码行数:17,代码来源:helperFunctions.py

示例14: xyimagebug

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import get_plot [as 别名]
def xyimagebug(offset):
    from guiqwt.plot import ImageDialog
    from guiqwt.builder import make
    import numpy
    import guidata
    app = guidata.qapplication()
    data = numpy.random.rand(100, 100)
    x = numpy.arange(100)+offset 
    y = numpy.arange(100)
    image = make.xyimage(x, y, data=data)
    win = ImageDialog()
    plot = win.get_plot()
    plot.add_item(image)
    plot.select_item(image) #this helps in seeing where the image should be
    win.exec_()
开发者ID:HaMF,项目名称:guiqwt,代码行数:17,代码来源:highprecisionxy.py

示例15: get_segment

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import get_plot [as 别名]
def get_segment(item):
    """Show image and return selected segment coordinates"""
    win = ImageDialog(_("Select a segment then press OK to accept"), edit=True)
    default = win.add_tool(SelectTool)
    win.set_default_tool(default)
    segtool = win.add_tool(AnnotatedSegmentTool, title="Test",
                           switch_to_default_tool=True)
    segtool.activate()
    plot = win.get_plot()
    plot.add_item(item)
    plot.set_active_item(item)
    win.show()
    if win.exec_():
        shape = segtool.get_last_final_shape()
        return shape.get_rect()
开发者ID:HaMF,项目名称:guiqwt,代码行数:17,代码来源:get_segment.py


注:本文中的guiqwt.plot.ImageDialog.get_plot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。