def __init__(self, parent=None, base=None, data=None, id=-1, *args, **kwds): kwds["style"] = wx.DEFAULT_DIALOG_STYLE kwds["size"] = wx.Size(_STATICBOX_WIDTH * 0.8, PANEL_SIZE) wx.Dialog.__init__(self, parent, id=id, *args, **kwds) if data != None: # Font size kwds = [] self.SetWindowVariant(variant=FONT_VARIANT) self.SetTitle("Mask Editor for " + data.name) self.parent = base self.data = data self.str = self.data.__str__() # # mask for 2D self.mask = data.mask self.default_mask = copy.deepcopy(data.mask) # # masked data from GUI self.slicer_mask = None self.slicer = None self.slicer_z = 5 self.data.interactive = True # # when 2 data have the same id override the 1 st plotted self.name = self.data.name # Panel for 2D plot self.plotpanel = Maskplotpanel(self, -1, style=wx.TRANSPARENT_WINDOW) self.cmap = DEFAULT_CMAP # # Create Artist and bind it self.subplot = self.plotpanel.subplot self.connect = BindArtist(self.subplot.figure) self._setup_layout() self.newplot = Data2D(image=self.data.data) self.newplot.setValues(self.data) self.plotpanel.add_image(self.newplot) self._update_mask(self.mask) self.Centre() self.Layout() # bind evt_close to _draw in fitpage self.Bind(wx.EVT_CLOSE, self.OnClose)