Skip to content

Commit

Permalink
2024.11.18 (1.54m26; Multi Measure)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasband committed Nov 18, 2024
1 parent b026637 commit afcce28
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 33 deletions.
2 changes: 1 addition & 1 deletion ij/ImageJ.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "23";
public static final String BUILD = "26";
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);
Expand Down
11 changes: 1 addition & 10 deletions ij/gui/Overlay.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public class Overlay implements Iterable<Roi> {
private boolean isCalibrationBar;
private boolean selectable = true;
private boolean draggable = true;
private double minStrokeWidth = -1;

/** Constructs an empty Overlay. */
public Overlay() {
Expand All @@ -37,11 +36,8 @@ public Overlay(Roi roi) {

/** Adds an ROI to this Overlay. */
public void add(Roi roi) {
if (roi!=null) {
if (minStrokeWidth>=0)
roi.setMinStrokeWidth(minStrokeWidth);
if (roi!=null)
list.add(roi);
}
}

/** Adds an ROI to this Overlay using the specified name. */
Expand Down Expand Up @@ -483,11 +479,6 @@ 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;
Expand Down
3 changes: 1 addition & 2 deletions ij/gui/Roi.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ 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 float minStrokeWidth = 0.1f;
private static String groupNamesString = Prefs.get(NAMES_KEY, null);
private static String[] groupNames;
private static boolean groupNamesChanged;
Expand Down
20 changes: 4 additions & 16 deletions ij/macro/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -6790,8 +6790,6 @@ else if (name.equals("paste")) {
return 0.0;
} else if (name.equals("hidden")) {
return overlay!=null && imp.getHideOverlay()?1.0:0.0;
} else if (name.equals("setMinStrokeWidth")) {
return setMinStrokeWidth(imp, overlay);
} else if (name.equals("addSelection") || name.equals("addRoi")) {
return overlayAddSelection(imp, overlay);
} else if (name.equals("setPosition")) {
Expand Down Expand Up @@ -7006,16 +7004,6 @@ private double getOverlayElementBounds(Overlay overlay) {
return Double.NaN;
}

private double setMinStrokeWidth(ImagePlus imp, Overlay overlay) {
double minStrokeWidth = getArg();
if (overlay==null) {
overlay = new Overlay();
imp.setOverlay(overlay);
}
overlay.setMinStrokeWidth(minStrokeWidth);
return Double.NaN;
}

double overlaySetPosition(Overlay overlay) {
int c=0, z=0, t=0;
int nargs = 1;
Expand Down Expand Up @@ -7815,10 +7803,7 @@ private Variable doRoi() {
return new Variable(Colors.colorToString(color));
}
ImagePlus imp = getImage();
if (name.equals("setMinStrokeWidth")) {
setMinStrokeWidth(imp, imp.getOverlay());
return null;
} else if (name.equals("paste")) {
if (name.equals("paste")) {
interp.getParens();
//IJ.log("paste: "+roiClipboard);
if (roiClipboard!=null)
Expand Down Expand Up @@ -7909,6 +7894,9 @@ else if (name.equals("remove")||name.equals("selectNone")) {
roi.setStrokeWidth(getArg());
imp.draw();
return null;
} else if (name.equals("setMinStrokeWidth")) {
roi.setMinStrokeWidth(getArg());
return null;
} else if (name.equals("getStrokeWidth")) {
interp.getParens();
return new Variable(roi.getStrokeWidth());
Expand Down
4 changes: 2 additions & 2 deletions ij/plugin/RoiRotator.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public static Roi rotate(Roi roi, double angle, double xcenter, double ycenter)
double dy = ycenter-poly.ypoints[i];
double radius = Math.sqrt(dx*dx+dy*dy);
double a = Math.atan2(dy, dx);
poly.xpoints[i] = (float)(xcenter + radius*Math.cos(a+theta));
poly.ypoints[i] = (float)(ycenter - radius*Math.sin(a+theta));
poly.xpoints[i] = (float)(xcenter+radius*Math.cos(a+theta));
poly.ypoints[i] = (float)(ycenter-radius*Math.sin(a+theta));
}
Roi roi2 = null;
if (type==Roi.LINE)
Expand Down
2 changes: 2 additions & 0 deletions ij/plugin/frame/RoiManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,8 @@ boolean multiMeasure(String cmd) {

public static ResultsTable multiMeasure(ImagePlus imp, Roi[] rois, boolean appendResults) {
int nSlices = imp.getStackSize();
if (!measureAll)
nSlices = 1;
Analyzer aSys = new Analyzer(imp); // System Analyzer
ResultsTable rtSys = Analyzer.getResultsTable();
ResultsTable rtMulti = new ResultsTable();
Expand Down
7 changes: 5 additions & 2 deletions release-notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<body>


<li> <u>1.54m23 9 November 2024</u>
<li> <u>1.54m26 18 November 2024</u>
<ul>
<li> Thanks to Kenneth Sloan, added the Overlay.setMinStrokeWidth(minStrokeWidth)
<li> Thanks to Kenneth Sloan, added the Roi.setMinStrokeWidth(minStrokeWidth)
macro function and Java method that you can use to specify a
minimum scaled stroke width
(<a href="http://wsr.imagej.net/macros/Polygons.ijm">example</a>). DOC
Expand Down Expand Up @@ -42,6 +42,9 @@
of 16 and 32 bit histogram bin widths.
<li> Thanks to Gilles Carpentier, fixed several Hyperstack type
conversion bugs.
<li> Thanks to 'scouser27', fixed bug with ROI Manager
"Multi Measure" command when "Measure all n slices" was
not checked and "One row per slice" was.
</ul>

<li> <u>1.54k 15 September 2024</u>
Expand Down

1 comment on commit afcce28

@imagesc-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/multi-measure-not-working-correctly/104914/2

Please sign in to comment.