diff --git a/ij/ImageJ.java b/ij/ImageJ.java index fda53279c..8cc241fa2 100644 --- a/ij/ImageJ.java +++ b/ij/ImageJ.java @@ -78,7 +78,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.52k"; - public static final String BUILD = "66"; + public static final String BUILD = "70"; 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/HistogramWindow.java b/ij/gui/HistogramWindow.java index 81ae10d11..37ea030be 100644 --- a/ij/gui/HistogramWindow.java +++ b/ij/gui/HistogramWindow.java @@ -96,12 +96,16 @@ public void showHistogram(ImagePlus imp, int bins) { the same as the image range expect for 32 bit images. */ public void showHistogram(ImagePlus imp, int bins, double histMin, double histMax) { boolean limitToThreshold = (Analyzer.getMeasurements()&LIMIT)!=0; + ImageProcessor ip = imp.getProcessor(); + if (ip.getMinThreshold()!=ImageProcessor.NO_THRESHOLD + && ip.getLutUpdateMode()==ImageProcessor.NO_LUT_UPDATE) + limitToThreshold = false; // ignore invisible thresholds if (imp.getBitDepth()==24 && rgbMode=209715200); + boolean showProgress = virtualStack || ((double)n*stack.getWidth()*stack.getHeight()>=209715200.0); for (int i=1; i<=n; i++) { if (showProgress) { IJ.showStatus("Duplicating: "+i+"/"+n); @@ -287,7 +287,7 @@ public ImagePlus run(ImagePlus imp, int firstSlice, int lastSlice) { double max = imp.getDisplayRangeMax(); ImageStack stack2 = null; int n = lastSlice-firstSlice+1; - boolean showProgress = virtualStack || (n*stack.getWidth()*stack.getHeight()>=209715200); + boolean showProgress = virtualStack || ((double)n*stack.getWidth()*stack.getHeight()>=209715200.0); for (int i=firstSlice; i<=lastSlice; i++) { if (showProgress) { IJ.showStatus("Duplicating: "+i+"/"+lastSlice); @@ -300,6 +300,7 @@ public ImagePlus run(ImagePlus imp, int firstSlice, int lastSlice) { stack2 = new ImageStack(ip2.getWidth(), ip2.getHeight(), imp.getProcessor().getColorModel()); stack2.addSlice(stack.getSliceLabel(i), ip2); } + IJ.showProgress(1.0); ImagePlus imp2 = imp.createImagePlus(); imp2.setStack("DUP_"+imp.getTitle(), stack2); String info = (String)imp.getProperty("Info"); diff --git a/ij/plugin/ImageInfo.java b/ij/plugin/ImageInfo.java index e23768426..6730222b2 100644 --- a/ij/plugin/ImageInfo.java +++ b/ij/plugin/ImageInfo.java @@ -271,7 +271,14 @@ private String getInfo(ImagePlus imp, ImageProcessor ip) { lower = cal.getCValue((int)lower); upper = cal.getCValue((int)upper); } - s += "Threshold: "+d2s(lower)+"-"+d2s(upper)+uncalibrated+"\n"; + int lutMode = ip.getLutUpdateMode(); + String mode = "red"; + switch (lutMode) { + case ImageProcessor.BLACK_AND_WHITE_LUT: mode="B&W"; break; + case ImageProcessor.NO_LUT_UPDATE: mode="invisible"; break; + case ImageProcessor.OVER_UNDER_LUT: mode="over/under"; break; + } + s += "Threshold: "+d2s(lower)+"-"+d2s(upper)+uncalibrated+" ("+mode+")\n"; } ImageCanvas ic = imp.getCanvas(); double mag = ic!=null?ic.getMagnification():1.0; diff --git a/ij/process/FloatProcessor.java b/ij/process/FloatProcessor.java index d93ec530c..a0e3235dd 100644 --- a/ij/process/FloatProcessor.java +++ b/ij/process/FloatProcessor.java @@ -178,22 +178,19 @@ public Image createImage() { // creates 8-bit image by linearly scaling from float to 8-bits private byte[] create8BitImage(boolean thresholding) { + //ij.IJ.log("create8BitImage: "+thresholding); int size = width*height; if (pixels8==null) pixels8 = new byte[size]; double value; int ivalue; double min2 = getMin(), max2=getMax(); - int maxValue = 255; - double scale = 256.0/(max2-min2); - if (thresholding) { - maxValue = 254; - scale = 255.0/(max2-min2); - } + double scale = 255.0/(max2-min2); + int maxValue = thresholding?254:255; for (int i=0; imaxValue) ivalue = maxValue; pixels8[i] = (byte)ivalue; } diff --git a/release-notes.html b/release-notes.html index f118b3400..cc7599332 100644 --- a/release-notes.html +++ b/release-notes.html @@ -5,7 +5,7 @@ -
  • 1.52k66 23 January 2019 +
  • 1.52k70 25 January 2019
    • Thanks to Albert Cardona and Gabriel Landini, added the "GUI scale (0.5-3.0)" option to the Edit>Options>Appearance dialog, which enables @@ -51,6 +51,10 @@
    • Thanks to 'Bio7', worked around a bug that caused toolbar popup menus to not work with OpenJDK 11 and OpenJDK 12 on Windows. +
    • Thanks to Ved Sharma, fixed a bug that caused the Histogram +command to not behave as expected when "Limit to Threshold" was +enabled in Analyze>Set Measurements and there +was an invisble threshold.
    • Thanks to J Xiong, fixed a 1.52j regression that caused the Image>Overlay>From ROI Manager command to throw an exception. @@ -60,6 +64,9 @@
    • Thanks to Stein Rorvik, fixed 1.52j regression that sometimes caused macro errors to be ignored (examples). +
    • Thanks to 'yorgodillo', 'mountain_man' and Jan Eglinger, fixed a +1.52e regression that caused float to 8-bit conversions to be +done incorrectly.
  • 1.52j 29 December 2018