From b66c034f4361eacabbf491c30d432bd0650dee79 Mon Sep 17 00:00:00 2001 From: Wayne Rasband Date: Wed, 18 Oct 2023 17:07:54 -0400 Subject: [PATCH] 2023.10.18 (1.54g; Release version) --- functions.html | 14 ++++++++++++-- ij/ImageJ.java | 2 +- ij/macro/Functions.java | 15 +++++++++++++-- ij/plugin/frame/RoiManager.java | 13 ++++++++++++- release-notes.html | 21 ++++++++++++--------- 5 files changed, 50 insertions(+), 15 deletions(-) diff --git a/functions.html b/functions.html index e6a8632ee..1ce33b3f4 100644 --- a/functions.html +++ b/functions.html @@ -592,6 +592,11 @@

Built-in Macro Functions

Dialog.setLocation(x, y) - Sets the screen location where this dialog will be displayed.
+ +Dialog.getLocation(x, y) - +Returns the screen location of this dialog. +Requires 1.54g. +
Dialog.show() - Displays the dialog and waits until the user clicks "OK" or "Cancel". The macro @@ -4017,8 +4022,13 @@

Built-in Macro Functions


-RoiManager.setPosition
+RoiManager.setPosition(slice)
+Sets the position of the selected selections. +
+ +RoiManager.setPosition(channel, slice, frame)
Sets the position of the selected selections. +Requires 1.54g.
@@ -5412,7 +5422,7 @@

Built-in Macro Functions

-Last updated 2023/07/28 +Last updated 2023/10/18 diff --git a/ij/ImageJ.java b/ij/ImageJ.java index 86c73a1a4..d6b268c4b 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.54g"; - public static final String BUILD = "32"; + public static final String BUILD = ""; //33 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/macro/Functions.java b/ij/macro/Functions.java index 7b43ab53b..16a53d5d2 100644 --- a/ij/macro/Functions.java +++ b/ij/macro/Functions.java @@ -8100,8 +8100,7 @@ private Variable doRoiManager() { } else if (name.equals("getIndex")) { return new Variable(rm.getIndex(getStringArg())); } else if (name.equals("setPosition")) { - int position = (int)getArg(); - rm.setPosition(position); + setRoiManagerPosition(rm); return null; } else if (name.equals("multiCrop")) { rm.multiCrop(getFirstString(),getLastString()); @@ -8124,6 +8123,18 @@ private Variable doRoiManager() { interp.error("Unrecognized RoiManager function"); return null; } + + private void setRoiManagerPosition(RoiManager rm) { + int channel = (int)getFirstArg(); + if (interp.nextToken()==')') { + interp.getRightParen(); + rm.setPosition(channel); + return; + } + int slice = (int)getNextArg(); + int frame = (int)getLastArg(); + rm.setPosition(channel, slice, frame); + } private Variable doProperty() { interp.getToken(); diff --git a/ij/plugin/frame/RoiManager.java b/ij/plugin/frame/RoiManager.java index eda359b89..6f19a56b6 100644 --- a/ij/plugin/frame/RoiManager.java +++ b/ij/plugin/frame/RoiManager.java @@ -1443,7 +1443,7 @@ public void setGroup(int group) { if (imp!=null) imp.draw(); } - /** Sets the position for the selected ROIs. */ + /** Sets the position of the selected ROIs. */ public void setPosition(int position) { int[] indexes = getIndexes(); for (int i: indexes) { @@ -1454,6 +1454,17 @@ public void setPosition(int position) { if (imp!=null) imp.draw(); } + /** Sets the c,z,t position of the selected ROIs. */ + public void setPosition(int c, int z, int t) { + int[] indexes = getIndexes(); + for (int i: indexes) { + Roi roi = getRoi(i); + roi.setPosition(c, z, t); + } + ImagePlus imp = WindowManager.getCurrentImage(); + if (imp!=null) imp.draw(); + } + /** Obsolete; replaced by RoiManager.setGroup() macro function. */ public static void setGroup(String group) { RoiManager rm = getInstance(); diff --git a/release-notes.html b/release-notes.html index 1f972ccee..494b4d823 100644 --- a/release-notes.html +++ b/release-notes.html @@ -5,9 +5,9 @@ -
  • 1.54g32 17 October 2023 +
  • 1.54g 18 October 2023