From c90f4774a658223e1ccd3ea6c578fb98312a1d3b Mon Sep 17 00:00:00 2001 From: Wayne Rasband Date: Fri, 26 Apr 2013 20:54:06 -0400 Subject: [PATCH] 2013.04.26 (1.47o) --- ij/ImageJ.java | 2 +- ij/macro/Functions.java | 2 +- ij/measure/ResultsTable.java | 31 ++++++++++++++++--------------- ij/plugin/filter/Analyzer.java | 4 ++++ release-notes.html | 27 ++++++++++++++------------- 5 files changed, 36 insertions(+), 30 deletions(-) diff --git a/ij/ImageJ.java b/ij/ImageJ.java index 069efbcc4..a9331386d 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.47o"; - public static final String BUILD = "6"; + public static final String BUILD = ""; public static Color backgroundColor = new Color(220,220,220); //224,226,235 /** SansSerif, 12-point, plain font. */ public static final Font SansSerif12 = new Font("SansSerif", Font.PLAIN, 12); diff --git a/ij/macro/Functions.java b/ij/macro/Functions.java index dcfafc816..bc29bbfde 100644 --- a/ij/macro/Functions.java +++ b/ij/macro/Functions.java @@ -1146,7 +1146,7 @@ void setResult() { if (isLabel) rt.setLabel(stringValue, row); else - rt.setStringValue(column, row, stringValue); + rt.setValue(column, row, stringValue); } else rt.setValue(column, row, value); resultsPending = true; diff --git a/ij/measure/ResultsTable.java b/ij/measure/ResultsTable.java index d3ee2a198..eb81460ee 100644 --- a/ij/measure/ResultsTable.java +++ b/ij/measure/ResultsTable.java @@ -57,8 +57,13 @@ public class ResultsTable implements Cloneable { private Hashtable stringColumns; - /** Constructs an empty ResultsTable with the counter=0 and no columns. */ + /** Constructs an empty ResultsTable with the counter=0, no columns + and the precision set to 3 or the "Decimal places" value in + Analyze/Set Measurements if that value is higher than 3. */ public ResultsTable() { + int p = Analyzer.getPrecision(); + if (p>precision) + setPrecision(p); } /** Returns the ResultsTable used by the Measure command. This @@ -152,14 +157,14 @@ public void addValue(String column, double value) { /** Adds a string value to the end of the given column. If the column does not exist, it is created. Counter must be >0. */ - public void addStringValue(String column, String value) { + public void addValue(String column, String value) { if (column==null) throw new IllegalArgumentException("Column is null"); int index = getColumnIndex(column); if (index==COLUMN_NOT_FOUND) index = getFreeColumn(column); addValue(index, Double.NaN); - setStringValue(column, getCounter()-1, value); + setValue(column, getCounter()-1, value); keep[index] = true; } @@ -417,18 +422,18 @@ public void setValue(int column, int row, double value) { not exist, it is created. When adding columns, show() must be called to update the window that displays the table.*/ - public void setStringValue(String column, int row, String value) { + public void setValue(String column, int row, String value) { if (column==null) throw new IllegalArgumentException("Column is null"); int col = getColumnIndex(column); if (col==COLUMN_NOT_FOUND) col = getFreeColumn(column); - setStringValue(col, row, value); + setValue(col, row, value); } /** Sets the string value of the given column and row, where where 0<=column<=(lastRow+1 and 0<=row<=counter. */ - public void setStringValue(int column, int row, String value) { + public void setValue(int column, int row, String value) { setValue(column, row, Double.NaN); if (stringColumns==null) stringColumns = new Hashtable(); @@ -570,9 +575,10 @@ public void setDefaultHeadings() { headings[i] = defaultHeadings[i]; } - /** Sets the number of digits to the right of decimal point. */ - public void setPrecision(int precision) { - this.precision = precision; + /** Sets the decimal places (digits to the right of decimal point) + that are used when this table is displayed. */ + public void setPrecision(int decimalPlaces) { + this.precision = decimalPlaces; } public void showRowNumbers(boolean showNumbers) { @@ -870,17 +876,12 @@ public static ResultsTable open(String path) throws IOException { else if (j3) - rt.setPrecision(p); - } return rt; } diff --git a/ij/plugin/filter/Analyzer.java b/ij/plugin/filter/Analyzer.java index c44dd2680..366c353af 100644 --- a/ij/plugin/filter/Analyzer.java +++ b/ij/plugin/filter/Analyzer.java @@ -65,6 +65,9 @@ public Analyzer(ImagePlus imp) { public Analyzer(ImagePlus imp, int measurements, ResultsTable rt) { this.imp = imp; this.measurements = measurements; + if (rt!=null) + rt = new ResultsTable(); + rt.setPrecision((systemMeasurements&SCIENTIFIC_NOTATION)!=0?-precision:precision); this.rt = rt; } @@ -881,6 +884,7 @@ public static void setResultsTable(ResultsTable rt) { tp.clear(); if (rt==null) rt = new ResultsTable(); + rt.setPrecision((systemMeasurements&SCIENTIFIC_NOTATION)!=0?-precision:precision); systemRT = rt; summarized = false; umeans = null; diff --git a/release-notes.html b/release-notes.html index 88dd2182f..bf62bb45c 100644 --- a/release-notes.html +++ b/release-notes.html @@ -6,43 +6,44 @@
  • 1.47o 26 April 2013 -
  • Results tables can now contain columns of string values. +
      +
    • Results tables can now contain columns of strings +(example).
    • Added the File>Import>Table command. -
    • Added a "Open images using Bio-Formats" option to the -Process>Batch>Convert dialog box. +
    • Added an "Open images using Bio-Formats" option to +Process>Batch>Convert.
    • Thanks to Norbert Vischer, File>Save As>PNG saves 4-image 8-bit stacks or hyperstacks as PNG with alpha if the label of the fourth image is "Alpha".
    • Thanks to Wilhelm Burger, added the ImagePlus.setAntialiasRendering(boolean) method, -which enable/disable use of antialiasing by the ImagePlus.flatten() method and the +which enables/disables use of antialiasing by the ImagePlus.flatten() method and the Image>Overlay>Flatten command.
    • Updated the ColorProcessor.getChannel() and ColorProcessor.setChannel() methods to support the alpha channel (example).
    • Updated the setResult() macro function to work with string values and -added the getResultString() function. -
    • Added the addStringValue(), getStringValue() and setStringValue() -methods to the ResultsTable class. +added the getResultString() function +(example). +
    • Updated the ResultsTable addValue() and setStringValue() methods to work +with string values and added the getStringValue() method +(example).
    • Added the IJ.getFilePath(dialogTitle) method.
    • Added the Opener.openUsingBioFormats(path) and Opener.openTable(path) methods.
    • Johannes Schindelin added missing close() calls that caused Eclipse's resource leak warnings.
    • Johannes Schindelin made the ImageJ source compatible with Java 1.5 again by removing an illegal @override annotation from SubHyperstackMaker.java.
    • Thanks to Tom Kazimiers, fixed a v1.47f regression that caused the saveAs("tif",path) macro -function to convert ".tif" extensions to ".tif". +function to convert ".tiff" extensions to ".tif".
    • Thanks to Curtis Rueden, fixed a bug the caused Image>Stacks>Make Montage to not work as expected with composite color images. -
    • Fixed a bug that caused Image>Stacks>3D Project to throw an exception -when working with 16 or 32 bit hyperstacks with the "Interpolate" option enabled.
    • Fixed a bug the caused Edit>Selection>Fit Spline to not work correctly with polygon selections.
    • Thanks to Philippe Carl, fixed a bug that sometimes caused the ImagePlus.setProcessor() method to not work as expected with stacks. -
    • Thanks to Fabrice Cordelieres, fixed a bug that sometimes caused the +
    • Thanks to Fabrice Cordelieres, fixed a bug that caused the Image>Stacks>3D Project command to throw an exception -when working with 16-bit stacks with the "Interpolate" option enabled. +when working with 16 or 32 bit stacks and the "Interpolate" option was enabled.
    • Thanks to Jan Eglinger, fixed a bug that caused the precision of imported results to always be set to 3 decimal places. -
    Home