Skip to content

Commit

Permalink
2024.02.29 (1.54i25; CellImgToVirtualStackTest)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasband committed Feb 29, 2024
1 parent efe000b commit 7579e16
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 17 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.54i";
public static final String BUILD = "21";
public static final String BUILD = "25";
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
8 changes: 3 additions & 5 deletions ij/ImagePlus.java
Original file line number Diff line number Diff line change
Expand Up @@ -843,15 +843,13 @@ else if (nScrollbars==0 && newStackSize>1)
if (currentSlice<1) setCurrentSlice(1);
boolean resetCurrentSlice = currentSlice>newStackSize;
if (resetCurrentSlice) setCurrentSlice(newStackSize);
ImageProcessor ip = newStack.getProcessor(currentSlice);
if (newStack.isVirtual()) // work around bug with cached virtual stacks
ip = ip.duplicate();
boolean dimensionsChanged = width>0 && height>0 && (width!=ip.getWidth()||height!=ip.getHeight());
ImageProcessor newIP = newStack.getProcessor(currentSlice);
boolean dimensionsChanged = width>0 && height>0 && (width!=newIP.getWidth()||height!=newIP.getHeight());
if (this.stack==null)
newStack.viewers(+1);
this.stack = newStack;
oneSliceStack = false;
setProcessor2(title, ip, newStack);
setProcessor2(title, newIP, newStack);
if (bitDepth1!=0 && bitDepth1!=getBitDepth())
compositeChanges = true;
if (compositeChanges && (this instanceof CompositeImage)) {
Expand Down
1 change: 0 additions & 1 deletion ij/VirtualStack.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ public Object getPixels(int n) {
return null;
}

/** Assigns a pixel array to the specified slice, where {@literal 1<=n<=nslices}. */
public void setPixels(Object pixels, int n) {
}

Expand Down
2 changes: 1 addition & 1 deletion ij/gui/Toolbar.java
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ public static void setForegroundColor(Color c) {
if (!IJ.isMacro()) setRoiColor(c);
ImagePlus imp = WindowManager.getCurrentImage();
if (imp!=null)
imp.getProcessor().setFillValueSet(false);
imp.getProcessor().fillColorSet(false);
}

public static Color getBackgroundColor() {
Expand Down
5 changes: 3 additions & 2 deletions ij/macro/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ void setColor() {
if (overlayPath!=null)
addDrawingToOverlay(imp);
getProcessor().setColor(globalColor);
getProcessor().setFillValueSet(true);
getProcessor().fillColorSet(true);
}
interp.getRightParen();
return;
Expand All @@ -788,7 +788,7 @@ void setColor() {
globalValue = Double.NaN;
if (WindowManager.getCurrentImage()!=null) {
getProcessor().setColor(globalColor);
getProcessor().setFillValueSet(true);
getProcessor().fillColorSet(true);
}
}

Expand All @@ -814,6 +814,7 @@ void setColor(double value) {
}
globalValue = value;
globalColor = null;
ip.fillColorSet(true);
}

void makeLine() {
Expand Down
4 changes: 2 additions & 2 deletions ij/process/ByteProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public Image createImage() {
return createBufferedImage();
}

Image createBufferedImage() {
synchronized Image createBufferedImage() {
if (raster==null) {
SampleModel sm = getIndexSampleModel();
DataBuffer db = new DataBufferByte(pixels, width*height, 0);
Expand Down Expand Up @@ -409,7 +409,7 @@ public Object getPixelsCopy() {
}
}

public void setPixels(Object pixels) {
public synchronized void setPixels(Object pixels) {
if (pixels!=null && this.pixels!=null && (((byte[])pixels).length!=this.pixels.length))
throw new IllegalArgumentException("");
this.pixels = (byte[])pixels;
Expand Down
8 changes: 4 additions & 4 deletions ij/process/ImageProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public abstract class ImageProcessor implements Cloneable {
private boolean noReset;
private boolean histogram16;
private boolean addOne;
private boolean fillColorSet;

ProgressBar progressBar;
protected int width, snapshotWidth;
Expand Down Expand Up @@ -114,7 +115,6 @@ public abstract class ImageProcessor implements Cloneable {
protected boolean minMaxSet;
protected static double seed = Double.NaN;
protected static Random rnd;
protected boolean fillValueSet;

protected void showProgress(double percentDone) {
if (progressBar!=null)
Expand Down Expand Up @@ -443,7 +443,7 @@ public void setColor(double value) {

/** Returns 'true' if the fill/draw value has been set in a macro. */
public boolean fillValueSet() {
return fillValueSet;
return fillColorSet;
}

/** Sets the background fill value used by the rotate() and scale() methods. */
Expand Down Expand Up @@ -2973,8 +2973,8 @@ protected static IndexColorModel getThresholdColorModel(byte[]reds, byte[] green
}

/** For internal use */
public void setFillValueSet(boolean set) {
fillValueSet = set;
public void fillColorSet(boolean set) {
fillColorSet = set;
}

}
5 changes: 4 additions & 1 deletion release-notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</head>
<body>

<li> <u>1.54i21 24 February 2024</u>
<li> <u>1.54i25 29 February 2024</u>
<ul>
<li> Thanks to Fred Damen, hex notation (e.g., "0xff00ff") can be
used in GenericDialog numeric fields.
Expand Down Expand Up @@ -47,6 +47,9 @@
"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> 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>.
</ul>

<li> <u>1.54h 15 December 2023</u>
Expand Down

0 comments on commit 7579e16

Please sign in to comment.