From 1d27fcfba51b958be38387ecc08b24becb8caea5 Mon Sep 17 00:00:00 2001 From: Wayne Rasband Date: Sat, 31 Dec 2022 14:14:47 -0500 Subject: [PATCH] 2022.12.31 (1.54a35; IJ.URL) --- ij/IJ.java | 2 +- ij/ImageJ.java | 2 +- ij/plugin/BrowserLauncher.java | 2 +- ij/plugin/Options.java | 3 ++- ij/plugin/filter/MaximumFinder.java | 3 ++- ij/process/FloatProcessor.java | 11 ++++++++--- ij/process/ImageConverter.java | 4 ++-- ij/process/ImageProcessor.java | 21 ++++++++++++++++++--- ij/process/ShortProcessor.java | 9 ++++++++- ij/process/StackConverter.java | 4 +++- release-notes.html | 9 ++++++++- 11 files changed, 54 insertions(+), 16 deletions(-) diff --git a/ij/IJ.java b/ij/IJ.java index f1e404514..d12581759 100644 --- a/ij/IJ.java +++ b/ij/IJ.java @@ -41,7 +41,7 @@ public class IJ { /** Image display modes */ public static final int COMPOSITE=1, COLOR=2, GRAYSCALE=3; - public static final String URL = "http://imagej.nih.gov/ij"; + public static final String URL = "http://imagej.net/ij"; public static final int ALL_KEYS = -1; /** Use setDebugMode(boolean) to enable/disable debug mode. */ diff --git a/ij/ImageJ.java b/ij/ImageJ.java index 6c9e01dfd..b8a043d46 100644 --- a/ij/ImageJ.java +++ b/ij/ImageJ.java @@ -79,7 +79,7 @@ public class ImageJ extends Frame implements ActionListener, /** Plugins should call IJ.getVersion() or IJ.getFullVersion() to get the version string. */ public static final String VERSION = "1.54a"; - public static final String BUILD = "28"; + public static final String BUILD = "35"; public static Color backgroundColor = new Color(237,237,237); /** SansSerif, 12-point, plain font. */ public static final Font SansSerif12 = new Font("SansSerif", Font.PLAIN, 12); diff --git a/ij/plugin/BrowserLauncher.java b/ij/plugin/BrowserLauncher.java index d8bf2bec4..a47c93dc4 100644 --- a/ij/plugin/BrowserLauncher.java +++ b/ij/plugin/BrowserLauncher.java @@ -60,7 +60,7 @@ public class BrowserLauncher implements PlugIn { public void run(String theURL) { if (error) return; if (theURL==null || theURL.equals("")) - theURL = "http://imagej.org"; + theURL = IJ.URL; try {openURL(theURL);} catch (IOException e) {} } diff --git a/ij/plugin/Options.java b/ij/plugin/Options.java index a6af4aedc..e36d7b48b 100644 --- a/ij/plugin/Options.java +++ b/ij/plugin/Options.java @@ -165,12 +165,13 @@ void conversions() { double[] weights = ColorProcessor.getWeightingFactors(); boolean weighted = !(weights[0]==1d/3d && weights[1]==1d/3d && weights[2]==1d/3d); //boolean weighted = !(Math.abs(weights[0]-1d/3d)<0.0001 && Math.abs(weights[1]-1d/3d)<0.0001 && Math.abs(weights[2]-1d/3d)<0.0001); - GenericDialog gd = new GenericDialog("Conversion Options"); + GenericDialog gd = new GenericDialog("Type Conversion Options"); gd.addCheckbox("Scale when converting", ImageConverter.getDoScaling()); String prompt = "Weighted RGB conversions"; if (weighted) prompt += " (" + IJ.d2s(weights[0]) + "," + IJ.d2s(weights[1]) + ","+ IJ.d2s(weights[2]) + ")"; gd.addCheckbox(prompt, weighted); + gd.addHelp(IJ.URL+"/docs/menus/edit.html#conversions"); gd.showDialog(); if (gd.wasCanceled()) return; diff --git a/ij/plugin/filter/MaximumFinder.java b/ij/plugin/filter/MaximumFinder.java index 4db4f8697..350a2518c 100644 --- a/ij/plugin/filter/MaximumFinder.java +++ b/ij/plugin/filter/MaximumFinder.java @@ -223,7 +223,8 @@ public void run(ImageProcessor ip) { } ByteProcessor outIp = null; boolean strictMode = oldMacro ? excludeOnEdges : strict; - outIp = findMaxima(ip, tolerance, strictMode, threshold, outputType, excludeOnEdges, false); //process the image + boolean isEDM = imp!=null && imp.getBitDepth()==32 && imp.getTitle().startsWith("EDM of "); + outIp = findMaxima(ip, tolerance, strictMode, threshold, outputType, excludeOnEdges, isEDM); //process the image if (outIp == null) return; //cancelled by user or previewing or no output image if (!Prefs.blackBackground) //normally, output has an inverted LUT, "active" pixels black (255) - like a mask outIp.invertLut(); diff --git a/ij/process/FloatProcessor.java b/ij/process/FloatProcessor.java index 2ccf5b4fb..45f8e30a3 100644 --- a/ij/process/FloatProcessor.java +++ b/ij/process/FloatProcessor.java @@ -445,7 +445,6 @@ public void applyTable(int[] lut) {} private void process(int op, double value) { float c, v1, v2; - //boolean resetMinMax = roiWidth==width && roiHeight==height && !(op==FILL); c = (float)value; float min2=0f, max2=0f; if (op==INVERT) @@ -514,8 +513,14 @@ private void process(int op, double value) { } } - /** Each pixel in the image is inverted using p=max-(p-min), where 'min' - and 'max' are the display range limits set using setMinAndMax(). */ + /** Each pixel in the image or ROI is inverted using + * p=max-(p-min), where 'min' and 'max' are the minimum + * and maximum displayed pixel values. + * @see #getMin + * @see #getMax + * @see #setMinAndMax + * @see #resetMinAndMax + */ public void invert() { process(INVERT, 0.0); } diff --git a/ij/process/ImageConverter.java b/ij/process/ImageConverter.java index c3b76e9df..f5e4efb77 100644 --- a/ij/process/ImageConverter.java +++ b/ij/process/ImageConverter.java @@ -66,13 +66,13 @@ public void convertToGray16() { imp.setCalibration(imp.getCalibration()); //update calibration } - private void record() { + public static void record() { if (Recorder.record) { Boolean state = ImageConverter.getDoScaling(); if (Recorder.scriptMode()) Recorder.recordCall("ImageConverter.setDoScaling("+state+");", true); else - Recorder. recordString("setOption(\"ScaleConversions\", "+state+");\n"); + Recorder.recordString("setOption(\"ScaleConversions\", "+state+");\n"); } } diff --git a/ij/process/ImageProcessor.java b/ij/process/ImageProcessor.java index fe6d86c3a..09d404760 100644 --- a/ij/process/ImageProcessor.java +++ b/ij/process/ImageProcessor.java @@ -475,10 +475,10 @@ public void setGlobalBackgroundColor() { setValue(value); } - /** Returns the smallest displayed pixel value. */ + /** Returns the minimum displayed pixel value. */ public abstract double getMin(); - /** Returns the largest displayed pixel value. */ + /** Returns the maximum displayed pixel value. */ public abstract double getMax(); /** This image will be displayed by mapping pixel values in the @@ -2108,7 +2108,22 @@ Use setSnapshotPixels(null) to clear the snapshot buffer. */ supported. */ public abstract void applyTable(int[] lut); - /** Inverts the image or ROI. */ + /** Inverts the image or ROI. + *

+ * With 8-bit images, p=255-p. + *

+ * With RGB images, converts each pixel to + * three 8-bit pixels and uses p=255-p. + *

+ * With 16-bit images, p=65535-p, or p=255-p, + * p=1024-p, etc. if an "Unsigned 16-bit range" + * is set using the "Set" option of the + * Image>Adjust>Brightness/Contrast dialog. + *

+ * With 32-bit images, p=max-(p-min), where 'min' + * and 'max' are the minimum and maximum displayed + * pixel values. + */ public void invert() {process(INVERT, 0.0);} /** Adds 'value' to each pixel in the image or ROI. */ diff --git a/ij/process/ShortProcessor.java b/ij/process/ShortProcessor.java index 01935cfc0..72b7928a1 100644 --- a/ij/process/ShortProcessor.java +++ b/ij/process/ShortProcessor.java @@ -497,7 +497,6 @@ private void process(int op, double value) { switch(op) { case INVERT: v2 = max2 - (v1 - min2); - //v2 = 65535 - (v1+offset); break; case FILL: v2 = fgColor2; @@ -570,6 +569,14 @@ private void process(int op, double value) { } } + /** The image or ROI is inverted using the full + * pixel value range (0-65535) or, if set, using + * the "Unsigned 16-bit range" in the "Set" option + * of the Image>Adjust>Brightness/Contrast + * dialog. + * @see ij.ImagePlus#setDefault16bitRange + * @see ij.ImagePlus#getDefault16bitRange + */ public void invert() { int range = 65536; int defaultRange = ij.ImagePlus.getDefault16bitRange(); diff --git a/ij/process/StackConverter.java b/ij/process/StackConverter.java index 181701e2f..0a1bd7e76 100644 --- a/ij/process/StackConverter.java +++ b/ij/process/StackConverter.java @@ -74,6 +74,7 @@ public void convertToGray8() { ((CompositeImage)imp).resetDisplayRanges(); ((CompositeImage)imp).updateAllChannelsAndDraw(); } + ImageConverter.record(); imp.setSlice(currentSlice); IJ.showProgress(1.0); } @@ -149,6 +150,7 @@ public void convertToGray16() { imp.setDisplayRange(0,65535); } } + ImageConverter.record(); } /** Converts this Stack to 32-bit (float) grayscale. */ @@ -322,6 +324,6 @@ public void convertToIndexedColor(int nColors) { } imp.setStack(null, stack2); imp.setTypeToColor256(); - } + } } diff --git a/release-notes.html b/release-notes.html index 953af4f8d..ad1cc3b9b 100644 --- a/release-notes.html +++ b/release-notes.html @@ -5,12 +5,14 @@ -

  • 1.54a28 27 December 2022 +
  • 1.54a35 31 December 2022
  • 1.53v 21 November 2022