Skip to content

Commit 2bfe4ff

Browse files
committed
2025.03.19 (1.54q6; Record starts)
1 parent a3e0165 commit 2bfe4ff

File tree

7 files changed

+31
-23
lines changed

7 files changed

+31
-23
lines changed

ij/ImageJ.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public class ImageJ extends Frame implements ActionListener,
7979

8080
/** Plugins should call IJ.getVersion() or IJ.getFullVersion() to get the version string. */
8181
public static final String VERSION = "1.54q";
82-
public static final String BUILD = "2";
82+
public static final String BUILD = "6";
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/gui/GenericDialog.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,8 @@ private void recordOption(Object component, String value) {
12591259
}
12601260

12611261
private void recordCheckboxOption(Checkbox cb) {
1262+
if (labels==null)
1263+
return;
12621264
String label = (String)labels.get((Object)cb);
12631265
if (label!=null) {
12641266
if (cb.getState()) // checked

ij/macro/Functions.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4546,11 +4546,11 @@ else if (str.startsWith("Error: "))
45464546
}
45474547

45484548
String openAsRawString() {
4549-
int max = 5000;
4549+
long max = 5000;
45504550
String path = getFirstString();
45514551
boolean specifiedMax = false;
45524552
if (interp.nextToken()==',') {
4553-
max = (int)getNextArg();
4553+
max = (long)getNextArg();
45544554
specifiedMax = true;
45554555
}
45564556
interp.getRightParen();
@@ -4567,12 +4567,12 @@ String openAsRawString() {
45674567
interp.error("File not found");
45684568
try {
45694569
StringBuffer sb = new StringBuffer(5000);
4570-
int len = (int)file.length();
4570+
long len = file.length();
45714571
if (max>len || (path.endsWith(".txt")&&!specifiedMax))
45724572
max = len;
45734573
InputStream in = new BufferedInputStream(new FileInputStream(path));
45744574
DataInputStream dis = new DataInputStream(in);
4575-
byte[] buffer = new byte[max];
4575+
byte[] buffer = new byte[(int)max];
45764576
dis.readFully(buffer);
45774577
dis.close();
45784578
char[] buffer2 = new char[buffer.length];

ij/plugin/Duplicator.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ public void run(String arg) {
4141
Roi roiA = imp.getRoi();
4242
ImagePlus impA = imp;
4343
boolean isRotatedRect = (roiA!=null && roiA instanceof RotatedRectRoi);
44-
if (isRotatedRect) {
45-
Rectangle bounds = imp.getRoi().getBounds();
46-
imp.setRoi(bounds);
47-
}
4844
boolean roiOutside = false;
4945
if (roiA!=null) {
5046
Rectangle r = roiA.getBounds();
@@ -63,13 +59,17 @@ public void run(String arg) {
6359
if (imp.isHyperStack() || imp.isComposite()) {
6460
if (roiOutside)
6561
imp.deleteRoi();
66-
duplicateHyperstack(imp, newTitle);
67-
if (isRotatedRect)
62+
boolean ok = duplicateHyperstack(imp, newTitle);
63+
if (ok && isRotatedRect)
6864
straightenRotatedRect(impA, roiA, IJ.getImage());
6965
return;
7066
} else
7167
newTitle = showDialog(imp, "Duplicate...", "Title: ");
7268
}
69+
if (isRotatedRect) {
70+
Rectangle bounds = imp.getRoi().getBounds();
71+
imp.setRoi(bounds);
72+
}
7373
if (newTitle==null) {
7474
if (isRotatedRect)
7575
imp.setRoi(roiA);
@@ -551,10 +551,10 @@ private String getNewTitle() {
551551
return title;
552552
}
553553

554-
void duplicateHyperstack(ImagePlus imp, String newTitle) {
554+
boolean duplicateHyperstack(ImagePlus imp, String newTitle) {
555555
newTitle = showHSDialog(imp, newTitle);
556556
if (newTitle==null)
557-
return;
557+
return false;
558558
ImagePlus imp2 = null;
559559
Roi roi = imp.getRoi();
560560
if (!duplicateStack) {
@@ -569,11 +569,11 @@ void duplicateHyperstack(ImagePlus imp, String newTitle) {
569569
firstT = lastT = imp.getFrame();
570570
}
571571
imp2 = run(imp, firstC, lastC, firstZ, lastZ, firstT, lastT);
572-
if (imp2==null) return;
572+
if (imp2==null) return false;
573573
imp2.setTitle(newTitle);
574574
if (imp2.getWidth()==0 || imp2.getHeight()==0) {
575575
IJ.error("Duplicator", "Selection is outside the image");
576-
return;
576+
return false;
577577
}
578578
if (roi!=null && roi.isArea() && roi.getType()!=Roi.RECTANGLE) {
579579
Roi roi2 = (Roi)cropRoi(imp, roi).clone();
@@ -584,6 +584,7 @@ void duplicateHyperstack(ImagePlus imp, String newTitle) {
584584
imp2.setPosition(imp.getC(), imp.getZ(), imp.getT());
585585
if (IJ.isMacro()&&imp2.getWindow()!=null)
586586
IJ.wait(50);
587+
return true;
587588
}
588589

589590
String showHSDialog(ImagePlus imp, String newTitle) {

ij/plugin/Straightener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void run(String arg) {
3636
gd.addStringField("Title:", newTitle, 15);
3737
gd.addNumericField("Line Width:", width, 0, 3, "pixels");
3838
if (stackSize>1)
39-
gd.addCheckbox("Process Entire Stack", processStack);
39+
gd.addCheckbox("Process entire stack", processStack);
4040
gd.showDialog();
4141
if (gd.wasCanceled()) {imp.unlock(); return;}
4242
newTitle = gd.getNextString();

ij/plugin/filter/ParticleAnalyzer.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,8 @@ public boolean showDialog() {
346346
}
347347
gd.addStringField("Circularity:", IJ.d2s(minCircularity)+"-"+IJ.d2s(maxCircularity), 12);
348348
gd.addChoice("Show:", showStrings2, showStrings[showChoice]);
349-
String[] labels = new String[10];
350-
boolean[] states = new boolean[10];
349+
String[] labels = new String[8];
350+
boolean[] states = new boolean[8];
351351
labels[0]="Display results"; states[0] = (options&SHOW_RESULTS)!=0;
352352
labels[1]="Exclude on edges"; states[1]=(options&EXCLUDE_EDGE_PARTICLES)!=0;
353353
labels[2]="Clear results"; states[2]=(options&CLEAR_WORKSHEET)!=0;
@@ -356,8 +356,7 @@ public boolean showDialog() {
356356
labels[5]="Overlay"; states[5]=(options&OVERLAY)!=0;
357357
labels[6]="Add to Manager"; states[6]=(options&ADD_TO_MANAGER)!=0;
358358
labels[7]="Composite ROIs"; states[7]=(options&COMPOSITE_ROIS)!=0;
359-
labels[8]="Record starts"; states[8]=(options&RECORD_STARTS)!=0;
360-
gd.addCheckboxGroup(5, 2, labels, states);
359+
gd.addCheckboxGroup(4, 2, labels, states);
361360
gd.addHelp(IJ.URL2+"/docs/menus/analyze.html#ap");
362361
gd.showDialog();
363362
if (gd.wasCanceled())
@@ -420,8 +419,6 @@ public boolean showDialog() {
420419
options |= ADD_TO_MANAGER; else options &= ~ADD_TO_MANAGER;
421420
if (gd.getNextBoolean())
422421
options |= COMPOSITE_ROIS; else options &= ~COMPOSITE_ROIS;
423-
if (gd.getNextBoolean())
424-
options |= RECORD_STARTS; else options &= ~RECORD_STARTS;
425422
staticOptions = options;
426423
options |= SHOW_PROGRESS;
427424
if ((options&DISPLAY_SUMMARY)!=0)

release-notes.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@
66
<body>
77

88

9-
<li> <u>1.54q2 14 March 2025</u>
9+
<li> <u>1.54q6 19 March 2025</u>
1010
<ul>
11+
<li> Removed the particle analyzers's "Record starts" option because
12+
it caused a NullPointerException when running in Fiji headless
13+
mode.
1114
<li> Thanks to Michael Schmid, fixed bug where <i>Image&gt;Stacks&gt;Label</i>
1215
produces a NullPointerException in "overlay" mode when previewing
1316
and the current stack slice is not the first one.
17+
<li> Thanks to Christophe Leterrier, Jurgen Gluch and Guenter Pudmich,
18+
fixed bug with the File.openAsRawString() macro function not working with
19+
files larger than 2GB.
20+
<li> Thanks to 'scouser27', fixed bug with cancelling the duplication of
21+
a rotated rectangle on a hyperstack.
1422
<li> Thanks to Michael Schmid, fixed 1.54m9 <i>Analyze&gt;Plot Profile</i>
1523
regression where ImageProcessor.getLine() did not sample the
1624
correct points.

0 commit comments

Comments
 (0)