Skip to content
Permalink
Browse files

• 1.51q 18 September 2017

      □ Plot enhancements, thanks to Michael Schmid:
          ☆ Plots saved as tiff or zip include the data, so the plot
            range can be modified (zooming, etc.) and the data can be
            listed after loading the plot from a file.
          ☆ Changing the axis or label font size of a plot keeps the
            image size constant and modifies the plot frame size
            (previously, the plot frame size was constant).
          ☆ Slightly more space for numbers at the left, enough for
            scientific notation. ImageJ switches to a smaller font if
            more significant digits are required.
          ☆ Added Plot.getFrameBounds(x, y, width, height) macro
            function.
          ☆ The default font for plots is now Arial, not Helvetica
            (Arial is available on more platforms).
          ☆ When opening a plot on a computer where a given font is not
            available, try to replace fonts by similar ones. This
            should make the appearance on different platforms more
            similar.
          ☆ The ImageProcessor getStringWidth() and getStringBounds()
            methods use the more accurate GlyphVector class.
      □ Thanks to Norbert Vischer, the Edit>Selection>Straighten and
        Image>Duplicate commands work with rotated rectangle
        selections.
      □ Thanks to Jerome Parent, added the Image>Stacks>Plot XY Profile
        command.
      □ Thanks to Jerome Parent, added a "Show unit" checkbox to the
        Analyze>Tools>Calibration Bar dialog box.
      □ Thanks to Stein Rorvik, newly opened editor windows are larger
        and, on Linux and Windows, are less likely to cover the main
        ImageJ window.
      □ Thanks to Norbert Vischer, added a "Smooth if thresholded"
        option to the Wand tool dialog (example).
      □ Thanks to Kenneth Sloan, added a recordable ZProjector.run()
        method (examples).
      □ Thanks to Norbert Vischer, added the makeRotatedRectangle
        (x1,y1,x2,y2,width) macro function.
      □ Thanks to Norbert Vischer, added the List.toArrays
        (keys,values), List.fromArrays(keys,values) and List.indexOf
        (key) macro functions.
      □ Thanks to Max Leiter, fixed a bug that caused RoiListeners to
        not be notified when an ROI was created.
      □ Thanks to Alvaro Folgado, fixed an OS X command injection
        vulnerability in the BrowserLauncher.
      □ Thanks to Alison Walter, fixed a bug that caused the "Spline
        fit" checkbox in the "Line Width" dialog to convert angle
        selections to polygons.
      □ Thanks to Chris Lamb, fixed a typo in MemoryMonitor.java where
        a constant that should have been 1024 was 1204.
      □ Thanks to Norbert Vischer, fixed a bug in the Array.resample()
        macro function that caused it to throw an exception if the
        langth of the input was 0 or 1.
      □ Thanks to John Loveland and Lukas Kvasnica, fixed a v1.51o
        regression that caused plugins that create virtual stacks
        without implementing the VirtualStack class to throw an
        exception.
      □ Thanks to Tim Huang, fixed a bug that caused the Image>Overlay>
        Flatten command to not work correctly with high-resolution
        images.
      □ Thanks to Norbert Vischer, fixed a bug with the Debug>Abort
        command in the macro editor that caused it to display a bogus
        error message.
      □ Thanks to Stefan Helfrich and Azman Rashid, fixed a bug that
        caused ImageJ to not correctly read TIFF files created by the
        Bfconvert command line tool.
      □ Thanks to Jan Eglinger, fixed a bug that caused the popup menu
        (e.g. right-click > Rename...) and the "Dev" menu tool to not
        get recorded.
      □ Thanks to Sethur, fixed a bug that caused scroll wheel zooming
        in image stacks (enabled using control or shift key) to not
        work correctly.
      □ Thanks to Steffen Schmidt, fixed a bug that caused scale bars
        to not be correctly positioned with large font sizes.
      □ Thanks to Vanessa King and Jan Eglinger, fixed a bug that
        caused the "List" option in plot windows to sometimes not list
        all X columns when the columns differed in length.
      □ Thanks to Carne Draug, fixed several problems related to
        building the ImageJ Debian package.
      □ Thanks to Salim Kanoun, fixed a bug that caused overlay titles
        to be selectable when a new ROI was being constructed.
      □ Thanks to Norbert Vischer, fixed a bug than caused the Analyze>
        Gels>Select Next Lane command to sometimes create duplicate
        plots.
      □ Thanks to Michael Kaul, fixed a v1.51o regression that caused
        the ImagePlus.flatten() method to be much slower.
      □ Fixed a 1.51e regression that caused the "Auto" buttion in the
        Brightness/Contrast dialog to not increase contrast with
        repeated clicks.
  • Loading branch information
