From 6f6e828b3453fbfd59d4fd65731b5117e3d941d5 Mon Sep 17 00:00:00 2001 From: Wayne Rasband Date: Fri, 24 May 2024 22:33:46 -0400 Subject: [PATCH] 2024.05.24 (1.54j22; ROI Manager saving) --- functions.html | 12 +++++++++--- ij/IJ.java | 1 + ij/ImageJ.java | 2 +- ij/Prefs.java | 2 ++ ij/gui/GenericDialog.java | 6 +++++- ij/gui/StackWindow.java | 2 ++ ij/macro/Functions.java | 6 ++++-- ij/plugin/ZProjector.java | 29 +++++++++++++++-------------- ij/plugin/frame/RoiManager.java | 4 ++-- release-notes.html | 18 +++++++++++++++++- 10 files changed, 58 insertions(+), 24 deletions(-) diff --git a/functions.html b/functions.html index aa3b1bcf7..2eea6f68d 100644 --- a/functions.html +++ b/functions.html @@ -4542,6 +4542,13 @@

Built-in Macro Functions

Enables/disables monospaced text in the "Log" window. Requires 1.54c.
+ + +setOption("MouseWheelStackScrolling", boolean)
+Enables/disables mouse wheel stack scrolling. +Requires 1.54j. +
+ setOption("OpenGrayscaleJpegsAsRGB", boolean)
Enable to open grayscale RGB JPEGs as RGB images. @@ -5431,8 +5438,7 @@

Built-in Macro Functions

To display a multi-line message, add newline characters ("\n") to string. This function is based on -Michael Schmid's -Wait_For_User plugin. +Michael Schmid's "Wait For User" plugin. Example: WaitForUserDemo.

@@ -5453,7 +5459,7 @@

Built-in Macro Functions

-Last updated 2024/03/13 +Last updated 2024/05/15 diff --git a/ij/IJ.java b/ij/IJ.java index 03202c1ef..8e05de270 100644 --- a/ij/IJ.java +++ b/ij/IJ.java @@ -812,6 +812,7 @@ public static void showMessage(String title, String msg) { if (isMacro() && md.escapePressed()) throw new RuntimeException(Macro.MACRO_CANCELED); } + IJ.wait(25); // fix GenericDialog non-editable text field } else System.out.println(msg); } diff --git a/ij/ImageJ.java b/ij/ImageJ.java index 51ec2a8ac..bca69cbf9 100644 --- a/ij/ImageJ.java +++ b/ij/ImageJ.java @@ -79,7 +79,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.54j"; - public static final String BUILD = "15"; + public static final String BUILD = "22"; 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/Prefs.java b/ij/Prefs.java index 95dd78ba1..79a6eee62 100644 --- a/ij/Prefs.java +++ b/ij/Prefs.java @@ -197,6 +197,8 @@ public class Prefs { public static boolean calibrateConversions; /** Open grayscale RGB JPEGs as RGB */ public static boolean openGrayscaleJpegsAsRGB; + /** Scroll stacks using mouse wheel */ + public static boolean mouseWheelStackScrolling = true; //Save location of moved image windows */ //public static boolean saveImageLocation = true; diff --git a/ij/gui/GenericDialog.java b/ij/gui/GenericDialog.java index 47ec38c6f..a67f5ad72 100644 --- a/ij/gui/GenericDialog.java +++ b/ij/gui/GenericDialog.java @@ -2005,7 +2005,11 @@ public TextDropTarget(TextField text) { @Override public void drop(DropTargetDropEvent event) { try { - text.setText(getString(event)); + String path = getString(event); + path = Recorder.fixPath(path); + if (!path.endsWith("/")&& (new File(path)).isDirectory()) + path = path + "/"; + text.setText(path); } catch (Exception e) { e.printStackTrace(); } } } diff --git a/ij/gui/StackWindow.java b/ij/gui/StackWindow.java index 8fe40b0bd..df1b48ff9 100644 --- a/ij/gui/StackWindow.java +++ b/ij/gui/StackWindow.java @@ -184,6 +184,8 @@ else if (rotation>0) ic.zoomOut(x,y); return; } + if (!Prefs.mouseWheelStackScrolling) + return; if (hyperStack) { if (rotation>0) IJ.run(imp, "Next Slice [>]", ""); diff --git a/ij/macro/Functions.java b/ij/macro/Functions.java index 14aa72b2d..bd9a19f45 100644 --- a/ij/macro/Functions.java +++ b/ij/macro/Functions.java @@ -4796,7 +4796,9 @@ else if (arg1.startsWith("opengrayscale")) else if (arg1.startsWith("calibrate")) { Prefs.calibrateConversions = state; ImageConverter.setDoScaling(true); - } else + } else if (arg1.startsWith("mousewheel")) + Prefs.mouseWheelStackScrolling = state; + else interp.error("Invalid option"); } @@ -7149,7 +7151,7 @@ void addDrawingToOverlay(ImagePlus imp) { void addRoi(ImagePlus imp, Roi roi){ Overlay overlay = imp.getOverlay(); - if (overlay==null || overlay.size()==0) { + if (overlay==null) { if (offscreenOverlay==null) offscreenOverlay = new Overlay(); overlay = offscreenOverlay; diff --git a/ij/plugin/ZProjector.java b/ij/plugin/ZProjector.java index 550d4f6c0..e357b7f89 100644 --- a/ij/plugin/ZProjector.java +++ b/ij/plugin/ZProjector.java @@ -659,20 +659,23 @@ private ImagePlus doAverageFloatProjection(ImagePlus imp) { int d = stack.getSize(); ImagePlus projection = IJ.createImage(makeTitle(), "32-bit Black", w, h, 1); ImageProcessor ip = projection.getProcessor(); - for (int x=0; x=1 && slice2<=imp.getStackSize()) { imp.setSlice(slice2); diff --git a/release-notes.html b/release-notes.html index e0e577bbc..9dcf5542a 100644 --- a/release-notes.html +++ b/release-notes.html @@ -5,7 +5,7 @@ -
  • 1.54j15 15 April 2024 +
  • 1.54j22 24 May 2024
    • Thanks to 'ramnoob', added a number of official tags to the DICOM reader. @@ -15,6 +15,9 @@
    • Thanks to Gabriel Landini, ImageJ adds an "*" next to the Mode value in the Histogram window if the histogram is multi-modal. +
    • Thanks to Norbert Vischer, added the +setOption("MouseWheelStackScrolling",boolean) macro +function.
    • Thanks to Albert Cardona and Curtis Rueden, added public setEqualize() and setSaturated() methods to the ContrastEnhancer class. @@ -27,6 +30,19 @@
    • Thanks to Stein Rorvik, fixed a bug where the Table.getColumn() macro function did not work with columns containing empty strings. +
    • Thanks to Norbert Vischer, fixed bug where +text fields in GenericDialogs opened after a showMessage() +were non-editable. +
    • Thanks to Jan Brocher, fixed bug where drag-and-drop of +directories onto GenericDialog directory fields did not +work as expected. +
    • Thanks to Norbert Vischer, fixed an Overlay.clear macro +function bug. +
    • Thanks to Alexander Bender, fixed bug with ROI Manager +ignoring selection when saving. +
    • Thanks to Michael Schmid, fixed 1.53t regression +where Image>Stacks>Z Project failed when doing +"Average" projection of 32-bit float stacks
  • 1.54i 03 March 2024