From a22d1f7e66214831442c1df8cfd6e59bc402e58d Mon Sep 17 00:00:00 2001 From: Wayne Rasband Date: Sun, 3 Mar 2024 20:41:23 -0500 Subject: [PATCH] 2024.03.03 (1.54i; Release version) --- functions.html | 34 +++++++++++++++++++++++----- ij/ImageJ.java | 2 +- ij/VirtualStack.java | 7 +++++- ij/text/TextCanvas.java | 49 +++-------------------------------------- ij/text/TextPanel.java | 47 +++++++++++++++++++++++++++++++++++++-- release-notes.html | 22 +++++++++--------- 6 files changed, 94 insertions(+), 67 deletions(-) diff --git a/functions.html b/functions.html index be91e5d5f..f9c613969 100644 --- a/functions.html +++ b/functions.html @@ -526,19 +526,30 @@

Built-in Macro Functions

Dialog.addDirectory(label, defaultPath) - Adds a directory field and "Browse" button. The field width is determined by the length of 'defaultPath', -with a minimum of 25 columns. Use Dialog getString -to retrieve the directory path. Use +with a minimum of 25 and a maximum of 60 columns. Use Dialog +getString to retrieve the directory path. Use File.setDefaultDir() to set the default directory used when the user clicks on "Browse". Requires 1.53d.
+Dialog.addDirectory(label, defaultPath, columns) - +Adds a directory field and "Browse" button, using a +field width of 'columns'. +Requires 1.54i. +
Dialog.addFile(label, defaultPath) - Adds a file field and "Browse" button. The field width is determined by the length of 'defaultPath', -with a minimum of 25 columns. Use Dialog getString -to retrieve the file path. Requires 1.53d. +with a minimum of 25 and a maximum of 60 columns. Use Dialog +getString to retrieve the file path. +Requires 1.53d. +
+Dialog.addFile(label, defaultPath, columns) - +Adds a file field and "Browse" button, using a field width +of 'columns'. +Requires 1.54i.
Dialog.addImage(pathOrURL) - @@ -4527,7 +4538,12 @@

Built-in Macro Functions

setOption("MonospacedText", boolean)
Enables/disables monospaced text in the "Log" window. -Requires 1.54c11. +Requires 1.54c. +
+ +setOption("OpenGrayscaleJpegsAsRGB", boolean)
+Enable to open grayscale RGB JPEGs as RGB images. +Requires 1.54i.
setOption("OpenUsingPlugins", boolean)
@@ -4985,6 +5001,12 @@

Built-in Macro Functions

XY, YZ, XZ image ID values.
+ +Stack.startOrthoViews - +Enables Orthogonal Views. +Requires 1.54i. +
+ Stack.stopOrthoViews - Stops the current Orthogonal Views and closes the "YZ" and "XZ" windows. @@ -5429,7 +5451,7 @@

Built-in Macro Functions

