Skip to content

Commit

Permalink
2025.02.17 (1.54n; Release version)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasband committed Feb 17, 2025
1 parent e8002ff commit d05f254
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 22 deletions.
13 changes: 9 additions & 4 deletions functions.html
Original file line number Diff line number Diff line change
Expand Up @@ -3326,12 +3326,17 @@ <h1>Built-in Macro Functions</h1>
or an empty string if <i>key</i> is not found.
<br>

<a name="Property.getNumber"></a>
<b>Property.getNumber(key)</b><br>
<a name="Property.getValue"></a>
<b>Property.getValue(key)</b><br>
Returns the image property associated with <i>key</i>,
as a number, or returns NaN if <i>key</i> is not found
or the property cannot be converted into a number.
Requires 1.53b.
Requires 1.53n.
<br>

<a name="Property.getNumber"></a>
<b>Property.getNumber(key)</b><br>
Alias for Property.getValue(key).
<br>

<a name="Property.set"></a>
Expand Down Expand Up @@ -5483,7 +5488,7 @@ <h1>Built-in Macro Functions</h1>

<p class=navbar> <a href="#Top">top</a> | <a href="https://imagej.net/ij/index.html">home</a></p>

<small>Last updated 2025-01-18</small>
<small>Last updated 2025-02-15</small>

</body>
</html>
2 changes: 1 addition & 1 deletion ij/ImageJ.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
20 changes: 10 additions & 10 deletions ij/gui/HistogramPlot.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions ij/gui/HistogramWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ij/macro/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion ij/process/StackStatistics.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion release-notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<body>


<li> <u>1.54n7 02 February 2025</u>
<li> <u>1.54n 17 February 2025</u>
<ul>
<li> Thanks to Christophe Leterrier, fixed bugs with how
the <i>Image&gt;Stacks&gt;Tools&gt;Combine</i> and
Expand Down

0 comments on commit d05f254

Please sign in to comment.