def OnAnalyse(self, evt): """ starts actual image analysis @param evt: incoming event from caller """ if self.analysispanel.Validate(): params = self.analysispanel.GetParams() else: return params.update(self.imgpanel.GetParams()) params.update(self.imgconfpanel.GetParams()) ### testing if 'cancel' was pressed somewhere or ### errors when converting from string to float while loading (None is returned) try: pressures, pressacc, scale, aver = self.GetExtraUserData( params['fromnames'], len(params['images'])) except (TypeError): # catching type error return out, extra_out = features.locate(params) geometrydata, mesg = analysis.get_geometry(out) if mesg: self.OnError(mesg) return avergeom = analysis.averageImages(aver, **geometrydata) geometryframe = geometry.GeometryFrame(self, -1, avergeom) geometryframe.Show() tensionframe = tension.TensionsFrame(self, -1, pressures, pressacc, scale, avergeom) tensionframe.Show() evt.Skip()
def OnAnalyse(self, evt): """ starts actual image analysis @param evt: incoming event from caller """ if self.analysispanel.Validate(): params = self.analysispanel.GetParams() else: return params.update(self.imgpanel.GetParams()) params.update(self.imgconfpanel.GetParams()) ### testing if 'cancel' was pressed somewhere or ### errors when converting from string to float while loading (None is returned) try: pressures, pressacc, scale, aver = self.GetExtraUserData(params['fromnames'], len(params['images'])) except(TypeError): # catching type error return out, extra_out = features.locate(params) geometrydata, mesg = analysis.get_geometry(out) if mesg: self.OnError(mesg) return avergeom = analysis.averageImages(aver, **geometrydata) geometryframe = geometry.GeometryFrame(self, -1, avergeom) geometryframe.Show() tensionframe = tension.TensionsFrame(self, -1, pressures, pressacc, scale, avergeom) tensionframe.Show() evt.Skip()
def OnDebugImage(self, evt): """ Process only the current image TODO:process set of images? and display more additional information on it """ imgNo = self.imgpanel.GetImgNo() if self.analysispanel.Validate(): params = self.analysispanel.GetParams() else: return params.update(self.imgpanel.GetParams()) params.update(self.imgconfpanel.GetParams()) img = params['images'][imgNo - 1] params['images'] = img.reshape(1, img.shape[0], img.shape[1]) params['extra'] = True out, extra_out = features.locate(params) extra_out = extra_out[0] ImageDebugFrame = debug.ImageDebugFrame(self, -1, img, out, extra_out) ImageDebugFrame.Show()
def OnDebugImage(self, evt): """ Process only the current image TODO:process set of images? and display more additional information on it """ imgNo = self.imgpanel.GetImgNo() if self.analysispanel.Validate(): params = self.analysispanel.GetParams() else: return params.update(self.imgpanel.GetParams()) params.update(self.imgconfpanel.GetParams()) img = params['images'][imgNo-1] params['images'] = img.reshape(1, img.shape[0], img.shape[1]) params['extra'] = True out, extra_out = features.locate(params) extra_out = extra_out[0] ImageDebugFrame = debug.ImageDebugFrame(self, -1, img, out, extra_out) ImageDebugFrame.Show()