-Last updated 2024/02/22 +Last updated 2024/03/03 diff --git a/ij/ImageJ.java b/ij/ImageJ.java index b6b1baf32..a907a2f95 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.54i"; - public static final String BUILD = "25"; + 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); diff --git a/ij/VirtualStack.java b/ij/VirtualStack.java index aabf302dc..8b70186fc 100644 --- a/ij/VirtualStack.java +++ b/ij/VirtualStack.java @@ -139,8 +139,13 @@ public void setPixels(Object pixels, int n) { /** Returns an ImageProcessor for the specified slice, * where {@literal 1<=n<=nslices}. Returns null if * the stack is empty. + * When overriding this function, note that the ImageProcessor + * may be modified at a later time. Its pixel array + * can get replaced by the pixel array of another slice. + * This is because the ImageProcessor may be re-used when a + * different slice is accessed via ImagePlus.setSlice. */ - public ImageProcessor getProcessor(int n) { + public ImageProcessor getProcessor(int n) { if (path==null) { //Help>Examples?JavaScript>Terabyte VirtualStack ImageProcessor ip = null; int w=getWidth(), h=getHeight(); diff --git a/ij/text/TextCanvas.java b/ij/text/TextCanvas.java index 795cec740..96b1f7fb9 100644 --- a/ij/text/TextCanvas.java +++ b/ij/text/TextCanvas.java @@ -76,7 +76,7 @@ public void paint(Graphics g) { gImage.fillRect(x,y,w2-1,tp.iRowHeight); } gImage.setColor(t); - char[] chars = getChars(i,j); + char[] chars = tp.getChars(i,j); if (chars!=null) gImage.drawChars(chars,0,chars.length,x+2,y+tp.iRowHeight-5); x+=w; @@ -124,49 +124,6 @@ void drawColumnLabels(int iWidth) { gImage.drawLine(0,0,iWidth,0); } - synchronized char[] getChars(int column, int row) { - if (tp==null || tp.vData==null) - return null; - if (row>=tp.vData.size()) - return null; - char[] chars = row>=0&&rowtabs) { - if (chars[start]=='\t') - tabs++; - start++; - if (start>=length) - return null; - }; - if (start<0 || start>=chars.length) { - System.out.println("start="+start+", chars.length="+chars.length); - return null; - } - if (chars[start]=='\t') - return null; - - int end = start; - while (chars[end]!='\t' && end<(length-1)) - end++; - if (chars[end]=='\t') - end--; - - char[] chars2 = new char[end-start+1]; - for (int i=0,j=start; i=tp.iColWidth.length || gImage==null) return; @@ -182,12 +139,12 @@ void calcAutoWidth(int column) { } int rowCount = Math.min(tp.iRowCount, maxRows); for (int row=0; row0?getChars(column, tp.iRowCount-1):null; + char[] chars = tp.iRowCount>0?tp.getChars(column, tp.iRowCount-1):null; if (chars!=null) w = Math.max(w,fMetrics.charsWidth(chars,0,chars.length)); if (column=iColCount||row<0||row>=iRowCount) return null; - return new String(tc.getChars(column, row)); + return new String(getChars(column, row)); } + synchronized char[] getChars(int column, int row) { + if (vData==null) + return null; + if (row>=vData.size()) + return null; + char[] chars = row>=0&&rowtabs) { + if (chars[start]=='\t') + tabs++; + start++; + if (start>=length) + return null; + }; + if (start<0 || start>=chars.length) { + System.out.println("start="+start+", chars.length="+chars.length); + return null; + } + if (chars[start]=='\t') + return null; + + int end = start; + while (chars[end]!='\t' && end<(length-1)) + end++; + if (chars[end]=='\t') + end--; + + char[] chars2 = new char[end-start+1]; + for (int i=0,j=start; i -
  • 1.54i25 29 February 2024 +
  • 1.54i 03 March 2024
    • Thanks to Fred Damen, hex notation (e.g., "0xff00ff") can be used in GenericDialog numeric fields. -
    • Thanks to Christian Tischer, added an “Open grayscale JPEGs as RGB” -option to the Edit>Options>Input/Output dialog and a related -setOption(“OpenGrayscaleJpegsAsRGB”) macro function. DOCUMENT
    • Thanks to Philippe Carl, the point options dialog is now non-modal when the point tool is in the single point mode. +
    • Thanks to Christian Tischer, added the +setOption("OpenGrayscaleJpegsAsRGB") macro +function.
    • Thanks to Stein Rorvik, added the Dialog.addFile(label,path,columns) and Dialog.addDirectory(label,path,columns) macro functions and limited the field width to 60 columns if the number of columns is not -specified. DOCUMENT +specified.
    • Thanks to Stein Rorvik, the contents of a cell in the Command Finder is displayed in the status bar when you click on that cell.
    • Thanks to Stein Rorvik, added the Stack.startOrthoViews -macro function. DOCUMENT +macro function.
    • Thanks to Norbert Vischer, fixed exception caused by Overlay.toArray(indexes) (used by Overlay.xor(indexes)).
    • Thanks to Philippe Carl, fixed bug with the Threshold window method not being @@ -36,17 +36,17 @@
    • Thanks to Norbert Vischer, fixed bug (feature?) where the getMetadata("info") macro function would unexpectedly return the current stack slice label when the image's "Info" property was null. -
    • Thanks to Philippe Carl, fixed bug with zooming in/out using (ctrl or shift)+scroll wheel -and, with hyperstacks, removed the option to zoom in/out using ctrl+scroll wheel, -allowing this option to be used to set slice positions. +
    • Thanks to Philippe Carl, fixed bug with zooming in/out using ctrl+scroll wheel +and, with hyperstacks, removed this option (use shift+scroll wheel instead), +allowing it to be used to set slice positions.
    • Thanks to Stein Rorvik, fixed bug where calling run("Clear Outside","slice") set the foreground color to the background color.
    • Thanks to Fred Damen, fixed bug where the Process>Math>Set command did not work as expected with RGB images.
    • Thanks to Norbert Vischer, fixed a v1.54h regression that caused an unexpected "No particles detected. The threshold may not be correct." message. -
    • Fixed v1.49r regression that caused invalid "Save changes..." dialog after -running macro in the Editor. +
    • Fixed v1.49r regression that caused an invalid "Save changes..." dialog after +running a macro in the Editor.
    • Thanks to Curtis Rueden, fixed a ImageJ 1.54h regression that breaks the imglib2 CellImgToVirtualStackTest.