Skip to content

Commit

Permalink
2024.03.03 (1.54i; Release version)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasband committed Mar 4, 2024
1 parent 7579e16 commit a22d1f7
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 67 deletions.
34 changes: 28 additions & 6 deletions functions.html
Original file line number Diff line number Diff line change
Expand Up @@ -526,19 +526,30 @@ <h1>Built-in Macro Functions</h1>
<b>Dialog.addDirectory(label, defaultPath)</b> -
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
<a href="#File.setDefaultDir">File.setDefaultDir()</a>
to set the default directory used when the user
clicks on "Browse".
Requires 1.53d.
<br>
<b>Dialog.addDirectory(label, defaultPath, columns)</b> -
Adds a directory field and "Browse" button, using a
field width of 'columns'.
Requires 1.54i.
<br>
<a name="Dialog.addFile"></a>
<b>Dialog.addFile(label, defaultPath)</b> -
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.
<br>
<b>Dialog.addFile(label, defaultPath, columns)</b> -
Adds a file field and "Browse" button, using a field width
of 'columns'.
Requires 1.54i.
<br>
<a name="Dialog.addImage"></a>
<b>Dialog.addImage(pathOrURL)</b> -
Expand Down Expand Up @@ -4527,7 +4538,12 @@ <h1>Built-in Macro Functions</h1>
<a name="setOption_MonospacedText"></a>
<b>setOption("MonospacedText", boolean)</b><br>
Enables/disables monospaced text in the "Log" window.
Requires 1.54c11.
Requires 1.54c.
<br>
<a name="setOption_OpenGrayscaleJpegsAsRGB"></a>
<b>setOption("OpenGrayscaleJpegsAsRGB", boolean)</b><br>
Enable to open grayscale RGB JPEGs as RGB images.
Requires 1.54i.
<br>
<a name="setOption_OpenUsingPlugins"></a>
<b>setOption("OpenUsingPlugins", boolean)</b><br>
Expand Down Expand Up @@ -4985,6 +5001,12 @@ <h1>Built-in Macro Functions</h1>
XY, YZ, XZ image ID values.
<br>

<a name="Stack.startOrthoViews"></a>
<b>Stack.startOrthoViews</b> -
Enables <i>Orthogonal Views</i>.
Requires 1.54i.
<br>

<a name="Stack.stopOrthoViews"></a>
<b>Stack.stopOrthoViews</b> -
Stops the current <i>Orthogonal Views</i> and closes the "YZ" and "XZ" windows.
Expand Down Expand Up @@ -5429,7 +5451,7 @@ <h1>Built-in Macro Functions</h1>

<p class=navbar> <a href="#Top">top</a> | <a href="https://imagej.nih.gov/ij/index.html">home</a></p>

<small>Last updated 2024/02/22</small>
<small>Last updated 2024/03/03</small>

</body>
</html>
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.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);
Expand Down
7 changes: 6 additions & 1 deletion ij/VirtualStack.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
49 changes: 3 additions & 46 deletions ij/text/TextCanvas.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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&&row<tp.vData.size()?(char[])(tp.vData.elementAt(row)):null;
if (chars==null || chars.length==0)
return null;

if (tp.iColCount==1)
return chars;

int start = 0;
int tabs = 0;
int length = chars.length;

while (column>tabs) {
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<chars2.length; i++,j++) {
chars2[i] = chars[j];
}
return chars2;
}

void calcAutoWidth(int column) {
if (tp.sColHead==null || column>=tp.iColWidth.length || gImage==null)
return;
Expand All @@ -182,12 +139,12 @@ void calcAutoWidth(int column) {
}
int rowCount = Math.min(tp.iRowCount, maxRows);
for (int row=0; row<rowCount; row++) {
char[] chars = getChars(column,row);
char[] chars = tp.getChars(column,row);
if (chars!=null)
w = Math.max(w,fMetrics.charsWidth(chars,0,chars.length));
}
//System.out.println("calcAutoWidth: "+column+" "+tp.iRowCount);
char[] chars = tp.iRowCount>0?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<tp.iColWidth.length)
Expand Down
47 changes: 45 additions & 2 deletions ij/text/TextPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public synchronized void setColumnHeadings(String labels) {
iColCount = sColHead.length;
}
flush();
vData=new Vector();
vData = new Vector();
if (!(iColWidth!=null && iColWidth.length==iColCount && sameLabels && iColCount!=1)) {
iColWidth=new int[iColCount];
columnsManuallyAdjusted = false;
Expand Down Expand Up @@ -242,9 +242,52 @@ public void updateDisplay() {
String getCell(int column, int row) {
if (column<0||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&&row<vData.size()?(char[])(vData.elementAt(row)):null;
if (chars==null || chars.length==0)
return null;

if (iColCount==1)
return chars;

int start = 0;
int tabs = 0;
int length = chars.length;

while (column>tabs) {
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<chars2.length; i++,j++) {
chars2[i] = chars[j];
}
return chars2;
}

synchronized void adjustVScroll() {
if(iRowHeight==0) return;
Dimension d = tc.getSize();
Expand Down
22 changes: 11 additions & 11 deletions release-notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
</head>
<body>

<li> <u>1.54i25 29 February 2024</u>
<li> <u>1.54i 03 March 2024</u>
<ul>
<li> Thanks to Fred Damen, hex notation (e.g., "0xff00ff") can be
used in GenericDialog numeric fields.
<li> Thanks to Christian Tischer, added an “Open grayscale JPEGs as RGB”
option to the <i>Edit&gt;Options&gt;Input/Output</i> dialog and a related
setOption(“OpenGrayscaleJpegsAsRGB”) macro function. DOCUMENT
<li> Thanks to Philippe Carl, the point options dialog is now non-modal
when the point tool is in the single point mode.
<li> Thanks to Christian Tischer, added the
setOption("OpenGrayscaleJpegsAsRGB") macro
function.
<li> 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.
<li> 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.
<li> Thanks to Stein Rorvik, added the Stack.startOrthoViews
macro function. DOCUMENT
macro function.
<li> Thanks to Norbert Vischer, fixed exception caused by Overlay.toArray(indexes)
(used by Overlay.xor(indexes)).
<li> Thanks to Philippe Carl, fixed bug with the Threshold window method not being
Expand All @@ -36,17 +36,17 @@
<li> 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.
<li> 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.
<li> 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.
<li> Thanks to Stein Rorvik, fixed bug where calling run("Clear Outside","slice")
set the foreground color to the background color.
<li> Thanks to Fred Damen, fixed bug where the <i>Process&gt;Math&gt;Set</i>
command did not work as expected with RGB images.
<li> Thanks to Norbert Vischer, fixed a v1.54h regression that caused an unexpected
"No particles detected. The threshold may not be correct." message.
<li> Fixed v1.49r regression that caused invalid "Save changes..." dialog after
running macro in the Editor.
<li> Fixed v1.49r regression that caused an invalid "Save changes..." dialog after
running a macro in the Editor.
<li> Thanks to Curtis Rueden, fixed a ImageJ 1.54h regression that breaks
the imglib2
<a href="https://github.com/imglib/imglib2-ij/issues/39#issuecomment-1969692839">CellImgToVirtualStackTest</a>.
Expand Down

0 comments on commit a22d1f7

Please sign in to comment.