plot_panel.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:CAAPR 作者: Stargrazer82301 项目源码 文件源码
def __init__(self, parent):
        wx.Panel.__init__(self, parent, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize)
        self.ztv_frame = self.GetTopLevelParent()
        self.ztv_frame.primary_image_panel.popup_menu_cursor_modes.append('Slice plot')
        self.ztv_frame.primary_image_panel.available_cursor_modes['Slice plot'] = {
                'set-to-mode':self.set_cursor_to_plot_mode,
                'on_button_press':self.on_button_press,
                'on_motion':self.on_motion,
                'on_button_release':self.on_button_release}
        for cur_key in ['c', 'C', 'v', 'V', 'y', 'Y']:
            self.ztv_frame.primary_image_panel.available_key_presses[cur_key] = self.do_column_plot
        for cur_key in ['r', 'R', 'h', 'H', 'x', 'X']:
            self.ztv_frame.primary_image_panel.available_key_presses[cur_key] = self.do_row_plot
        for cur_key in ['z', 'Z']:
            self.ztv_frame.primary_image_panel.available_key_presses[cur_key] = self.do_stack_plot

        self.primary_image_patch = None

        self.sizer = wx.BoxSizer(wx.VERTICAL)
        self.plot_panel = PlotPlotPanel(self)
        self.sizer.Add(self.plot_panel, 1, wx.LEFT | wx.TOP | wx.EXPAND)

        self.hideshow_button = wx.Button(self, wx.ID_ANY, u"Hide", wx.DefaultPosition, wx.DefaultSize, 0)
        self.sizer.Add(self.hideshow_button, 0, wx.ALL|wx.ALIGN_RIGHT|wx.ALIGN_BOTTOM, 2)
        self.hideshow_button.Bind(wx.EVT_BUTTON, self.on_hideshow_button)

        self.SetSizer(self.sizer)
        self.Fit()
        self.start_pt = wx.RealPoint(0., 0.)
        self.end_pt = wx.RealPoint(0., 0.)
        self.redraw()
        pub.subscribe(self.on_new_xy0, 'set-new-slice-plot-xy0')
        pub.subscribe(self.on_new_xy1, 'set-new-slice-plot-xy1')
        pub.subscribe(self.queue_redraw, 'primary-xy-limits-changed')
        pub.subscribe(self.queue_redraw, 'recalc-display-image-called')
        pub.subscribe(self.remove_overplot_on_image, 'hide-plot-panel-overplot')
        pub.subscribe(self.redraw_overplot_on_image, 'show-plot-panel-overplot')
        pub.subscribe(self.publish_xy0xy1_to_stream, 'get-slice-plot-coords')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号