Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
Synchronize with ImageJ 1.50e
Browse files Browse the repository at this point in the history
  • Loading branch information
ImageJ Jenkins committed Nov 20, 2015
2 parents b915b2e + 197ba10 commit 40afa1d
Show file tree
Hide file tree
Showing 48 changed files with 593 additions and 238 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -8,13 +8,13 @@
<parent>
<groupId>net.imagej</groupId>
<artifactId>pom-imagej</artifactId>
<version>13.3.0</version>
<version>13.4.0</version>
<relativePath />
</parent>

<groupId>net.imagej</groupId>
<artifactId>ij</artifactId>
<version>1.50e-SNAPSHOT</version>
<version>1.50e</version>

<name>ImageJ</name>
<description>ImageJ is an open source Java image processing program inspired by NIH Image for the Macintosh.</description>
Expand Down
89 changes: 50 additions & 39 deletions release-notes.html
Expand Up @@ -5,46 +5,57 @@
</head>
<body>

<li> <u>1.50d 25 October 2015</u>
<li> <u>1.50e 19 November 2015</u>
<ul>
<li> Thanks to Peter Haub, added the <i>Selection Rotator</i> tool
to the Toolbar's "&gt;&gt;" menu. To move the selection, hold down
the alt or shift key.
<li> The <i>Edit&gt;Options&gt;Point Tool</i> dialog,
in multi-point mode, is now non-modal and has a "Counter"
drop down menu. As a shortcut, double click on the multi-point
tool icon to open this dialog.
<li> A point in a polygon, polyline or point selection can now be
deleted by either alt-clicking or control-clicking on it.
<li> The <i>File&gt;Import&gt;Raw</i> command now
uses "smart recording" (default options are not recorded).
<li> Added the <i>Help&gt;Examples&gt;Autorun</i> checkbox menu item.
<li> Thanks to Michael Schmid, the AVI Reader now opens most oversized (>4GB)
ImageJ AVI 1 files and the AVI Writer uses the AVI 2 format, which is AVI 1
compatible for files up to approx 0.9 GB in size. Use the
<a href="plugins/virtual-test-stack/index.html">Virtual Test Stack</a>
plugin to create multi-gigabyte test stacks.
<li> Thanks to Bill Christens-Barry, added the WaitForUserDialog.setNextLocation(x,y) method
(<a href="macros/examples/SetWaitForUserLocation">macro example</a>).
<li> Added the add(Roi,name) and remove(name) methods to the Overlay class.
<li> Added the ThresholdAdjuster.setMethod() method.
<li> Thanks to Kota Miura, worked around Java 8 bugs that caused cut, copy and paste
to not work in the curve fitter (<i>Analyze&gt;Tools&gt;Curve Fitting</i>).
<li> Thanks to Jan Eglinger, fixed a bug that caused the <i>Image&gt;Scale</i>
command to ignore the "z=" option when run from a macro.
<li> Thanks to Stein Rorvik, fixed a bug that caused calibration bars
(<i>Analyze&gt;Tools&gt;Calibration Bar</i>) to remove existing overlays.
<li> Fixed a bug that caused the <i>Process&gt;Math&gt;Macro</i>
command to not work correctly with 16-bit and 32-bit images if the
macro code called the getPixel() function.
<li> Fixed a bug that caused the <i>Rotate 90 Degrees Right</i> and
<i>Rotate 90 Degrees Left</i> commands to not correctly handle
non-zero origins.
<li> Fixed a bug that caused polygon and polyline selections to lose properties
like stroke color and stroke width after deleting one of the selection's
points by alt-clicking on it.
<li> Thanks to Vytas Bindokas, fixed a bug that caused the waitForUser() macro
function to fail on Windows.
<li> On Macs, thanks to Curtis Rueden and Brandon Hurr, the <i>Stack to Images</i>,
<i>Window&gt;Tile</i> and <i>Window&gt;Cascade</i> commands, and non-batch mode
macros that process multiple images, run faster
(<a href="macros/SetMenuBarBenchmark.txt">test macro</a>).
<li> Pressing "i" (<i>Image&gt;Show Info</i>) when no images are open now
displays useful information.
<li> Thanks to Peter Haub, the <i>Selection Rotator</i> tool, available in
the toolbar's "&gt;&gt;" menu, now rotates about the selection centroid and is recordable.
<li> Thanks to Radoslaw Ejsmont, ImageJ's directory chooser, on Mac OS X, now uses the
JFileChooser when the "Use JFileChoose to open/save" option is enabled in
<i>Edit&gt;Options&gt;Input/Output</i>. Unlike the native directory chooser,
JFileChooser still has a title bar on OS X 10.11 (El Capitan).
<li> Thanks to Anton Jormescu and John Wolodzko, you can again change the views in
<i>Image&gt;Stacks&gt;Orthoganal Views</i> by clicking, but not
dragging, in the XZ and YZ planes.
<li> Added a "Show all" checkbox and a "Help" button to the multi-point
tool options dialog box.
<li> Thanks to John Wolodzko, added the Plot.showValues macro function,
which displays plot window values in the Results table.
<li> Thanks to Peter Haub, added the Roi.getCentroid() method.
<li> Thanks to Jan Eglinger, fixed a bug that caused <i>Image&gt;Adjust&gt;Size</i>,
when using bilinear or bicubic interpolation, to shift positions of pixels by 1.0 in X,
0.5 in Y and 0.5 in Z.
<li> Thanks to Michael Schmid, fixed a bug that caused the
<i>Brightness/Contrast</i> adjuster's "Apply" function to not be
undoable for full images or rectangular selections with 8-bit and 16-bit images.
<li> Thanks to Michael Schmid, fixed a bug that caused the
<i>Brightness/Contrast</i> adjuster to hang with RGB images
when there was a non-rectangular selection extending beyond image boundary.
<li> Thanks to Bob Hamilton, fixed bugs that caused the <i>Run to Insertion Point</i>
macro debugger command to fail and the debugger to sometimes behave erratically.
<li> Thanks to David Gault, fixed a potential memory leak by adding a close()
method to the CompositeImage class.
<li> Thanks to Jan Eglinger, fixed a bug with the "d" (<i>Draw</i>) keyboard shortcut
that caused it to not be correctly recorded.
<li> Thanks to Anton Jormescu, fixed a bug in the
<i>Image&gt;Stack&gt;Tools&gt;Grouped Z Project</i> command
that changed the Z and T dimensions of the original stack, which caused
the <i>Duplicate</i> and <i>Synchronize Windows</i> commands to not
work as expected.
<li> Thanks to Carl Vandewater, fixed a bug that could cause
<i>Image&gt;Color&gt;Merge Channels</i> to throw an exception
when an input file name was shorter than three characters.
<li> Thanks to Till Bretschneider, fixed a bug on OS X and Java 8 that
caused copying of text from the macro recorder to fail.
<li> Thanks to Saibal Mitra, fixed a v1.50d regression that caused the
<i>Process&gt;Math&gt;Macro</i> command to not work correctly with 32-bit images.
<li> Thanks to Michael Schmid, fixed a v1.49 regression that caused NaN values to
not be correctly handled in plots.

