public void run() { while (!done) { synchronized(this) { try {wait();} catch(InterruptedException e) {} if (!done) {//RPD ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null) { reset(imp); apply(imp); imp.updateAndDraw(); } } } } }
public void run() { while (!done) { synchronized(this) { try {wait();} catch(InterruptedException e) {} if (!done) {//RPD ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null) { reset(imp); apply(imp); imp.updateAndDraw(); } } } } }
void createSelection() { ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null) return; int saveMode = mode; mode = BLACK_AND_WHITE; apply(imp); mode = saveMode; ImageProcessor ip = imp.getProcessor().convertToByte(false); int fg = Prefs.blackBackground?255:0; ip.setThreshold(fg, fg, ImageProcessor.NO_LUT_UPDATE); Roi roi = (new ThresholdToSelection()).convert(ip); reset(imp); imp.setRoi(roi); }
void createSelection() { ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null) return; int saveMode = mode; mode = BLACK_AND_WHITE; apply(imp); mode = saveMode; ImageProcessor ip = imp.getProcessor().convertToByte(false); int fg = Prefs.blackBackground?255:0; ip.setThreshold(fg, fg, ImageProcessor.NO_LUT_UPDATE); Roi roi = (new ThresholdToSelection()).convert(ip); reset(imp); imp.setRoi(roi); }
public synchronized void itemStateChanged(ItemEvent e) { if (IJ.debugMode) IJ.log("ColorThresolder.itemStateChanged"); ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null) return; Object source = e.getSource(); if (source==methodChoice) { method = methodChoice.getSelectedItem(); } else if (source==modeChoice) { mode = modeChoice.getSelectedIndex(); } else if (source==colorSpaceChoice) { colorSpace = ((Choice)source).getSelectedIndex(); flag = true; //originalB.setEnabled(false); filteredB.setEnabled(false); minHue=minSat=minBri=0; maxHue=maxSat=maxBri=255; bandPassH.setState(true); bandPassS.setState(true); bandPassB.setState(true); } else if (source==darkBackground) { } reset(imp); if (source==methodChoice || source==colorSpaceChoice || source==darkBackground) autoSetThreshold(); checkImage(); //new updateNames(); notify(); }
public synchronized void itemStateChanged(ItemEvent e) { if (IJ.debugMode) IJ.log("ColorThresolder.itemStateChanged"); ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null) return; Object source = e.getSource(); if (source==methodChoice) { method = methodChoice.getSelectedItem(); } else if (source==modeChoice) { mode = modeChoice.getSelectedIndex(); } else if (source==colorSpaceChoice) { colorSpace = ((Choice)source).getSelectedIndex(); flag = true; //originalB.setEnabled(false); filteredB.setEnabled(false); minHue=minSat=minBri=0; maxHue=maxSat=maxBri=255; bandPassH.setState(true); bandPassS.setState(true); bandPassB.setState(true); } else if (source==darkBackground) { } reset(imp); if (source==methodChoice || source==colorSpaceChoice || source==darkBackground) autoSetThreshold(); checkImage(); //new updateNames(); notify(); }
if (imp==null || imp.getBitDepth()!=24) return; reset(imp); byte[] hsSource,ssSource,bsSource;
if (imp==null || imp.getBitDepth()!=24) return; reset(imp); byte[] hsSource,ssSource,bsSource;