Last active
June 26, 2019 20:15
-
-
Save frauzufall/d053de527d17be78e31dcc1b8fb27c7d to your computer and use it in GitHub Desktop.
Get all open images in ImageJ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// creating images | |
Object img1 = ij.io().open("https://samples.fiji.sc/blobs.png"); | |
Object img2 = ij.io().open("https://samples.fiji.sc/new-lenna.jpg"); | |
// showing images | |
ij.ui().show(img1); | |
ij.ui().show(img2); | |
// get images | |
List<Dataset> datasets = ij.dataset().getDatasets(); | |
System.out.println(datasets); | |
String name1 = datasets.get(0).getName(); | |
String name2 = datasets.get(1).getName(); | |
// rename displays [DOES NOT TRIGGER ACTION IJ UI] | |
ij.display().getDisplay(name1).setName("X"); | |
ij.display().getDisplay(name2).setName("Y"); | |
// move img1 into focus [DOES NOT TRIGGER ACTION IJ UI] | |
Display<?> display1 = ij.display().getDisplay(name1); | |
ij.display().setActiveDisplay(display1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you!