Ejemplo n.º 1
0
 def _show_img(self, img, title=None):
     print(img)
     canvas = self.canvasnb.add_canvas()
     if not isinstance(img, Image):
         img = Image(img, title)
     App.show_img(self, img, img.title)
     canvas.set_img(img)
Ejemplo n.º 2
0
def action_demo5():
    app = App()
    image = Image([camera()], 'camera')
    app.show_img(image, 'camera')
    Gaussian().start(app)

    plt.subplot(121).imshow(camera())
    plt.subplot(122).imshow(image.img)
    plt.show()
Ejemplo n.º 3
0
 def _show_img(self, img, title=None):
     cframe = CanvasFrame(self, True)
     canvas = cframe.canvas
     if not isinstance(img, Image): 
         img = Image(img, title)
     App.show_img(self, img, img.title)
     cframe.Bind(wx.EVT_ACTIVATE, self.on_active_img)
     cframe.Bind(wx.EVT_CLOSE, self.on_close_img)
     canvas.set_img(img)
     cframe.SetIcon(self.GetIcon())
     cframe.Show()
Ejemplo n.º 4
0
def object_test():
    '''
    there is a manager for every type of object.
    such as img_manager, we can call app's:
    show_img, close_img, active_img, get_img
    '''
    from sciapp.object import Image
    from skimage.data import camera

    app = App()
    image = Image([camera()], 'camera')
    app.show_img(image, 'camera')
    # >>> UINT8  512x512  S:1/1  C:0/1  0.25M
    print(app.get_img())
    # >>> <sciapp.object.image.Image object at 0x000002076A025780>
    print(app.img_names())
    # >>> ['camera']
    app.close_img('camera')
    # >>> close image: camera
    print(app.img_names())