</ul>

Expand Down
26 changes: 26 additions & 0 deletions src/main/java/ij/CompositeImage.java
Expand Up @@ -620,6 +620,32 @@ public boolean hasCustomLuts() {
return customLuts && mode!=GRAYSCALE;
}

public void close() {
super.close();
rgbPixels = null;
imageSource = null;
awtImage = null;
rgbRaster = null;
rgbSampleModel = null;
rgbImage = null;
rgbCM = null;
if (cip!=null) {
for (int i=0; i<cip.length; i++)
cip[i] = null;
cip = null;
}
if (lut!=null) {
for (int i=0; i<lut.length; i++)
lut[i] = null;
lut = null;
}
if (channelLuts!=null) {
for (int i=0; i<channelLuts.length; i++)
channelLuts[i] = null;
channelLuts = null;
}
}

/** Deprecated */
public synchronized void setChannelsUpdated() {
if (cip!=null) {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/ij/Executer.java
Expand Up @@ -100,6 +100,10 @@ else if (e instanceof RuntimeException && msg!=null && msg.equals(Macro.MACRO_CA
s = e + "\n \nThis plugin requires Java 1.7 or later.";
w=700; h=150;
}
if (s.indexOf("version 52.0")!=-1) {
s = e + "\n \nThis plugin requires Java 1.8 or later.";
w=700; h=150;
}
}
if (IJ.getInstance()!=null) {
s = IJ.getInstance().getInfo()+"\n \n"+s;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ij/ImageJ.java
Expand Up @@ -79,7 +79,7 @@ public class ImageJ extends Frame implements ActionListener,
MouseListener, KeyListener, WindowListener, ItemListener, Runnable {

/** Plugins should call IJ.getVersion() or IJ.getFullVersion() to get the version string. */
public static final String VERSION = "1.50d";
public static final String VERSION = "1.50e";
public static final String BUILD = "";
public static Color backgroundColor = new Color(237,237,237);
/** SansSerif, 12-point, plain font. */
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/ij/ImagePlus.java
Expand Up @@ -90,6 +90,7 @@ public class ImagePlus implements ImageObserver, Measurements, Cloneable {
private static int default16bitDisplayRange;
private boolean antialiasRendering = true;
private boolean ignoreGlobalCalibration;
public boolean setIJMenuBar = true;


/** Constructs an uninitialized ImagePlus. */
Expand Down Expand Up @@ -2662,4 +2663,12 @@ public String toString() {
return "img["+getTitle()+" ("+width+"x"+height+"x"+getNChannels()+"x"+getNSlices()+"x"+getNFrames()+")]";
}

public void setIJMenuBar(boolean b) {
setIJMenuBar = b;
}

public boolean setIJMenuBar() {
return setIJMenuBar;
}

}
3 changes: 3 additions & 0 deletions src/main/java/ij/Menus.java
Expand Up @@ -4,6 +4,7 @@
import ij.gui.ImageWindow;
import ij.plugin.MacroInstaller;
import ij.gui.Toolbar;
import ij.macro.Interpreter;
import java.awt.*;
import java.awt.image.*;
import java.awt.event.*;
Expand Down Expand Up @@ -267,6 +268,7 @@ public static Menu getExamplesMenu(ActionListener listener) {
addExample(submenu, "Semi-log Plot", "Semi-log_Plot.ijm");
addExample(submenu, "Arrow Plot", "Arrow_Plot.ijm");
addExample(submenu, "Process Folder", "Batch_Process_Folder.ijm");
addExample(submenu, "OpenDialog Demo", "OpenDialog_Demo.ijm");
addExample(submenu, "Sine/Cosine Table", "Sine_Cosine_Table.ijm");
addExample(submenu, "Non-numeric Table", "Non-numeric_Table.ijm");
addExample(submenu, "Overlay", "Overlay.ijm");
Expand Down Expand Up @@ -1612,4 +1614,5 @@ public static void updateImageJMenus() {
IJ.runPlugIn("ij.plugin.ClassChecker", "");
IJ.showStatus("Menus updated: "+m.nPlugins + " commands, " + m.nMacros + " macros");
}

}
7 changes: 5 additions & 2 deletions src/main/java/ij/Prefs.java
Expand Up @@ -54,7 +54,7 @@ public class Prefs {

private static final int USE_SYSTEM_PROXIES=1<<0, USE_FILE_CHOOSER=1<<1,
SUBPIXEL_RESOLUTION=1<<2, ENHANCED_LINE_TOOL=1<<3, SKIP_RAW_DIALOG=1<<4,
REVERSE_NEXT_PREVIOUS_ORDER=1<<5, AUTO_RUN_EXAMPLES=1<<6;
REVERSE_NEXT_PREVIOUS_ORDER=1<<5, AUTO_RUN_EXAMPLES=1<<6, SHOW_ALL_POINTS=1<<7;
public static final String OPTIONS2 = "prefs.options2";

/** file.separator system property */
Expand Down Expand Up @@ -155,6 +155,8 @@ public class Prefs {
public static boolean reverseNextPreviousOrder;
/** Automatically run examples in Help/Examples menu. */
public static boolean autoRunExamples = true;
/** Ignore stack positions when displaying points. */
public static boolean showAllPoints;


static Properties ijPrefs = new Properties();
Expand Down Expand Up @@ -464,6 +466,7 @@ static void loadOptions() {
skipRawDialog = (options2&SKIP_RAW_DIALOG)!=0;
reverseNextPreviousOrder = (options2&REVERSE_NEXT_PREVIOUS_ORDER)!=0;
autoRunExamples = (options2&AUTO_RUN_EXAMPLES)!=0;
showAllPoints = (options2&SHOW_ALL_POINTS)!=0;
}

static void saveOptions(Properties prefs) {
Expand All @@ -489,7 +492,7 @@ static void saveOptions(Properties prefs) {
+ (useFileChooser?USE_FILE_CHOOSER:0) + (subPixelResolution?SUBPIXEL_RESOLUTION:0)
+ (enhancedLineTool?ENHANCED_LINE_TOOL:0) + (skipRawDialog?SKIP_RAW_DIALOG:0)
+ (reverseNextPreviousOrder?REVERSE_NEXT_PREVIOUS_ORDER:0)
+ (autoRunExamples?AUTO_RUN_EXAMPLES:0);
+ (autoRunExamples?AUTO_RUN_EXAMPLES:0) + (showAllPoints?SHOW_ALL_POINTS:0);
prefs.put(OPTIONS2, Integer.toString(options2));
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/ij/Undo.java
Expand Up @@ -37,7 +37,7 @@ public static void setup(int what, ImagePlus imp) {
reset();
return;
}
//IJ.log(imp.getTitle() + ": set up undo (" + what + ")");
if (IJ.debugMode) IJ.log("Undo.setup: "+what+" "+imp);
if (what==FILTER && whatToUndo==COMPOUND_FILTER)
return;
if (what==COMPOUND_FILTER_DONE) {
Expand Down Expand Up @@ -91,13 +91,13 @@ public static void reset() {
calCopy = null;
roiCopy = null;
lutCopy = null;
//IJ.log("Undo: reset");
if (IJ.debugMode) IJ.log("Undo.reset");
}


public static void undo() {
ImagePlus imp = WindowManager.getCurrentImage();
//IJ.log(imp.getTitle() + ": undo (" + whatToUndo + ") "+(imageID!=imp.getID()));
if (IJ.debugMode) IJ.log("Undo.undo: "+ whatToUndo+" "+imp+" "+imageID);
if (imp==null || imageID!=imp.getID()) {
if (imp!=null && !IJ.macroRunning()) { // does image still have an undo buffer?
ImageProcessor ip2 = imp.getProcessor();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/ij/WindowManager.java
Expand Up @@ -2,10 +2,10 @@
import ij.plugin.Converter;
import ij.plugin.frame.Recorder;
import ij.plugin.frame.Editor;
import ij.macro.Interpreter;
import ij.text.TextWindow;
import ij.plugin.frame.PlugInFrame;
import ij.util.Tools;
import ij.macro.Interpreter;
import java.awt.*;
import java.util.*;
import ij.gui.*;
Expand Down Expand Up @@ -570,5 +570,5 @@ public static void toFront(Frame frame) {
frame.setState(Frame.NORMAL);
frame.toFront();
}

}
3 changes: 1 addition & 2 deletions src/main/java/ij/gui/ImageCanvas.java
Expand Up @@ -1073,7 +1073,6 @@ private void setBackgroundColor(Color c) {
}

public void mousePressed(MouseEvent e) {
//if (ij==null) return;
showCursorStatus = true;
int toolID = Toolbar.getToolId();
ImageWindow win = imp.getWindow();
Expand Down Expand Up @@ -1290,7 +1289,7 @@ protected void handleRoiMouseDown(MouseEvent e) {
boolean multiPointMode = roi!=null && (roi instanceof PointRoi) && handle==-1
&& Toolbar.getToolId()==Toolbar.POINT && Toolbar.getMultiPointMode();
if (multiPointMode) {
((PointRoi)roi).addPoint(offScreenXD(sx), offScreenYD(sy));
((PointRoi)roi).addPoint(imp, offScreenXD(sx), offScreenYD(sy));
imp.setRoi(roi);
return;
}
Expand Down
32 changes: 24 additions & 8 deletions src/main/java/ij/gui/ImageWindow.java
Expand Up @@ -8,6 +8,7 @@
import ij.io.*;
import ij.measure.*;
import ij.plugin.frame.*;
import ij.plugin.PointToolOptions;
import ij.macro.Interpreter;
import ij.util.*;

Expand Down Expand Up @@ -546,17 +547,20 @@ public void focusGained(FocusEvent e) {

public void windowActivated(WindowEvent e) {
if (IJ.debugMode) IJ.log("windowActivated: "+imp.getTitle());
if (IJ.isMacOSX())
setImageJMenuBar(this);
if (imp==null)
return;
ImageJ ij = IJ.getInstance();
boolean quitting = ij!=null && ij.quitting();
if (IJ.isMacintosh() && ij!=null && !quitting) {
IJ.wait(10); // may be needed for Java 1.4 on OS X
setMenuBar(Menus.getMenuBar());
}
if (imp==null) return;
if (!closed && !quitting && !Interpreter.isBatchMode())
if (!closed && !ij.quitting() && !Interpreter.isBatchMode())
WindowManager.setCurrentWindow(this);
if (imp.isComposite())
Channels.updateChannels();
Roi roi = imp.getRoi();
if (roi!=null && (roi instanceof PointRoi))
PointToolOptions.update();
if (imp.isComposite())
Channels.updateChannels();
imp.setActivated(); // notify ImagePlus that image has been activated
}

Expand Down Expand Up @@ -683,7 +687,19 @@ public void setSliderHeight(int height) {
public int getSliderHeight() {
return sliderHeight;
}


public static void setImageJMenuBar(ImageWindow win) {
ImageJ ij = IJ.getInstance();
boolean setMenuBar = true;
ImagePlus imp = win.getImagePlus();
if (imp!=null)
setMenuBar = imp.setIJMenuBar();
if (ij!=null && !ij.quitting() && !Interpreter.nonBatchMacroRunning() && setMenuBar) {
IJ.wait(10); // may be needed for Java 1.4 on OS X
win.setMenuBar(Menus.getMenuBar());
}
if (imp!=null) imp.setIJMenuBar(true);
}

} //class ImageWindow

2 changes: 1 addition & 1 deletion src/main/java/ij/gui/Plot.java
Expand Up @@ -2094,7 +2094,7 @@ void drawFloatPolyline(ImageProcessor ip, float[] x, float[] y, int n) {
x2 = scaleX(x[i]);
y2 = scaleY(y[i]);
isNaN2 = Float.isNaN(x[i]) || Float.isNaN(y[i]) || (logXAxis && x[i]<=0) || (logYAxis && y[i]<=0);
if (!isNaN1 && !isNaN1)
if (!isNaN1 && !isNaN2)
ip.drawLine(x1, y1, x2, y2);
}
}
Expand Down

0 comments on commit 40afa1d

Please sign in to comment.