Skip to content

Commit

Permalink
2022.12.31 (1.54a35; IJ.URL)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasband committed Dec 31, 2022
1 parent a180533 commit 1d27fcf
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 16 deletions.
2 changes: 1 addition & 1 deletion ij/IJ.java
Expand Up @@ -41,7 +41,7 @@ public class IJ {
/** Image display modes */
public static final int COMPOSITE=1, COLOR=2, GRAYSCALE=3;

public static final String URL = "http://imagej.nih.gov/ij";
public static final String URL = "http://imagej.net/ij";
public static final int ALL_KEYS = -1;

/** Use setDebugMode(boolean) to enable/disable debug mode. */
Expand Down
2 changes: 1 addition & 1 deletion ij/ImageJ.java
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.54a";
public static final String BUILD = "28";
public static final String BUILD = "35";
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
2 changes: 1 addition & 1 deletion ij/plugin/BrowserLauncher.java
Expand Up @@ -60,7 +60,7 @@ public class BrowserLauncher implements PlugIn {
public void run(String theURL) {
if (error) return;
if (theURL==null || theURL.equals(""))
theURL = "http://imagej.org";
theURL = IJ.URL;
try {openURL(theURL);}
catch (IOException e) {}
}
Expand Down
3 changes: 2 additions & 1 deletion ij/plugin/Options.java
Expand Up @@ -165,12 +165,13 @@ void conversions() {
double[] weights = ColorProcessor.getWeightingFactors();
boolean weighted = !(weights[0]==1d/3d && weights[1]==1d/3d && weights[2]==1d/3d);
//boolean weighted = !(Math.abs(weights[0]-1d/3d)<0.0001 && Math.abs(weights[1]-1d/3d)<0.0001 && Math.abs(weights[2]-1d/3d)<0.0001);
GenericDialog gd = new GenericDialog("Conversion Options");
GenericDialog gd = new GenericDialog("Type Conversion Options");
gd.addCheckbox("Scale when converting", ImageConverter.getDoScaling());
String prompt = "Weighted RGB conversions";
if (weighted)
prompt += " (" + IJ.d2s(weights[0]) + "," + IJ.d2s(weights[1]) + ","+ IJ.d2s(weights[2]) + ")";
gd.addCheckbox(prompt, weighted);
gd.addHelp(IJ.URL+"/docs/menus/edit.html#conversions");
gd.showDialog();
if (gd.wasCanceled())
return;
Expand Down
3 changes: 2 additions & 1 deletion ij/plugin/filter/MaximumFinder.java
Expand Up @@ -223,7 +223,8 @@ public void run(ImageProcessor ip) {
}
ByteProcessor outIp = null;
boolean strictMode = oldMacro ? excludeOnEdges : strict;
outIp = findMaxima(ip, tolerance, strictMode, threshold, outputType, excludeOnEdges, false); //process the image
boolean isEDM = imp!=null && imp.getBitDepth()==32 && imp.getTitle().startsWith("EDM of ");
outIp = findMaxima(ip, tolerance, strictMode, threshold, outputType, excludeOnEdges, isEDM); //process the image
if (outIp == null) return; //cancelled by user or previewing or no output image
if (!Prefs.blackBackground) //normally, output has an inverted LUT, "active" pixels black (255) - like a mask
outIp.invertLut();
Expand Down
11 changes: 8 additions & 3 deletions ij/process/FloatProcessor.java
Expand Up @@ -445,7 +445,6 @@ public void applyTable(int[] lut) {}

private void process(int op, double value) {
float c, v1, v2;
//boolean resetMinMax = roiWidth==width && roiHeight==height && !(op==FILL);
c = (float)value;
float min2=0f, max2=0f;
if (op==INVERT)
Expand Down Expand Up @@ -514,8 +513,14 @@ private void process(int op, double value) {
}
}

/** Each pixel in the image is inverted using p=max-(p-min), where 'min'
and 'max' are the display range limits set using setMinAndMax(). */
/** Each pixel in the image or ROI is inverted using
* p=max-(p-min), where 'min' and 'max' are the minimum
* and maximum displayed pixel values.
* @see #getMin
* @see #getMax
* @see #setMinAndMax
* @see #resetMinAndMax
*/
public void invert() {
process(INVERT, 0.0);
}
Expand Down
4 changes: 2 additions & 2 deletions ij/process/ImageConverter.java
Expand Up @@ -66,13 +66,13 @@ public void convertToGray16() {
imp.setCalibration(imp.getCalibration()); //update calibration
}

private void record() {
public static void record() {
if (Recorder.record) {
Boolean state = ImageConverter.getDoScaling();
if (Recorder.scriptMode())
Recorder.recordCall("ImageConverter.setDoScaling("+state+");", true);
else
Recorder. recordString("setOption(\"ScaleConversions\", "+state+");\n");
Recorder.recordString("setOption(\"ScaleConversions\", "+state+");\n");
}
}

Expand Down
21 changes: 18 additions & 3 deletions ij/process/ImageProcessor.java
Expand Up @@ -475,10 +475,10 @@ public void setGlobalBackgroundColor() {
setValue(value);
}

/** Returns the smallest displayed pixel value. */
/** Returns the minimum displayed pixel value. */
public abstract double getMin();

/** Returns the largest displayed pixel value. */
/** Returns the maximum displayed pixel value. */
public abstract double getMax();

/** This image will be displayed by mapping pixel values in the
Expand Down Expand Up @@ -2108,7 +2108,22 @@ Use setSnapshotPixels(null) to clear the snapshot buffer. */
supported. */
public abstract void applyTable(int[] lut);

/** Inverts the image or ROI. */
/** Inverts the image or ROI.
* <p>
* With 8-bit images, p=255-p.
* <p>
* With RGB images, converts each pixel to
* three 8-bit pixels and uses p=255-p.
* <p>
* With 16-bit images, p=65535-p, or p=255-p,
* p=1024-p, etc. if an "Unsigned 16-bit range"
* is set using the "Set" option of the
* Image&gt;Adjust&gt;Brightness/Contrast dialog.
* <p>
* With 32-bit images, p=max-(p-min), where 'min'
* and 'max' are the minimum and maximum displayed
* pixel values.
*/
public void invert() {process(INVERT, 0.0);}

/** Adds 'value' to each pixel in the image or ROI. */
Expand Down
9 changes: 8 additions & 1 deletion ij/process/ShortProcessor.java
Expand Up @@ -497,7 +497,6 @@ private void process(int op, double value) {
switch(op) {
case INVERT:
v2 = max2 - (v1 - min2);
//v2 = 65535 - (v1+offset);
break;
case FILL:
v2 = fgColor2;
Expand Down Expand Up @@ -570,6 +569,14 @@ private void process(int op, double value) {
}
}

/** The image or ROI is inverted using the full
* pixel value range (0-65535) or, if set, using
* the "Unsigned 16-bit range" in the "Set" option
* of the Image&gt;Adjust&gt;Brightness/Contrast
* dialog.
* @see ij.ImagePlus#setDefault16bitRange
* @see ij.ImagePlus#getDefault16bitRange
*/
public void invert() {
int range = 65536;
int defaultRange = ij.ImagePlus.getDefault16bitRange();
Expand Down
4 changes: 3 additions & 1 deletion ij/process/StackConverter.java
Expand Up @@ -74,6 +74,7 @@ public void convertToGray8() {
((CompositeImage)imp).resetDisplayRanges();
((CompositeImage)imp).updateAllChannelsAndDraw();
}
ImageConverter.record();
imp.setSlice(currentSlice);
IJ.showProgress(1.0);
}
Expand Down Expand Up @@ -149,6 +150,7 @@ public void convertToGray16() {
imp.setDisplayRange(0,65535);
}
}
ImageConverter.record();
}

/** Converts this Stack to 32-bit (float) grayscale. */
Expand Down Expand Up @@ -322,6 +324,6 @@ public void convertToIndexedColor(int nColors) {
}
imp.setStack(null, stack2);
imp.setTypeToColor256();
}
}

}
9 changes: 8 additions & 1 deletion release-notes.html
Expand Up @@ -5,19 +5,23 @@
</head>
<body>