Wayne Rasband Jenkins
Wayne Rasband authored and Jenkins committed Sep 21, 2017
1 parent a493fd0 commit 70d7c8bf86b1078ce50c4267a47a0b524803c0da
Showing with 2,199 additions and 1,075 deletions.
  1. BIN .FBCIndex
  2. +4 −3 IJ_Props.txt
  3. +3 −4 build.xml
  4. +24 −8 ij/IJ.java
  5. +1 −1 ij/ImageJ.java
  6. +44 −9 ij/ImagePlus.java
  7. +2 −0 ij/Prefs.java
  8. +3 −1 ij/gui/ImageCanvas.java
  9. +2 −0 ij/gui/ImageWindow.java
  10. +763 −443 ij/gui/Plot.java
  11. +5 −5 ij/gui/PlotCanvas.java
  12. +26 −12 ij/gui/PlotDialog.java
  13. +129 −108 ij/gui/PlotWindow.java
  14. +16 −14 ij/gui/PointRoi.java
  15. +2 −2 ij/gui/ProfilePlot.java
  16. +17 −5 ij/gui/Roi.java
  17. +15 −3 ij/gui/RotatedRectRoi.java
  18. +0 −1 ij/gui/ShapeRoi.java
  19. +5 −4 ij/gui/StackWindow.java
  20. +50 −24 ij/gui/Toolbar.java
  21. +9 −7 ij/gui/Wand.java
  22. +3 −2 ij/io/FileInfo.java
  23. +4 −0 ij/io/FileOpener.java
  24. +12 −0 ij/io/FileSaver.java
  25. +1 −1 ij/io/RoiDecoder.java
  26. +15 −5 ij/io/TiffDecoder.java
  27. +14 −0 ij/io/TiffEncoder.java
  28. +331 −246 ij/macro/Functions.java
  29. +3 −2 ij/macro/Interpreter.java
  30. +3 −3 ij/macro/MacroConstants.java
  31. +1 −1 ij/measure/ResultsTable.java
  32. +2 −10 ij/plugin/BrowserLauncher.java
  33. +14 −8 ij/plugin/CalibrationBar.java
  34. +111 −14 ij/plugin/Duplicator.java
  35. +8 −4 ij/plugin/FFT.java
  36. +5 −2 ij/plugin/GelAnalyzer.java
  37. +1 −1 ij/plugin/MacroInstaller.java
  38. +2 −2 ij/plugin/NewPlugin.java
  39. +2 −0 ij/plugin/RGBStackConverter.java
  40. +18 −8 ij/plugin/ScaleBar.java
  41. +1 −1 ij/plugin/Selection.java
  42. +93 −0 ij/plugin/StackPlotter.java
  43. +7 −7 ij/plugin/Straightener.java
  44. +7 −5 ij/plugin/WandToolOptions.java
  45. +108 −33 ij/plugin/ZProjector.java
  46. +0 −5 ij/plugin/frame/ContrastAdjuster.java
  47. +4 −5 ij/plugin/frame/Editor.java
  48. +5 −5 ij/plugin/frame/LineWidthAdjuster.java
  49. +1 −1 ij/plugin/frame/MemoryMonitor.java
  50. +2 −2 ij/plugin/frame/PlugInDialog.java
  51. +5 −1 ij/plugin/frame/Recorder.java
  52. +0 −1 ij/process/AutoThresholder.java
  53. +1 −1 ij/process/FHT.java
  54. +5 −2 ij/process/FloatProcessor.java
  55. +53 −26 ij/process/ImageProcessor.java
  56. +56 −0 ij/util/FontUtil.java
  57. +104 −0 macros/SmoothWandTool.txt
  58. +77 −17 release-notes.html
BIN -612 KB .FBCIndex
Binary file not shown.
@@ -153,9 +153,10 @@ stacks10="Reslice [/]...",ij.plugin.Slicer
stacks11="Orthogonal Views[H]",ij.plugin.Orthogonal_Views
stacks12="Z Project...",ij.plugin.ZProjector
stacks13="3D Project...",ij.plugin.Projector
stacks14="Plot Z-axis Profile",ij.plugin.ZAxisProfiler
stacks15="Label...",ij.plugin.filter.StackLabeler
stacks16="Statistics",ij.plugin.Stack_Statistics
stacks14="Plot XY Profile",ij.plugin.StackPlotter
stacks15="Plot Z-axis Profile",ij.plugin.ZAxisProfiler
stacks16="Label...",ij.plugin.filter.StackLabeler
stacks17="Statistics",ij.plugin.Stack_Statistics

