Skip to content

Commit a3e0165

Browse files
committed
2025.03.14 (1.54q2; Hyperstack points)
1 parent 03382be commit a3e0165

File tree

7 files changed

+33
-18
lines changed

7 files changed

+33
-18
lines changed

ij/ImageJ.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ public class ImageJ extends Frame implements ActionListener,
7878
MouseListener, KeyListener, WindowListener, ItemListener, Runnable {
7979

8080
/** Plugins should call IJ.getVersion() or IJ.getFullVersion() to get the version string. */
81-
public static final String VERSION = "1.54p";
82-
public static final String BUILD = "";
81+
public static final String VERSION = "1.54q";
82+
public static final String BUILD = "2";
8383
public static Color backgroundColor = new Color(237,237,237);
8484
/** SansSerif, 12-point, plain font. */
8585
public static final Font SansSerif12 = new Font("SansSerif", Font.PLAIN, 12);

ij/Macro.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ else if (ch==']')
157157
}
158158

159159
public static String trimKey(String key) {
160+
if (key==null)
161+
return key;
160162
int index = key.indexOf(" ");
161163
if (index>-1)
162164
key = key.substring(0,index);

ij/gui/PointRoi.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public class PointRoi extends PolygonRoi {
5757
private int nMarkers;
5858
private boolean addToOverlay;
5959
public static PointRoi savedPoints;
60+
private boolean positionSet;
6061

6162
static {
6263
setDefaultType((int)Prefs.get(TYPE_KEY, HYBRID));
@@ -721,6 +722,7 @@ public void setPosition(int n) {
721722
Arrays.fill(positions, n);
722723
}
723724
hyperstackPosition = false;
725+
positionSet = true;
724726
}
725727

726728
/** Returns the stack position (image number) of the points in this Roi, if
@@ -729,9 +731,9 @@ public void setPosition(int n) {
729731
* if there are different stack positions for different points.
730732
*/
731733
public int getPosition() {
732-
if (positions == null || nPoints < 1) {
734+
if (positions==null || nPoints<1 || !positionSet)
733735
return 0;
734-
} else {
736+
else {
735737
int position = positions[0];
736738
for (int i=1; i<nPoints; i++)
737739
if (positions[i] != position)
@@ -1024,9 +1026,9 @@ public boolean addToOverlay() {
10241026

10251027
public String toString() {
10261028
if (nPoints>1)
1027-
return ("Roi[Points, count="+nPoints+"]");
1029+
return ("Roi[Points, count="+nPoints+", pos="+getPositionAsString()+"]");
10281030
else
1029-
return ("Roi[Point, x="+x+", y="+y+"]");
1031+
return ("Roi[Point, x="+x+", y="+y+", pos="+getPositionAsString()+"]");
10301032
}
10311033

10321034
/** @deprecated */

ij/gui/Roi.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2213,6 +2213,17 @@ public void setPosition(int n) {
22132213
public int getPosition() {
22142214
return position;
22152215
}
2216+
2217+
public String getPositionAsString() {
2218+
String position = "" + getPosition();
2219+
if (hasHyperStackPosition())
2220+
position = getCPosition() +","+getZPosition()+","+ getTPosition();
2221+
if (position.equals("0"))
2222+
position = "none";
2223+
else if (position.equals(""+PointRoi.POINTWISE_POSITION))
2224+
position = "point-specific";
2225+
return position;
2226+
}
22162227

22172228
/** Sets the hyperstack position of this ROI. In an overlay, this
22182229
* ROI is only displayed when the hyperstack is at the specified position.
@@ -2584,7 +2595,7 @@ public int getPropertyCount() {
25842595
}
25852596

25862597
public String toString() {
2587-
return ("Roi["+getTypeAsString()+", x="+x+", y="+y+", width="+width+", height="+height+"]");
2598+
return ("Roi["+getTypeAsString()+", x="+x+", y="+y+", width="+width+", height="+height+", pos="+getPositionAsString()+"]");
25882599
}
25892600

25902601
/** Deprecated */

ij/gui/RoiProperties.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,7 @@ public boolean showDialog() {
8787
justification = troi.getJustification();
8888
antialias = troi.getAntiAlias();
8989
}
90-
String position = ""+roi.getPosition();
91-
if (roi.hasHyperStackPosition())
92-
position = roi.getCPosition() +","+roi.getZPosition()+","+ roi.getTPosition();
93-
if (position.equals("0"))
94-
position = "none";
95-
else if (position.equals(""+PointRoi.POINTWISE_POSITION))
96-
position = "point-specific";
90+
String position = roi.getPositionAsString();
9791
String group = ""+roi.getGroup();
9892
if (group.equals("0"))
9993
group = "none";
@@ -312,7 +306,7 @@ else if (roi.getPosition() == 0)
312306
listProperties(roi);
313307
return true;
314308
}
315-
309+
316310
private void setPosition(Roi roi, String pos1, String pos2) {
317311
if (pos1.equals(pos2))
318312
return;

ij/plugin/filter/StackLabeler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ else if (imp.getNSlices()>1)
218218
frame = pos[1];
219219
}
220220
if (useOverlay) {
221-
if (image==1) {
221+
if (image==1 || previewing) {
222222
overlay = new Overlay();
223223
if (baseOverlay!=null) {
224224
for (int i=0; i<baseOverlay.size(); i++)

release-notes.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@
66
<body>
77

88

9-
<li> <u>1.54p 17 February 2025</u>
9+
<li> <u>1.54q2 14 March 2025</u>
1010
<ul>
11+
<li> Thanks to Michael Schmid, fixed bug where <i>Image&gt;Stacks&gt;Label</i>
12+
produces a NullPointerException in "overlay" mode when previewing
13+
and the current stack slice is not the first one.
1114
<li> Thanks to Michael Schmid, fixed 1.54m9 <i>Analyze&gt;Plot Profile</i>
1215
regression where ImageProcessor.getLine() did not sample the
13-
correct points
16+
correct points.
17+
<li> Thanks to 'AndreC' and 'scouser27' fixed regression that caused point
18+
selections on hyperstacks to not be correctly added to overlays and the
19+
ROI Manager.
1420
</ul>
1521

1622
<li> <u>1.54n 17 February 2025</u>

0 commit comments

Comments
 (0)