<li> <u>1.54a28 27 December 2022</u>
<li> <u>1.54a35 31 December 2022</u>
<ul>
<li> Thanks to Herbie Gluender, added the
<i>Process&gt;Binary&gt;Median</i>
command and the ImageProcessor.threshold(level1,level2)
method.
<li> Thanks to Michael Cammer, setOption("ScaleConversions",boolean)
is recorded when doing stack conversions.
<li> Thanks to Christian Tischer, added the
AVI_Reader.open(path,options) method.
<li> Thanks to Wilhelm Burger, added the GenericDialog.addEnumChoice()
method
(<a href="http://wsr.imagej.net/macros/AddEnumChoice.bsh">BeanShell example</a>).
<li> Thanks to Wilhelm Burger, added the ImageProcessor.isThreshold()
method.
<li> Changed the URL constant in IJ.java from "http://imagej.nih.gov/ij"
to "http://imagej.net/ij".
<li> Thanks to Andrew McCall, fixed a bug that caused the
<i>Image&gt;Transform&gt;Rotate</i> command to fail when rotating
very large stacks. Processing is now slower because
Expand All @@ -36,6 +40,9 @@
<li> Thanks to Wilhelm Burger, fixed bugs that caused some of the
<i>Image&gt;Adjust&gt;Threshold</i> auto thresholding methods to
not work with bilevel images.
<li> Thanks to Diego Perez Dones and Olivier Burri, fixed a bug that caused
the <i>Process&gt;Find Maxima</i> command to not work as expected with
float EDM images.
</ul>

<li> <u>1.53v 21 November 2022</u>
Expand Down

0 comments on commit 1d27fcf

Please sign in to comment.