diff --git a/functions.html b/functions.html index 1ce04763..80377c58 100644 --- a/functions.html +++ b/functions.html @@ -3326,12 +3326,17 @@

Built-in Macro Functions

or an empty string if key is not found.
- -Property.getNumber(key)
+ +Property.getValue(key)
Returns the image property associated with key, as a number, or returns NaN if key is not found or the property cannot be converted into a number. -Requires 1.53b. +Requires 1.53n. +
+ + +Property.getNumber(key)
+Alias for Property.getValue(key).
@@ -5483,7 +5488,7 @@

Built-in Macro Functions

-Last updated 2025-01-18 +Last updated 2025-02-15 diff --git a/ij/ImageJ.java b/ij/ImageJ.java index 45ff4125..6a338a0c 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.54n"; - public static final String BUILD = "7"; + public static final String BUILD = ""; //10 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/gui/HistogramPlot.java b/ij/gui/HistogramPlot.java index ebf64ee8..d543102f 100644 --- a/ij/gui/HistogramPlot.java +++ b/ij/gui/HistogramPlot.java @@ -106,11 +106,11 @@ public void draw(ImagePlus imp, ImageStatistics stats) { drawHistogram(imp, ip, fixedRange, stats.histMin, stats.histMax); } - protected void drawHistogram(ImageProcessor ip, boolean fixedRange) { - drawHistogram(null, ip, fixedRange, 0.0, 0.0); + protected void drawHistogram(ImageProcessor ip, boolean unused) { + drawHistogram(null, ip, unused, 0.0, 0.0); } - void drawHistogram(ImagePlus imp, ImageProcessor ip, boolean fixedRange, double xMin, double xMax) { + void drawHistogram(ImagePlus imp, ImageProcessor ip, boolean unused, double xMin, double xMax) { setTitle("Histogram of "+imp.getShortTitle()); int x, y; long maxCount2 = 0; @@ -141,7 +141,7 @@ void drawHistogram(ImagePlus imp, ImageProcessor ip, boolean fixedRange, double else drawAlignedColorBar(imp, xMin, xMax, ip, x-1, y, HIST_WIDTH, BAR_HEIGHT); y += BAR_HEIGHT+(int)(15*SCALE); - drawText(ip, x, y, fixedRange); + drawText(ip, x, y); srcImageID = imp.getID(); } @@ -282,7 +282,7 @@ void drawLogPlot (long maxCount, ImageProcessor ip) { ip.setColor(Color.black); } - void drawText(ImageProcessor ip, int x, int y, boolean fixedRange) { + void drawText(ImageProcessor ip, int x, int y) { ip.setFont(font); ip.setAntialiasedText(true); double hmin = cal.getCValue(stats.histMin); @@ -304,12 +304,12 @@ void drawText(ImageProcessor ip, int x, int y, boolean fixedRange) { } ip.setJustification(ImageProcessor.LEFT_JUSTIFY); } - double range = hmax-hmin; - if (fixedRange&&!cal.calibrated()&&hmin==0&&hmax==255) - range = 256; - double binWidth = range/stats.nBins; + //double range = hmax-hmin; + //if (fixedRange&&!cal.calibrated()&&hmin==0&&hmax==255) + // range = 256; + double binWidth = stats.binSize; binWidth = Math.abs(binWidth); - showBins = binWidth!=1.0 || !fixedRange; + showBins = binWidth!=1.0; col1 = XMARGIN + 5; col2 = XMARGIN + HIST_WIDTH/2; row1 = y+(int)(25*SCALE); diff --git a/ij/gui/HistogramWindow.java b/ij/gui/HistogramWindow.java index 0b7cdd69..59cce41b 100644 --- a/ij/gui/HistogramWindow.java +++ b/ij/gui/HistogramWindow.java @@ -440,10 +440,7 @@ void drawText(ImageProcessor ip, int x, int y, boolean fixedRange) { } ip.setJustification(ImageProcessor.LEFT_JUSTIFY); } - double range = hmax-hmin; - if (fixedRange&&!cal.calibrated()&&hmin==0&&hmax==255) - range = 256; - double binWidth = range/stats.nBins; + double binWidth = stats.binSize; binWidth = Math.abs(binWidth); showBins = binWidth!=1.0 || !fixedRange; col1 = XMARGIN + 5; diff --git a/ij/macro/Functions.java b/ij/macro/Functions.java index 6cb705d3..9d421be7 100644 --- a/ij/macro/Functions.java +++ b/ij/macro/Functions.java @@ -8235,7 +8235,7 @@ private Variable doProperty() { } else if (name.equals("get")) { String value = imp.getProp(getStringArg()); return new Variable(value!=null?value:""); - } else if (name.equals("getNumber")) { + } else if (name.equals("getNumber") || name.equals("getValue")) { String svalue = imp.getProp(getStringArg()); double nvalue = svalue!=null?Tools.parseDouble(svalue):Double.NaN; return new Variable(nvalue); diff --git a/ij/process/StackStatistics.java b/ij/process/StackStatistics.java index 7692fa2f..628a166b 100644 --- a/ij/process/StackStatistics.java +++ b/ij/process/StackStatistics.java @@ -4,7 +4,7 @@ import ij.measure.*; import ij.plugin.filter.Analyzer; import java.awt.*; - + /** Statistics, including the histogram, of a stack. */ public class StackStatistics extends ImageStatistics { @@ -147,6 +147,8 @@ void doCalculations(ImagePlus imp, int bins, double histogramMin, double histog histMin = cal.getRawValue(histMin); histMax = cal.getRawValue(histMax); binSize = (histMax-histMin+1)/nBins; + if (imp.getBitDepth()==32) + binSize = (histMax-histMin)/nBins; int bits = imp.getBitDepth(); if (histMin==0.0 && histMax==256.0 && (bits==8||bits==24)) histMax = 255.0; diff --git a/release-notes.html b/release-notes.html index 46894357..225a1834 100644 --- a/release-notes.html +++ b/release-notes.html @@ -6,7 +6,7 @@ -
  • 1.54n7 02 February 2025 +
  • 1.54n 17 February 2025