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


Python ImageDialog.add_tool方法代码示例

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


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

示例1: Ui_Form

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import add_tool [as 别名]
class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(651, 506)
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.imagewidget = ImageDialog()
        self.imagewidget.setOrientation(QtCore.Qt.Vertical)
        self.imagewidget.setObjectName(_fromUtf8("imagewidget"))
        for toolklass in (LabelTool, HRangeTool,
                      VCursorTool, HCursorTool, XCursorTool,
                      SegmentTool, RectangleTool, ObliqueRectangleTool,
                      CircleTool, EllipseTool,
                      MultiLineTool, FreeFormTool, PlaceAxesTool,
                      AnnotatedRectangleTool, AnnotatedObliqueRectangleTool,
                      AnnotatedCircleTool, AnnotatedEllipseTool,
                      AnnotatedSegmentTool, AnnotatedPointTool):
                        self.imagewidget.add_tool(toolklass)
        self.gridLayout.addWidget(self.imagewidget, 0, 0, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        Form.setWindowTitle(_translate("Form", "Form", None))
开发者ID:Jothy,项目名称:RTQA,代码行数:27,代码来源:QWTWidget.py

示例2: create_window

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import add_tool [as 别名]
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
开发者ID:stonebig,项目名称:guiqwt,代码行数:10,代码来源:imagesuperp.py

示例3: create_window

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import add_tool [as 别名]
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
开发者ID:HaMF,项目名称:guiqwt,代码行数:13,代码来源:customize_shape_tool.py

示例4: mandel

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import add_tool [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

示例5: create_window

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import add_tool [as 别名]
def create_window():
    win = ImageDialog(edit=False, toolbar=True,
                      wintitle="All image and plot tools test")
    for toolklass in (LabelTool, HRangeTool,
                      VCursorTool, HCursorTool, XCursorTool,
                      SegmentTool, RectangleTool, ObliqueRectangleTool,
                      CircleTool, EllipseTool,
                      MultiLineTool, FreeFormTool, PlaceAxesTool,
                      AnnotatedRectangleTool, AnnotatedObliqueRectangleTool,
                      AnnotatedCircleTool, AnnotatedEllipseTool,
                      AnnotatedSegmentTool, AnnotatedPointTool):
        win.add_tool(toolklass)
    return win
开发者ID:HaMF,项目名称:guiqwt,代码行数:15,代码来源:image_plot_tools.py

示例6: taurusImageMain

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import add_tool [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

示例7: get_segment

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import add_tool [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

示例8: test1

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import add_tool [as 别名]
def test1():
    """Adapted from guiqwt cross_section.py example"""
    from guiqwt.plot import ImageDialog
    from taurus.qt.qtgui.extra_guiqwt.builder import make
    from taurus.qt.qtgui.application import TaurusApplication
    app = TaurusApplication()

    # define a taurus image
    #model1 = 'sys/tg_test/1/short_image_ro'
    #model1 = 'sys/tg_test/1/long64_image_ro'
    model1 = 'sys/tg_test/1/ulong_image_ro'
    taurusimage = make.image(taurusmodel=model1)
    #taurusrgbimage = make.rgbimage(taurusmodel= 'eval:array([[[ 222, 0, 0], [0, 222, 0]], [[0, 0, 222], [222, 222, 222]]])')
    #taurusxyimage= make.xyimage(taurusmodel= model1)
    #taurusxyimage.set_xy(numpy.arange(251)*10,numpy.arange(251)*100 )

    # define normal image (guiqwt standard)
    #data = numpy.random.rand(100,100)
    #image = make.image(data=data)

    # create a dialog with a plot and add the images
    win = ImageDialog(edit=False, toolbar=True, wintitle="Taurus Cross sections test",
                      options=dict(show_xsection=False, show_ysection=False))
    from taurus.qt.qtgui.extra_guiqwt.tools import TaurusImageChooserTool
    win.add_tool(TaurusImageChooserTool)
    plot = win.get_plot()
    plot.add_item(taurusimage)
#    plot.add_item(taurusxyimage)
#    plot.add_item(image)
#    plot.add_item(taurusrgbimage)

#    win.get_itemlist_panel().show()

    # IMPORTANT: connect the cross section plots to the taurusimage so that they are updated when the taurus data changes
    # taurusimage.dataChanged.connect(win.update_cross_sections)

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

示例9: ImageDialog

# 需要导入模块: from guiqwt.plot import ImageDialog [as 别名]
# 或者: from guiqwt.plot.ImageDialog import add_tool [as 别名]
import os, os.path as osp, pickle

from guiqwt.plot import ImageDialog
from guiqwt.tools import ImageMaskTool
from guiqwt.builder import make

SHOW = True  # Show test in GUI-based test launcher

FNAME = "image_masked.pickle"

if __name__ == "__main__":
    import guidata

    _app = guidata.qapplication()
    win = ImageDialog(toolbar=True, wintitle="Masked image item test")
    win.add_tool(ImageMaskTool)
    if os.access(FNAME, os.R_OK):
        print("Restoring mask...", end=" ")
        iofile = open(FNAME, "rb")
        image = pickle.load(iofile)
        iofile.close()
        print("OK")
    else:
        fname = osp.join(osp.abspath(osp.dirname(__file__)), "brain.png")
        image = make.maskedimage(filename=fname, colormap="gray", show_mask=True, xdata=[0, 20], ydata=[0, 25])
    win.get_plot().add_item(image)
    win.show()
    win.exec_()
    iofile = open(FNAME, "wb")
    pickle.dump(image, iofile)
开发者ID:githubhjz,项目名称:guiqwt,代码行数:32,代码来源:image_masked.py


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