Package ij.plugin
Class ImageCalculator
- java.lang.Object
-
- ij.plugin.ImageCalculator
-
- All Implemented Interfaces:
PlugIn
public class ImageCalculator extends java.lang.Object implements PlugIn
This plugin implements the Process/Image Calculator command.// test script imp1 = IJ.openImage("http://imagej.nih.gov/ij/images/boats.gif") imp2 = IJ.openImage("http://imagej.nih.gov/ij/images/bridge.gif") ic = new ImageCalculator() imp3 = ic.run("Average create", imp1, imp2) imp3.show()
-
-
Constructor Summary
Constructors Constructor Description ImageCalculator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
calculate(java.lang.String options, ImagePlus img1, ImagePlus img2)
Deprecated.replaced by run(String,ImagePlus,ImagePlus)static ImagePlus
run(ImagePlus img1, ImagePlus img2, java.lang.String options)
Performs arithmetic options on two images where the 'options' argument ("add","subtract", "multiply","divide", "and", "or", "xor", "min", "max", "average", "difference" or "copy") specifies the operation.void
run(java.lang.String arg)
This method is called when the plugin is loaded.ImagePlus
run(java.lang.String options, ImagePlus img1, ImagePlus img2)
-
-
-
Method Detail
-
run
public void run(java.lang.String arg)
Description copied from interface:PlugIn
This method is called when the plugin is loaded. 'arg', which may be blank, is the argument specified for this plugin in IJ_Props.txt.
-
run
public static ImagePlus run(ImagePlus img1, ImagePlus img2, java.lang.String options)
Performs arithmetic options on two images where the 'options' argument ("add","subtract", "multiply","divide", "and", "or", "xor", "min", "max", "average", "difference" or "copy") specifies the operation. The 'options' string can include up to three modifiers: "create" (e.g., "add create") causes the result to be stored in a new window, "32-bit" causes the result to be 32-bit floating-point and "stack" causes the entire stack to be processed. For exampleimp3 = ImageCalculator.run(imp1, imp2, "divide create 32-bit");
divides 'imp1' by 'imp2' and returns the result as a new 32-bit image.
-
-