# Plugins installed in the Image/Stacks/Animation submenu
animation_01="Start Animation [\\]",ij.plugin.Animator("start")
@@ -6,10 +6,7 @@
<!-- First, ensure the build directory exists. -->
<mkdir dir="build" />
<!-- Build everything; add debug="on" to debug -->
<javac srcdir="." destdir="build" optimize="on" source="1.5" target="1.5" debug="on" includeantruntime="false">
<!-- The plugins directory only needs to be
present at runtime, not at build time. -->
<exclude name="plugins/**"/>
<javac srcdir="./ij" destdir="build" optimize="on" source="1.5" target="1.5" debug="on" includeantruntime="false" encoding="utf-8">
</javac>
</target>

@@ -50,6 +47,7 @@
<zip zipfile="../src.zip"
basedir=".."
includes="source/**"
excludes="source/.gdb_history source/.FBCIndex source/.FBCLockFolder/**"
/>
</target>

@@ -59,6 +57,7 @@
<mkdir dir="../api" />
<javadoc
sourcepath="."
encoding="utf-8"
packagenames="ij.*"
destdir="../api"
author="true"
@@ -9,6 +9,7 @@
import ij.plugin.frame.Recorder;
import ij.plugin.frame.ThresholdAdjuster;
import ij.macro.Interpreter;
import ij.macro.MacroRunner;
import ij.measure.Calibration;
import ij.measure.ResultsTable;
import ij.measure.Measurements;
@@ -67,6 +68,7 @@
private static DecimalFormat[] sf;
private static DecimalFormatSymbols dfs;
private static boolean trustManagerCreated;
private static String smoothMacro;

