Skip to content
Snippets Groups Projects
Commit e9cbc727 authored by Stéphane  DALLONGEVILLE's avatar Stéphane DALLONGEVILLE
Browse files

Added new GetActiveImagePlus block

parent 434dbdef
No related branches found
No related tags found
No related merge requests found
package plugins.adufour.blocks.tools.ij;
import icy.plugin.abstract_.Plugin;
import ij.IJ;
import ij.ImagePlus;
import ij.WindowManager;
import plugins.adufour.blocks.util.VarList;
import plugins.adufour.vars.lang.VarImagePlus;
public class GetActiveImagePlus extends Plugin implements IJBlock
{
VarImagePlus ip = new VarImagePlus("ImagePlus", null);
@Override
public void declareInput(VarList inputMap)
{
//
}
@Override
public void declareOutput(VarList outputMap)
{
outputMap.add("ImagePlus", ip);
}
@Override
public void run()
{
// Set the output image (if available) with the following priority
ImagePlus imgPlus = IJ.getImage();
// Default to the current "temporary" image (if any)
if (imgPlus == null)
imgPlus = WindowManager.getTempCurrentImage();
ip.setValue(imgPlus);
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment