Class ImageMath

java.lang.Object
imagingbook.common.image.ImageMath

public abstract class ImageMath extends Object
This class defines static methods for non-destructive, arithmetic operations on ImageJ's ImageProcessor objects. Unlike the built-in ImageProcessor methods, the methods below always return new images (of the same type) and keep the original images unmodified.
Version:
2013/08/23: static methods converted to use generics.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends ImageProcessor>
    T
    abs(T ip)
    Calculates the absolute pixel values of the specified image and returns a new image of the same type.
    static <T extends ImageProcessor>
    T
    add(T ip1, T ip2)
    Adds the pixel values of the specified images and returns a new image of the same type as the first image.
    static <T extends ImageProcessor>
    T
    mult(T ip1, T ip2)
    Multiplies the pixel values of the specified images and returns a new image of the same type as the first image.
    static <T extends ImageProcessor>
    T
    sqr(T ip)
    Calculates the squared pixel values of the specified image and returns a new image of the same type.
    static <T extends ImageProcessor>
    T
    sqrt(T ip)
    Calculates the square root of the pixel values of the specified image and returns a new image of the same type.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • abs

      public static <T extends ImageProcessor> T abs(T ip)
      Calculates the absolute pixel values of the specified image and returns a new image of the same type.
      Type Parameters:
      T - the type of ImageProcessor
      Parameters:
      ip - the input image
      Returns:
      the resulting image
    • sqr

      public static <T extends ImageProcessor> T sqr(T ip)
      Calculates the squared pixel values of the specified image and returns a new image of the same type.
      Type Parameters:
      T - the type of ImageProcessor
      Parameters:
      ip - the input image
      Returns:
      the resulting image
    • sqrt

      public static <T extends ImageProcessor> T sqrt(T ip)
      Calculates the square root of the pixel values of the specified image and returns a new image of the same type.
      Type Parameters:
      T - the type of ImageProcessor
      Parameters:
      ip - the input image
      Returns:
      the resulting image
    • add

      public static <T extends ImageProcessor> T add(T ip1, T ip2)
      Adds the pixel values of the specified images and returns a new image of the same type as the first image.
      Type Parameters:
      T - the type of ImageProcessor
      Parameters:
      ip1 - first input image
      ip2 - second input image
      Returns:
      the resulting image
    • mult

      public static <T extends ImageProcessor> T mult(T ip1, T ip2)
      Multiplies the pixel values of the specified images and returns a new image of the same type as the first image.
      Type Parameters:
      T - the type of ImageProcessor
      Parameters:
      ip1 - first input image
      ip2 - second input image
      Returns:
      the resulting image