static {
osname = System.getProperty("os.name");
@@ -1451,34 +1453,48 @@ public static int doWand(int x, int y) {
public static int doWand(int x, int y, double tolerance, String mode) {
return doWand(getImage(), x, y, tolerance, mode);
}

/** This version of doWand adds an ImagePlus argument. */
public static int doWand(ImagePlus img, int x, int y, double tolerance, String mode) {
ImageProcessor ip = img.getProcessor();
if ((img.getType()==ImagePlus.GRAY32) && Double.isNaN(ip.getPixelValue(x,y)))
return 0;
int imode = Wand.LEGACY_MODE;
boolean smooth = false;
if (mode!=null) {
if (mode.startsWith("4"))
imode = Wand.FOUR_CONNECTED;
else if (mode.startsWith("8"))
imode = Wand.EIGHT_CONNECTED;
smooth = mode.contains("smooth");

}
Wand w = new Wand(ip);
double t1 = ip.getMinThreshold();
if (t1==ImageProcessor.NO_THRESHOLD || (ip.getLutUpdateMode()==ImageProcessor.NO_LUT_UPDATE&& tolerance>0.0))
if (t1==ImageProcessor.NO_THRESHOLD || (ip.getLutUpdateMode()==ImageProcessor.NO_LUT_UPDATE&& tolerance>0.0)) {
w.autoOutline(x, y, tolerance, imode);
else
smooth = false;
} else
w.autoOutline(x, y, t1, ip.getMaxThreshold(), imode);
if (w.npoints>0) {
Roi previousRoi = img.getRoi();
int type = Wand.allPoints()?Roi.FREEROI:Roi.TRACED_ROI;
Roi roi = new PolygonRoi(w.xpoints, w.ypoints, w.npoints, type);
Roi roi = new PolygonRoi(w.xpoints, w.ypoints, w.npoints, Roi.TRACED_ROI);
img.deleteRoi();
img.setRoi(roi);
// add/subtract this ROI to the previous one if the shift/alt key is down
img.setRoi(roi);
if (previousRoi!=null)
roi.update(shiftKeyDown(), altKeyDown());
roi.update(shiftKeyDown(), altKeyDown()); // add/subtract ROI to previous one if shift/alt key down
Roi roi2 = img.getRoi();
if (smooth && roi2!=null && roi2.getType()==Roi.TRACED_ROI) {
Rectangle bounds = roi2.getBounds();
if (bounds.width>1 && bounds.height>1) {
if (smoothMacro==null)
smoothMacro = BatchProcessor.openMacroFromJar("SmoothWandTool.txt");
if (EventQueue.isDispatchThread())
new MacroRunner(smoothMacro); // run on separate thread
else
IJ.runMacro(smoothMacro);
}
}
}
return w.npoints;
}
@@ -79,7 +79,7 @@ Runs a macro or script (JavaScript, BeanShell or Python) in
MouseListener, KeyListener, WindowListener, ItemListener, Runnable {

/** Plugins should call IJ.getVersion() or IJ.getFullVersion() to get the version string. */
public static final String VERSION = "1.51p";
public static final String VERSION = "1.51q";
public static final String BUILD = "";
public static Color backgroundColor = new Color(237,237,237);
/** SansSerif, 12-point, plain font. */
@@ -425,6 +425,8 @@ public void show(String statusMessage) {
//if (compositeImage) stackSize /= nChannels;
if (stackSize>1)
win = new StackWindow(this);
else if (getProperty(Plot.PROPERTY_KEY) != null)
win = new PlotWindow(this, (Plot)(getProperty(Plot.PROPERTY_KEY)));
else
win = new ImageWindow(this);
if (roi!=null) roi.setImage(this);
@@ -550,6 +552,9 @@ public void setImage(Image img) {
not work as expected if 'imp' is a CompositeImage
and this image is not. */
public void setImage(ImagePlus imp) {
Properties newProperties = imp.getProperties();
if (newProperties!=null)
newProperties = (Properties)(newProperties.clone());
if (imp.getWindow()!=null)
imp = imp.duplicate();
ImageStack stack2 = imp.getStack();
@@ -567,7 +572,12 @@ public void setImage(ImagePlus imp) {
updateAndDraw();
}
setCalibration(imp.getCalibration());
setProperty("Info", imp.getProperty("Info"));
properties = newProperties;
if (getProperty(Plot.PROPERTY_KEY)!=null && win instanceof PlotWindow) {
Plot plot = (Plot)(getProperty(Plot.PROPERTY_KEY));
((PlotWindow)win).setPlot(plot);
plot.setImagePlus(this);
}
}

/** Replaces the ImageProcessor with the one specified and updates the
@@ -601,9 +611,9 @@ void setProcessor2(String title, ImageProcessor ip, ImageStack newStack) {
if (title!=null) setTitle(title);
if (ip==null)
return;
this.ip = ip;
if (this.ip!=null && getWindow()!=null)
notifyListeners(UPDATED);
this.ip = ip;
if (ij!=null)
ip.setProgressBar(ij.getProgressBar());
int stackSize = 1;
@@ -1562,9 +1572,11 @@ public synchronized void setSlice(int n) {
overlay2 = ip2.getOverlay();
if (overlay2!=null)
setOverlay(overlay2);
Properties props = ((VirtualStack)stack).getProperties();
if (props!=null)
setProperty("FHT", props.get("FHT"));
if (stack instanceof VirtualStack) {
Properties props = ((VirtualStack)stack).getProperties();
if (props!=null)
setProperty("FHT", props.get("FHT"));
}
pixels = ip2.getPixels();
} else
pixels = stack.getPixels(currentSlice);
@@ -1649,7 +1661,7 @@ public void setRoi(Roi newRoi, boolean updateDisplay) {
roi.setImage(this);
if (updateDisplay)
draw();
//roi.notifyListeners(RoiListener.CREATED);
roi.notifyListeners(RoiListener.CREATED);
}

/** Creates a rectangular selection. */
@@ -1730,6 +1742,8 @@ public void createNewRoi(int sx, int sy) {
}
break;
}
if (roi!=null)
roi.notifyListeners(RoiListener.CREATED);
}

/** Deletes the current region of interest. Makes a copy of the ROI
@@ -2079,11 +2093,11 @@ public void copyScale(ImagePlus imp) {
setCalibration(imp.getCalibration());
}

/** Copies attributes (name, ID, calibration, path) of the specified image to this image. */
/** Copies attributes (name, ID, calibration, path, plot) of the specified image to this image. */
public void copyAttributes(ImagePlus imp) {
if (IJ.debugMode) IJ.log("copyAttributes: "+imp.getID()+" "+this.getID()+" "+imp+" "+this);
if (imp==null || imp.getWindow()!=null)
throw new IllegalArgumentException("Souce image is null or displayed");
throw new IllegalArgumentException("Source image is null or displayed");
ID = imp.getID();
setTitle(imp.getTitle());
setCalibration(imp.getCalibration());
@@ -2093,6 +2107,9 @@ public void copyAttributes(ImagePlus imp) {
Object info = imp.getProperty("Info");
if (info!=null)
setProperty("Info", imp.getProperty("Info"));
Object plot = imp.getProperty(Plot.PROPERTY_KEY);
if (plot != null)
setProperty(Plot.PROPERTY_KEY, plot);
}

/** Calls System.currentTimeMillis() to save the current
@@ -2493,7 +2510,6 @@ public void updatePosition(int c, int z, int t) {
/** Returns a "flattened" version of this image, in RGB format. */
public ImagePlus flatten() {
if (IJ.debugMode) IJ.log("flatten");
IJ.wait(50); // wait for screen to be refreshed
ImagePlus imp2 = createImagePlus();
imp2.setTitle(flattenTitle);
ImageCanvas ic2 = new ImageCanvas(imp2);
@@ -2511,6 +2527,7 @@ public ImagePlus flatten() {
Overlay overlay2 = getOverlay();
if (overlay2!=null && imp2.getRoi()!=null)
imp2.deleteRoi();
setPointScale(imp2.getRoi(), overlay2);
ic2.setOverlay(overlay2);
ImageCanvas ic = getCanvas();
if (ic!=null)
@@ -2617,6 +2634,24 @@ private void flattenImage(ImageStack stack, int slice, Overlay overlay, boolean
ImagePlus imp2 = imp1.flatten();
stack.setPixels(imp2.getProcessor().getPixels(), slice);
}

private void setPointScale(Roi roi2, Overlay overlay2) {
ImageCanvas ic = getCanvas();
if (ic==null)
return;
double scale = 1.0/ic.getMagnification();
if (scale==1.0)
return;
if (roi2!=null && (roi2 instanceof PointRoi))
roi2.setFlattenScale(scale);
if (overlay2!=null) {
for (int i=0; i<overlay2.size(); i++) {
roi2 = overlay2.get(i);
if (roi2!=null && (roi2 instanceof PointRoi))
roi2.setFlattenScale(scale);
}
}
}

/** Assigns a LUT (lookup table) to this image.
* @see ij.io.Opener#openLut
@@ -171,6 +171,8 @@
public static boolean jFileChooserSettingChanged;
/** Convert tiff units to microns if pixel width is less than 0.0001 cm. */
public static boolean convertToMicrons = true;
/** Wand tool "Smooth if thresholded" option */
public static boolean smoothWand;


static Properties ijPrefs = new Properties();
@@ -609,7 +609,7 @@ public void setCursor(int sx, int sy, int ox, int oy) {
setCursor(crosshairCursor);
} else if (roi!=null && roi.getState()!=roi.CONSTRUCTING && roi.isHandle(sx, sy)>=0) {
setCursor(handCursor);
} else if ((overlay!=null||showAllOverlay!=null) && overOverlayLabel(sx,sy,ox,oy)) {
} else if ((overlay!=null||showAllOverlay!=null) && overOverlayLabel(sx,sy,ox,oy) && (roi==null||roi.getState()!=roi.CONSTRUCTING)) {
overOverlayLabel = true;
setCursor(handCursor);
} else if (Prefs.usePointerCursor || (roi!=null && roi.getState()!=roi.CONSTRUCTING && roi.contains(ox, oy)))
@@ -1162,6 +1162,8 @@ else if (!e.isAltDown()) {
}
setRoiModState(e, roi, -1);
String mode = WandToolOptions.getMode();
if (Prefs.smoothWand)
mode = mode + " smooth";
int npoints = IJ.doWand(ox, oy, tolerance, mode);
if (Recorder.record && npoints>0) {
if (Recorder.scriptMode())
@@ -393,6 +393,8 @@ public void paint(Graphics g) {
public boolean close() {
boolean isRunning = running || running2;
running = running2 = false;
if (imp==null)
return true;
boolean virtual = imp.getStackSize()>1 && imp.getStack().isVirtual();
if (isRunning) IJ.wait(500);
if (ij==null || ij.quittingViaMacro() || IJ.getApplet()!=null || Interpreter.isBatchMode() || IJ.macroRunning() || virtual)

0 comments on commit 70d7c8b

Please sign in to comment.
You can’t perform that action at this time.