diff --git a/ij/ImageJ.java b/ij/ImageJ.java index acdaa5f4..a6a5104d 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.54m"; - public static final String BUILD = "18"; + public static final String BUILD = "23"; 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/gui/Overlay.java b/ij/gui/Overlay.java index a65e8428..1d2e8735 100644 --- a/ij/gui/Overlay.java +++ b/ij/gui/Overlay.java @@ -21,6 +21,7 @@ public class Overlay implements Iterable { private boolean isCalibrationBar; private boolean selectable = true; private boolean draggable = true; + private double minStrokeWidth = -1; /** Constructs an empty Overlay. */ public Overlay() { @@ -36,8 +37,11 @@ public Overlay(Roi roi) { /** Adds an ROI to this Overlay. */ public void add(Roi roi) { - if (roi!=null) + if (roi!=null) { + if (minStrokeWidth>=0) + roi.setMinStrokeWidth(minStrokeWidth); list.add(roi); + } } /** Adds an ROI to this Overlay using the specified name. */ @@ -479,6 +483,11 @@ public void setDraggable(boolean draggable) { this.draggable = draggable; } + /** Sets the minimum scaled stroke width (default is 0.05). */ + public void setMinStrokeWidth(double minWidth) { + minStrokeWidth = minWidth; + } + /** Returns 'true' if ROIs in this overlay can be dragged by their labels. */ public boolean isDraggable() { return draggable; diff --git a/ij/gui/Roi.java b/ij/gui/Roi.java index aa81ab4c..c58b5afd 100644 --- a/ij/gui/Roi.java +++ b/ij/gui/Roi.java @@ -77,6 +77,8 @@ public class Roi extends Object implements Cloneable, java.io.Serializable, Iter private static int defaultGroup; // zero is no specific group private static Color groupColor; private static double defaultStrokeWidth; + private static float defaultMinStrokeWidth = 0.05f; + private float minStrokeWidth = defaultMinStrokeWidth; private static String groupNamesString = Prefs.get(NAMES_KEY, null); private static String[] groupNames; private static boolean groupNamesChanged; @@ -2065,6 +2067,7 @@ public void setNonScalable(boolean nonScalable) { * @see #setUnscalableStrokeWidth(double) * @see #setStrokeColor(Color) * @see ij.ImagePlus#setOverlay(ij.gui.Overlay) + * @see setMineStrokeWidth(double) */ public void setStrokeWidth(float strokeWidth) { if (strokeWidth<0f) @@ -2091,6 +2094,11 @@ public void setStrokeWidth(double strokeWidth) { setStrokeWidth((float)strokeWidth); } + /** Sets the minimum scaled stroke width (default=0.05). */ + public void setMinStrokeWidth(double minWidth) { + minStrokeWidth = (float)minWidth; + } + /** Sets the width of the line used to draw this ROI and * prevents the width from increasing when the image * is zoomed. @@ -2132,7 +2140,8 @@ protected BasicStroke getScaledStroke() { double mag = ic.getMagnification(); if (mag!=1.0) { float width = (float)(stroke.getLineWidth()*mag); - //return new BasicStroke(width, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL); + if (width -
  • 1.54m16 28 October 2024 +
  • 1.54m23 9 November 2024
      +
    • Thanks to Kenneth Sloan, added the Overlay.setMinStrokeWidth(minStrokeWidth) +macro function and Java method that you can use to specify a +minimum scaled stroke width +(example). DOC
    • Thanks to Michael Cammer, the Orthogonal Views command no longer removes overlays.
    • Thanks to 'Patricia' and Herbie Gluender, the @@ -36,6 +40,8 @@ -batch option.
    • Thanks to Guenter Pudmich, fixed bug with the calculation of 16 and 32 bit histogram bin widths. +
    • Thanks to Gilles Carpentier, fixed several Hyperstack type +conversion bugs.
  • 1.54k 15 September 2024