Skip to content

Commit

Permalink
2024.09.10 (1.54k21; RoiManager.delete)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasband committed Sep 10, 2024
1 parent 10e9086 commit da0931c
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 5 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.54k";
public static final String BUILD = "19";
public static final String BUILD = "21";
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
4 changes: 4 additions & 0 deletions ij/gui/Roi.java
Original file line number Diff line number Diff line change
Expand Up @@ -2955,6 +2955,10 @@ private class RoiPointsIteratorMask implements Iterator<Point> {
if (isLine()) {
Roi roi2 = Roi.convertLineToArea(Roi.this);
mask = roi2.getMask();
if (mask==null && roi2.getType()==RECTANGLE) {
mask = new ByteProcessor(roi2.width, roi2.height);
mask.invert();
}
xbase = roi2.x;
ybase = roi2.y;
} else {
Expand Down
3 changes: 3 additions & 0 deletions ij/macro/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -8178,6 +8178,9 @@ private Variable doRoiManager() {
} else if (name.equals("translate")) {
rm.translate(getFirstArg(),getLastArg());
return null;
} else if (name.equals("delete")) {
rm.delete((int)getArg());
return null;
} else
interp.error("Unrecognized RoiManager function");
return null;
Expand Down
1 change: 1 addition & 0 deletions ij/plugin/Benchmark.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/
public class Benchmark implements PlugIn {
private String[] results = {
" 6.3|Custom PC (AMD 9700X, Zen 5, 2024)",
" 6.8|MacBook Pro (M3 Pro, 2023)",
" 9.5|MacBook Pro (M1 Max, 2021)",
"10.5|Custom PC (12th Gen Core i9, 2022)",
Expand Down
16 changes: 13 additions & 3 deletions ij/plugin/frame/RoiManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -585,15 +585,25 @@ boolean delete(boolean replacing) {
}
}
}
ImagePlus imp = WindowManager.getCurrentImage();
//if (count>1 && index.length==1 && imp!=null)
// imp.deleteRoi();
updateShowAll();
if (record())
Recorder.record("roiManager", "Delete");
return true;
}

public void delete(int index) {
int count = getCount();
if (count==0 || index>=count)
return;
if (EventQueue.isDispatchThread()) {
rois.remove(index);
listModel.remove(index);
} else
deleteOnEDT(index);
updateShowAll();
repaint();
}

// Delete ROI on event dispatch thread
private void deleteOnEDT(final int i) {
try {
Expand Down
8 changes: 7 additions & 1 deletion release-notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
</head>
<body>

<li> <u>1.54k19 6 September 2024</u>
<li> <u>1.54k21 10 September 2024</u>
<ul>
<li> Thanks to 'Carlos', added the RoiManager.delete(index) macro function DOC
and the RoiManager.delete(index) method.
<li> Thanks to Michael Schmid, the dialog shown for <i>Image&gt;Overlay&gt;Add Selection</i>
with the ALT key down has an additional "Show on all slices" checkbox.
Using "Apply" in the <i>Image&gt;Overlay&gt;Overlay Options</i> dialog
Expand Down Expand Up @@ -54,6 +56,10 @@
<li> Thanks to Michael Schmid, fixed <i>Undo</i> exception
after using <i>Image&gt;Adjust&gt;Size</i> on
a stack.
<li> Thanks to 'Carlos', fixed bug with freehand and
segmented line selection iterators when the line was
completely straight vertically or
horizontally.
<li> Thanks to Felix Rudolphi and Curtis Rueden, fixed a
1.54i regression that caused FileOpener to throw
HeadlessExceptions in headless environments.
Expand Down

1 comment on commit da0931c

@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/enable-deletion-of-rois-with-the-imagej-roi-manager-and-small-bug/101490/3

Please sign in to comment.