/** Constructs a new Calibration object using the default values. */ public Calibration(ImagePlus imp) { if (imp!=null) { bitDepth = imp.getBitDepth(); if (bitDepth!=UNKNOWN) invertedLut=imp.isInvertedLut(); } }
/** Constructs a new Calibration object using the default values. */ public Calibration(ImagePlus imp) { if (imp!=null) { bitDepth = imp.getBitDepth(); if (bitDepth!=UNKNOWN) invertedLut=imp.isInvertedLut(); } }
boolean invertedLut = imp.isInvertedLut(); background255 = (invertedLut && Prefs.blackBackground) || (!invertedLut && !Prefs.blackBackground);
boolean invertedLut = imp.isInvertedLut(); background255 = (invertedLut && Prefs.blackBackground) || (!invertedLut && !Prefs.blackBackground);
boolean invertedLut = imp.isInvertedLut(); background255 = (invertedLut && Prefs.blackBackground) || (!invertedLut && !Prefs.blackBackground);
state = getImage().isLocked(); else if (arg.contains("invert") && arg.contains("lut")) state = getImage().isInvertedLut(); else if (arg.indexOf("hyper")!=-1) state = getImage().isHyperStack();
state = getImage().isLocked(); else if (arg.contains("invert") && arg.contains("lut")) state = getImage().isInvertedLut(); else if (arg.indexOf("hyper")!=-1) state = getImage().isHyperStack();
boolean setThresholdLevels(ImagePlus imp, ImageProcessor ip) { double t1 = ip.getMinThreshold(); double t2 = ip.getMaxThreshold(); boolean invertedLut = imp.isInvertedLut(); boolean byteImage = ip instanceof ByteProcessor; if (ip instanceof ShortProcessor)
break; if (imp.isInvertedLut()) s += " (inverting LUT)"; return s+"; "+getImageSize(imp);
/** Read the parameters (during preview or after showing the dialog) */ public boolean dialogItemChanged(GenericDialog gd, AWTEvent e) { tolerance = gd.getNextNumber(); if (tolerance<0) tolerance = 0; dialogOutputType = gd.getNextChoiceIndex(); outputType = previewing ? POINT_SELECTION : dialogOutputType; excludeOnEdges = gd.getNextBoolean(); if (thresholded) useMinThreshold = gd.getNextBoolean(); else useMinThreshold = false; lightBackground = gd.getNextBoolean(); boolean invertedLut = imp.isInvertedLut(); if (useMinThreshold && ((invertedLut&&!lightBackground) || (!invertedLut&&lightBackground))) { if (!thresholdWarningShown) if (!IJ.showMessageWithCancel( "Find Maxima", "\"Above Lower Threshold\" option cannot be used\n"+ "when finding minima (image with light background\n"+ "or image with dark background and inverting LUT).") && !previewing) return false; // if faulty input is not detected during preview, "cancel" quits thresholdWarningShown = true; useMinThreshold = false; ((Checkbox)(checkboxes.elementAt(1))).setState(false); //reset "Above Lower Threshold" checkbox } if (!gd.isPreviewActive()) messageArea.setText(""); // no "nnn Maxima" message when not previewing return (!gd.invalidNumber()); } // public boolean DialogItemChanged
/** Read the parameters (during preview or after showing the dialog) */ public boolean dialogItemChanged(GenericDialog gd, AWTEvent e) { tolerance = gd.getNextNumber(); if (tolerance<0) tolerance = 0; dialogOutputType = gd.getNextChoiceIndex(); outputType = previewing ? POINT_SELECTION : dialogOutputType; excludeOnEdges = gd.getNextBoolean(); if (thresholded) useMinThreshold = gd.getNextBoolean(); else useMinThreshold = false; lightBackground = gd.getNextBoolean(); boolean invertedLut = imp.isInvertedLut(); if (useMinThreshold && ((invertedLut&&!lightBackground) || (!invertedLut&&lightBackground))) { if (!thresholdWarningShown) if (!IJ.showMessageWithCancel( "Find Maxima", "\"Above Lower Threshold\" option cannot be used\n"+ "when finding minima (image with light background\n"+ "or image with dark background and inverting LUT).") && !previewing) return false; // if faulty input is not detected during preview, "cancel" quits thresholdWarningShown = true; useMinThreshold = false; ((Checkbox)(checkboxes.elementAt(1))).setState(false); //reset "Above Lower Threshold" checkbox } if (!gd.isPreviewActive()) messageArea.setText(""); // no "nnn Maxima" message when not previewing return (!gd.invalidNumber()); } // public boolean DialogItemChanged
/** Read the parameters (during preview or after showing the dialog) */ public boolean dialogItemChanged(GenericDialog gd, AWTEvent e) { tolerance = gd.getNextNumber(); if (tolerance<0) tolerance = 0; dialogOutputType = gd.getNextChoiceIndex(); outputType = previewing ? POINT_SELECTION : dialogOutputType; excludeOnEdges = gd.getNextBoolean(); if (thresholded) useMinThreshold = gd.getNextBoolean(); else useMinThreshold = false; lightBackground = gd.getNextBoolean(); boolean invertedLut = imp.isInvertedLut(); if (useMinThreshold && ((invertedLut&&!lightBackground) || (!invertedLut&&lightBackground))) { if (!thresholdWarningShown) if (!IJ.showMessageWithCancel( "Find Maxima", "\"Above Lower Threshold\" option cannot be used\n"+ "when finding minima (image with light background\n"+ "or image with dark background and inverting LUT).") && !previewing) return false; // if faulty input is not detected during preview, "cancel" quits thresholdWarningShown = true; useMinThreshold = false; ((Checkbox)(checkboxes.elementAt(1))).setState(false); //reset "Above Lower Threshold" checkbox } if (!gd.getPreviewCheckbox().getState()) messageArea.setText(""); // no "nnn Maxima" message when not previewing return (!gd.invalidNumber()); } // public boolean DialogItemChanged
break; if (imp.isInvertedLut()) s += " (inverting LUT)"; if (size >= 10000) s += "; " + (int) Math.round(size / 1024.0) + "MB"; else if (size >= 1024) {
/** Converts a 2 or 3 slice 8-bit stack to RGB. */ public void convertRGBStackToRGB() { int stackSize = imp.getStackSize(); if (stackSize<2 || stackSize>3 || type!=ImagePlus.GRAY8) throw new IllegalArgumentException("2 or 3 slice 8-bit stack required"); int width = imp.getWidth(); int height = imp.getHeight(); ImageStack stack = imp.getStack(); byte[] R = (byte[])stack.getPixels(1); byte[] G = (byte[])stack.getPixels(2); byte[] B; if (stackSize>2) B = (byte[])stack.getPixels(3); else B = new byte[width*height]; imp.trimProcessor(); ColorProcessor cp = new ColorProcessor(width, height); cp.setRGB(R, G, B); if (imp.isInvertedLut()) cp.invert(); imp.setImage(cp.createImage()); imp.killStack(); if (IJ.isLinux()) imp.setTitle(imp.getTitle()); }
/** Converts a 2 or 3 slice 8-bit stack to RGB. */ public void convertRGBStackToRGB() { int stackSize = imp.getStackSize(); if (stackSize<2 || stackSize>3 || type!=ImagePlus.GRAY8) throw new IllegalArgumentException("2 or 3 slice 8-bit stack required"); int width = imp.getWidth(); int height = imp.getHeight(); ImageStack stack = imp.getStack(); byte[] R = (byte[])stack.getPixels(1); byte[] G = (byte[])stack.getPixels(2); byte[] B; if (stackSize>2) B = (byte[])stack.getPixels(3); else B = new byte[width*height]; imp.trimProcessor(); ColorProcessor cp = new ColorProcessor(width, height); cp.setRGB(R, G, B); if (imp.isInvertedLut()) cp.invert(); imp.setImage(cp.createImage()); imp.killStack(); if (IJ.isLinux()) imp.setTitle(imp.getTitle()); }
Color bgcolor = (img.isInvertedLut()) ? Color.BLACK : Color.WHITE; Toolbar.setBackgroundColor(bgcolor); Color bgcolor = (img.isInvertedLut()) ? Color.WHITE : Color.BLACK; Toolbar.setBackgroundColor(bgcolor);
if (compositeImage) fi.nImages = getImageStackSize(); fi.whiteIsZero = isInvertedLut(); fi.intelByteOrder = false; if (fi.nImages==1 && ip!=null)
roi = null; boolean invertedLut = imp.isInvertedLut(); double threshold = useMinThreshold?ip.getMinThreshold():ImageProcessor.NO_THRESHOLD; if ((invertedLut&&!lightBackground) || (!invertedLut&&lightBackground)) {
roi = null; boolean invertedLut = imp.isInvertedLut(); double threshold = useMinThreshold?ip.getMinThreshold():ImageProcessor.NO_THRESHOLD; if ((invertedLut&&!lightBackground) || (!invertedLut&&lightBackground)) {
roi = null; boolean invertedLut = imp.isInvertedLut(); double threshold = useMinThreshold?ip.getMinThreshold():ImageProcessor.NO_THRESHOLD; if ((invertedLut&&!lightBackground) || (!invertedLut&&lightBackground)) {