Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Oct 28, 2020
2 parents 105e497 + 4c8b596 commit ba0a59c
Show file tree
Hide file tree
Showing 39 changed files with 1,008 additions and 509 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: java
jdk: openjdk8
jdk: openjdk11
branches:
only:
- master
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@ history of the [ImageJ 1.x](https://imagej.net/ImageJ1) project, with a proper
without hassles.

See the [ImageJA page](https://imagej.net/ImageJA) for details.

## Editing this repository

Because much of the content in this repository is generated automatically, depending on the type of change you want to make your edit should go in one of three places:

* Source file content changes (e.g. bug fixes) should go to the [ImageJ1 repository](https://github.com/imagej/imagej1).
* Source file *location* changes (e.g. moving a file to the correct package) go in the [IJ1-builds repository](https://github.com/imagej/ij1-builds).
* Changes to the build structure (e.g. `pom.xml` updates) can be done directly in this repository.
69 changes: 68 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>net.imagej</groupId>
<artifactId>ij</artifactId>
<version>1.53e</version>
<version>1.53f</version>

<name>ImageJ</name>
<description>ImageJ is an open source Java image processing program inspired by NIH Image for the Macintosh.</description>
Expand Down Expand Up @@ -90,6 +90,7 @@

<!-- NB: Deploy releases to the SciJava Maven repository. -->
<releaseProfiles>sonatype-oss-release</releaseProfiles>

</properties>

<dependencies>
Expand All @@ -106,6 +107,72 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-compile</id>
<configuration>
<!-- compile everything to ensure module-info contains right entries -->
<!-- required when JAVA_HOME is JDK 8 or below -->
<jdkToolchain>
<version>9</version>
</jdkToolchain>
<!-- Exclude MacAdapter because it requires internal packages -->
<excludes>
<exclude>**/MacAdapter.java</exclude>
</excludes>
<release>9</release>
</configuration>
</execution>
<execution>
<id>complete-recompile</id>
<goals>
<goal>compile</goal>
</goals>
<!-- recompile everything for target VM except the module-info.java -->
<configuration>
<excludes>
<exclude>**/module-info.java</exclude>
</excludes>

<!-- Force recompilation. NB: This is the stupidest bug ever.
See https://issues.apache.org/jira/browse/MCOMPILER-209
-->
<useIncrementalCompilation>true</useIncrementalCompilation>
</configuration>
</execution>
</executions>
<!-- defaults for compile and testCompile -->
<configuration>
<!-- jdkToolchain required when JAVA_HOME is JDK 9 or above -->
<jdkToolchain>
<version>[1.6,8)</version>
</jdkToolchain>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<!-- Avoid failing due to IJ1 javadoc errors -->
<doclint>none</doclint>

<!-- Required to build with Java 11+
See https://bugs.openjdk.java.net/browse/JDK-8212233
-->
<source>8</source>
<links>
<link>https://imagej.nih.gov/ij/developer/api/</link>
</links>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>javac</id>
Expand Down
78 changes: 72 additions & 6 deletions release-notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,76 @@
</head>
<body>

<li> <u>1.53e 12 September 2020</u>
<li> <u>1.53f 22 October 2020</u>
<ul>
<li> Thanks to Wei Ouyang, tool bar and image popup menus are
now triggered by a long presses in addition to right clicks, This is needed
because right clicks are not possible when
<a href="https://ij.imjoy.io/">Image.JS</a>
is running on Android and iOS devices.
<li> Thanks to Wei Ouyang, added a popup menu to the
magnifying glass tool icon.
<li> Added a popup menu that is triggered when you right click or
long press inside a selection.
<li> Updated the built in toolbar "Dev" menu.
<li> Thanks to Michael Schmid, the text in a text selection can now
be edited in the <i>Edit&gt;Selection&gt;Properties</i>
dialog.
<li> Thanks to Stein Rorvik, the <i>File&gt;Import&gt;Image Sequence</i>
dialog is used when drag and dropping a folder on the
"ImageJ" window.
<li> Thanks to Michael Schmid and Thomas Fischer, Undo works with
overlays when translating and rotating images and the "Overlay only"
checkbox is only shown in the Translate dialog when there
is an overlay.
<li> Thanks to Robert Haase, added the <i>Edit&gt;Options&gt;Fresh Start</i>
command, which closes all images, empties the ROI Manager, clears the
Results table and enables the "Black background" option.
<li> Thanks to Conner Phillips and Stein Rorvik, the <i>Reslice</i> command
is faster on Windows when re-slicing from "Left" or "Right" and it
uses an ordinary progress bar when run from a macro.
<li> Thanks to Stein Rorvik, added an "Open as separate images" checkbox
to the <i>File&gt;Import&gt;Image Sequence</i> dialog.
<li> Thanks to Stein Rorvik, Added "Foreground..." and "Background..." entries
to the new color picker tool popup menu.
<li> Thanks to 'MIKEIII' and Dmitry Fedorov, added the Image.width, Image.height,
Image.copy and Image.paste(x,y) macro functions DOCUMENT
(<a href="http://wsr.imagej.net/macros/PasteDemo.txt">example</a>).
<li> Thanks to Stein Rorvik, added the Array.filter(arr,str),
Math.toRadians(degrees) and Math.toDegrees(radians) functions. DOCUMENT
<li> Thanks to Nima Hojat, added the ResultsTable.addRow()
method. For an example, run
<i>Help&gt;Examples&gt;JavaScript&gt;Sine/Cosine Table</i>.
<li> Thanks to Philippe Carl, fixed a bug that caused the
RoiManager.getSelectedIndexes() method to sometimes not
work as expected.
<li> Thanks to Christian Tischer, fixed a bug that slowed saving of
virtual stacks as TIFF stacks.
<li> Thanks to Thomas Fischer, fixed a bug that caused the
dynamic "Value" and "Count" values in HIstogram windows
to sometimes not be displayed correctly.
<li> Thanks to Gaurav Joshi, fixed a bug that caused the
Ctrl+F (Edit>Fill) keyboard shortcut on Windows, when
used on a stack, to not display the "Proces Stack?" dialog.
<li> Thanks to 'Quiroz-1', fixed a 1.53e regression that caused
the imageCaculator() macro function do somethimes not
work as expected.
<li> Thanks to Pradeep Rajasekhar and Jan Eglinger, fixed a 1.52
regression that caused the Analyze Skeleton plugin to output
incorrect Results tables.
<li> Thanks to 'tongtao', fixed a regression that caused the
<i>Edit&gt;Copy to Image Info</i> command in the text
editor to fail.
<li> Thanks to Stein Rorvik, fixed a 1.53c regression in the AVI Reader
that caused it to throw a null pointer exception.
<li> Thanks to Eric Perlman, fixed a 1.52 regresion that caused the
IJ.getImage() method to sometimes display model error dialogs.
</ul>

<li> <u>1.53e 16 September 2020</u>
<ul>
<li> Thanks to Michael Schmid, the color picker tool has
a new icon and a new right click drop down menu.
a new icon and a right click drop down menu.
<li> The "Black background" option is no longer
saved in the preferences file. Add
setOption("BlackBackground",true) to Edit>Options>Startup
Expand All @@ -17,7 +83,7 @@
<i>Edit&gt;Selection&gt;Add to Manager</i> command.
<li> Thanks to Michael Ellis, added a module-info.java file,
used by the Java Module System, to the ImageJ source.
<li> Thanks to 'mkhapp', added the RoiManager.selected macro DOCUMENT
<li> Thanks to 'mkhapp', added the RoiManager.selected macro
function, which returns the number of selected ROIs in the
ROI Manager
(<a href="http://wsr.imagej.net/macros/SetGroupDemo.txt">example</a>).
Expand All @@ -26,12 +92,12 @@
of the Color Picker to be opened.
<li> Thanks to 'Ben', fixed a bug that caused the Table.get()
macro function to return strings instead of numbers.
<li>Thanks to Fred Damen and Michael chmid, fixed a bug
<li>Thanks to Fred Damen and Michael Schmid, fixed a bug
that caused the run("Copy to System") macro function to
sometimes copy the wrong image to the system clipboard.
<li>Thanks to Fred Damen, fixed a bug that caused unreliable
zooming of images with selections when using the arrow keys
and shift or control.
while holding the shift or control key down.
<li>Thanks to Fred Damen, fixed a bug that caused the
img3=ImageCalculator.run(img1,img2,operation) method
to return null if the 'operation' string did not contain
Expand All @@ -42,7 +108,7 @@
<li> Thanks to Robert Svoboda, fixed a 1.53d regression on
Windows that could cause the getDirectory() macro function
to throw an exception or crash ImageJ.
<li> Thanks to Stein Rorvik, fixed a 1.53d regression that caused
<li> Thanks to Stein Rorvik, fixed a 1.53d regression that could cause
the run("Image Sequence...",options) macro function to fail.
</ul>

Expand Down
21 changes: 11 additions & 10 deletions src/main/java/ij/IJ.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,21 @@ public static void setDebugMode(boolean b) {
LogStream.redirectSystem(debugMode);
}

/** Runs the macro contained in the string <code>macro</code>.
Returns any string value returned by the macro, null if the macro
does not return a value, or "[aborted]" if the macro was aborted
due to an error. The equivalent macro function is eval(). */
/** Runs the macro contained in the string <code>macro</code>
on the current thread. Returns any string value returned by
the macro, null if the macro does not return a value, or
"[aborted]" if the macro was aborted due to an error. The
equivalent macro function is eval(). */
public static String runMacro(String macro) {
return runMacro(macro, "");
}

/** Runs the macro contained in the string <code>macro</code>.
The optional string argument can be retrieved in the
called macro using the getArgument() macro function.
Returns any string value returned by the macro, null if the macro
does not return a value, or "[aborted]" if the macro was aborted
due to an error. */
/** Runs the macro contained in the string <code>macro</code>
on the current thread. The optional string argument can be
retrieved in the called macro using the getArgument() macro
function. Returns any string value returned by the macro, null
if the macro does not return a value, or "[aborted]" if the
macro was aborted due to an error. */
public static String runMacro(String macro, String arg) {
if(EventQueue.isDispatchThread()){
Macro_Runner mr = new Macro_Runner();
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/ij/ImageJ.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public class ImageJ extends Frame implements ActionListener,
MouseListener, KeyListener, WindowListener, ItemListener, Runnable {

/** Plugins should call IJ.getVersion() or IJ.getFullVersion() to get the version string. */
public static final String VERSION = "1.53e";
public static final String BUILD = ""; //23
public static final String VERSION = "1.53f";
public static final String BUILD = "51";
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 Expand Up @@ -549,7 +549,7 @@ else if (roi!=null) {

if (cmd!=null && !cmd.equals("")) {
commandName = cmd;
if (cmd.equals("Fill")||cmd.equals("Draw"))
if (!control && !meta && (cmd.equals("Fill")||cmd.equals("Draw")))
hotkey = true;
if (cmd.charAt(0)==MacroInstaller.commandPrefix)
MacroInstaller.runMacroShortcut(cmd);
Expand Down
28 changes: 23 additions & 5 deletions src/main/java/ij/ImagePlus.java
Original file line number Diff line number Diff line change
Expand Up @@ -2804,7 +2804,7 @@ public void paste() {
cr = cRoi.getBounds();
if (cr==null)
cr = new Rectangle(0, 0, w, h);
if (r==null || (cr.width!=r.width || cr.height!=r.height)) {
if (r==null || Math.abs(cr.width-r.width)>10 || Math.abs(cr.height-r.height)>10) {
// Create a new roi centered on visible part of image, or centered on image if clipboard is >= image
ImageCanvas ic = win!=null?ic = win.getCanvas():null;
Rectangle srcRect = ic!=null?ic.getSrcRect():new Rectangle(0,0,width,height);
Expand Down Expand Up @@ -2841,12 +2841,30 @@ public void paste() {
}
changes = true;
}

/** Returns the internal clipboard or null if the internal clipboard is empty. */
public static ImagePlus getClipboard() {
return clipboard;

/** Inserts the contents of the internal clipboard at the
specified location, without updating the display. */
public void paste(int x, int y) {
if (clipboard==null)
return;
Roi roi = clipboard.getRoi();
boolean nonRect = roi!=null && roi.getType()!=Roi.RECTANGLE;
if (nonRect)
ip.snapshot();
ip.insert(clipboard.getProcessor(), x, y);
if (nonRect) {
ImageProcessor mask = roi.getMask();
ip.setRoi(x, y, mask.getWidth(), mask.getHeight());
ip.setMask(mask);
ip.reset(ip.getMask());
}
}

/** Returns the internal clipboard or null if the internal clipboard is empty. */
public static ImagePlus getClipboard() {
return clipboard;
}

/** Clears the internal clipboard. */
public static void resetClipboard() {
clipboard = null;
Expand Down
Loading

0 comments on commit ba0a59c

Please sign in to comment.