Skip to content

Commit

Permalink
2013.04.26 (1.47o)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasband committed Apr 27, 2013
1 parent 270d038 commit c90f477
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 30 deletions.
2 changes: 1 addition & 1 deletion ij/ImageJ.java
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion ij/macro/Functions.java
Expand Up @@ -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;
Expand Down
31 changes: 16 additions & 15 deletions ij/measure/ResultsTable.java
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -417,18 +422,18 @@ public void setValue(int column, int row, double value) {
not exist, it is created. When adding columns,
<code>show()</code> 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&lt;=column&lt;=(lastRow+1 and 0&lt;=row&lt;=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();
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -870,17 +876,12 @@ public static ResultsTable open(String path) throws IOException {
else if (j<headings.length) {
double value = Tools.parseDouble(items[j]);
if (Double.isNaN(value))
rt.addStringValue(headings[j], items[j]);
rt.addValue(headings[j], items[j]);
else
rt.addValue(headings[j], value);
}
}
}
if (rt!=null) {
int p = Analyzer.getPrecision();
if (p>3)
rt.setPrecision(p);
}
return rt;
}

Expand Down
4 changes: 4 additions & 0 deletions ij/plugin/filter/Analyzer.java
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down
27 changes: 14 additions & 13 deletions release-notes.html
Expand Up @@ -6,43 +6,44 @@
<body>

<li> <u>1.47o 26 April 2013</u>
<li> Results tables can now contain columns of string values.
<ul>
<li> Results tables can now contain columns of strings
(<a href="http://imagej.nih.gov/ij/macros/examples/NonNumericResultsTable.txt">example</a>).
<li> Added the <i>File&gt;Import&gt;Table</i> command.
<li> Added a "Open images using Bio-Formats" option to the
<i>Process&gt;Batch&gt;Convert</i> dialog box.
<li> Added an "Open images using Bio-Formats" option to
<i>Process&gt;Batch&gt;Convert</i>.
<li> Thanks to Norbert Vischer, <i>File&gt;Save As&gt;PNG</i> saves 4-image
8-bit stacks or hyperstacks as PNG with alpha if the label of the fourth image is "Alpha".
<li> 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
<i>Image&gt;Overlay&gt;Flatten</i> command.
<li> Updated the ColorProcessor.getChannel() and ColorProcessor.setChannel()
methods to support the alpha channel
(<a href="http://imagej.nih.gov/ij/macros/bsh/Open_Modify_Save_Alpha_PNG.bsh">example</a>).
<li> Updated the setResult() macro function to work with string values and
added the getResultString() function.
<li> Added the addStringValue(), getStringValue() and setStringValue()
methods to the ResultsTable class.
added the getResultString() function
(<a href="http://imagej.nih.gov/ij/macros/examples/NonNumericResultsTable.txt">example</a>).
<li> Updated the ResultsTable addValue() and setStringValue() methods to work
with string values and added the getStringValue() method
(<a href="http://imagej.nih.gov/ij/macros/js/NonNumericResultsTable.js">example</a>).
<li> Added the IJ.getFilePath(dialogTitle) method.
<li> Added the Opener.openUsingBioFormats(path) and Opener.openTable(path) methods.
<li> Johannes Schindelin added missing close() calls that caused Eclipse's resource leak warnings.
<li> Johannes Schindelin made the ImageJ source compatible with Java 1.5 again by removing
an illegal @override annotation from SubHyperstackMaker.java.
<li> 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".
<li> Thanks to Curtis Rueden, fixed a bug the caused <i>Image&gt;Stacks&gt;Make Montage</i>
to not work as expected with composite color images.
<li> Fixed a bug that caused <i>Image&gt;Stacks&gt;3D Project</i> to throw an exception
when working with 16 or 32 bit hyperstacks with the "Interpolate" option enabled.
<li> Fixed a bug the caused <i>Edit&gtSelection&gt;Fit Spline</i> to not work
correctly with polygon selections.
<li> Thanks to Philippe Carl, fixed a bug that sometimes caused the
ImagePlus.setProcessor() method to not work as expected with stacks.
<li> Thanks to Fabrice Cordelieres, fixed a bug that sometimes caused the
<li> Thanks to Fabrice Cordelieres, fixed a bug that caused the
<I>Image&gtStacks&gt;3D Project</i> 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.
<li> Thanks to Jan Eglinger, fixed a bug that caused the precision of imported
results to always be set to 3 decimal places.

</ul>

<a href="http://imagej.nih.gov/ij">Home</a>
Expand Down

0 comments on commit c90f477

Please sign in to comment.