public class ImageCalculator extends Object
int width = 255;
int height = 255;
ImageProcessor image1 = new ByteProcessor(width, height);
ImageProcessor image2 = new ByteProcessor(width, height);
for (int i = 0; i < width; i++)
{
for (int j = 0; j < height; j++)
{
image1.set(i, j, i);
image2.set(j, i, i);
}
}
ImageCalculator.Operation op = ImageCalculator.Operation.MAX;
ImageProcessor result = ImageCalculator.combineImages(image1, image2, op);
new ImagePlus("result", result).show();
Modifier and Type | Class and Description |
---|---|
static interface |
ImageCalculator.Operation
General interface for defining an operation that combines the values of
two pixels to create a new one.
|
Constructor and Description |
---|
ImageCalculator() |
Modifier and Type | Method and Description |
---|---|
static ij.ImagePlus |
combineImages(ij.ImagePlus image1,
ij.ImagePlus image2,
ImageCalculator.Operation op)
Combines two images using the specified operation.
|
static ij.process.ImageProcessor |
combineImages(ij.process.ImageProcessor image1,
ij.process.ImageProcessor image2,
ImageCalculator.Operation op)
Example that computes the maximum over two images:
|
static ij.ImageStack |
combineImages(ij.ImageStack image1,
ij.ImageStack image2,
ImageCalculator.Operation op)
Combines two images using the specified operation.
|
static ij.ImagePlus |
not(ij.ImagePlus image)
Computes the binary "not" operation on the input image.
|
static ij.process.ImageProcessor |
not(ij.process.ImageProcessor image)
Computes the binary "not" operation on the input 2D image.
|
static ij.ImageStack |
not(ij.ImageStack image)
Computes the binary "not" operation on the input 3D image.
|
public static final ij.ImagePlus combineImages(ij.ImagePlus image1, ij.ImagePlus image2, ImageCalculator.Operation op)
image1
- the first imageimage2
- the second imageop
- the operation to applypublic static final ij.process.ImageProcessor combineImages(ij.process.ImageProcessor image1, ij.process.ImageProcessor image2, ImageCalculator.Operation op)
ImageProcessor image1 = ...
ImageProcessor image2 = ...
ImageProcessor result = ImageCalculator.combineImages(
image1, image2, ImageCalculator.Operation.MAX);
image1
- the first input imageimage2
- the second input imageop
- the operation to applypublic static final ij.ImageStack combineImages(ij.ImageStack image1, ij.ImageStack image2, ImageCalculator.Operation op)
image1
- the first imageimage2
- the second imageop
- the operation to applypublic static final ij.ImagePlus not(ij.ImagePlus image)
image
- the input imagepublic static final ij.process.ImageProcessor not(ij.process.ImageProcessor image)
image
- the input imagepublic static final ij.ImageStack not(ij.ImageStack image)
image
- the input imageCopyright © 2014–2023 INRA-IJPB Modeling and Digital Imaging lab. All rights reserved.