def onReject(self): keeplist = [] imgdata = self.images[self.currentindex] apMask.saveAssessmentFromTargets(self.maskrundata,self.assessrundata,imgdata,keeplist) self.continueOn()
def onKeep(self): keeplist = [] keeptargets = self.panel.getTargets('Regions') imgdata = self.images[self.currentindex] for target in keeptargets: keeplist.append(target.stats['Label']) apMask.saveAssessmentFromTargets(self.maskrundata,self.assessrundata,imgdata,keeplist) self.continueOn()
def onKeepAll(self): self.getImageList() # get maskshape from first mask currentname = self.files[0] dir = self.maskdir fullname = os.path.join(dir, currentname) imarray = self.readPNG(fullname) maskshape = imarray.shape if self.images: for i,imgdata in enumerate(self.images): targets = apMask.getRegionsAsTargets(self.maskrundata,maskshape,imgdata) keeplist = [] keeptargets = targets for target in keeptargets: keeplist.append(target['stats']['Label']) apMask.saveAssessmentFromTargets(self.maskrundata,self.assessrundata,imgdata,keeplist) self.logger.info('Keep All Regions of mask run: %s' % (self.maskrundata['name'],))