def buttonPressed(event): temprois=self.getIncludeRois() for roi in temprois: m=Morph(self.__image, roi) IJ.log("----------------------------------") IJ.log(roi.getName()) for r in self.__ranges.values(): IJ.log(r[0]+" min= "+str(r[1])+" < val="+str(m.__getattribute__(r[0]))+" < max= "+str(r[2])) IJ.run(self.__image, "Remove Overlay", "") o=Overlay() for roi in temprois: o.addElement(roi) self.__image.killRoi() self.__image.setOverlay(o) self.__image.updateAndDraw()
def valueChanged(event): name=event.getSource().getName() names=name.split("_") factor=1 if names[0] in self.__set1000: factor=0.001 if names[0] in self.__set10:factor=0.1 value=event.getSource().getValue()*factor if names[1]=="min": self.__ranges[names[0]]=(names[0], value, self.__slidersDict[names[0]+"_max"].getValue()*factor, self.__boxesDict[names[0]].getState()) #self.__ranges[names[0]]=(names[0], value, self.__slidersDict[names[0]+"_max"].getValue()*factor) else: self.__ranges[names[0]]=(names[0], self.__slidersDict[names[0]+"_min"].getValue()*factor, value, self.__boxesDict[names[0]].getState()) #self.__ranges[names[0]]=(names[0], self.__slidersDict[names[0]+"_min"].getValue()*factor, value) temprois=self.getIncludeRois() IJ.run(self.__image, "Remove Overlay", "") o=Overlay() for roi in temprois: o.addElement(roi) self.__image.killRoi() self.__image.setOverlay(o) self.__image.updateAndDraw()