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

Improved CallIJPlugin block so we don't require input ImagePlus

parent 295381c2
No related branches found
No related tags found
No related merge requests found
......@@ -24,19 +24,23 @@ public class CallIJPlugin extends Plugin implements IJBlock
{
try
{
IJ.run(varIp.getValue(true), pluginName.getValue(true), pluginParams.getValue(true));
ImagePlus imgPlus = varIp.getValue(false);
String params = pluginParams.getValue(false);
if (imgPlus != null)
IJ.run(imgPlus, pluginName.getValue(true), params);
else
IJ.run(pluginName.getValue(true), params);
// Set the output image (if available) with the following priority
ImagePlus output = WindowManager.getCurrentImage();
ImagePlus output = IJ.getImage();
// Default to the current "temporary" image (if any)
if (output == null)
{
// Default to the current "temporary" image (if any)
output = WindowManager.getTempCurrentImage();
}
// Default to the input image (may have been modified "in-place"
if (output == null)
{
// Default to the input image (may have been modified "in-place"
output = varIp.getValue();
}
varActiveIP.setValue(output);
}
catch (RuntimeException e)
......
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