Class ImageShape

java.lang.Object
inra.ijpb.shape.ImageShape

public class ImageShape
extends java.lang.Object
A collection of utility method for processing global shape of images: crop, add borders...
Author:
dlegland
  • Method Summary

    Modifier and Type Method Description
    static ij.ImageStack addBorders​(ij.ImageStack image, int left, int right, int top, int bottom, int front, int back)
    Adds the specified number of voxels around the input image, and returns the resulting image.
    static ij.process.ImageProcessor addBorders​(ij.process.ImageProcessor image, int left, int right, int top, int bottom)
    Adds the specified number of pixels around the input image, and returns the resulting image.
    static ij.ImageStack cropRect​(ij.ImageStack image, int x0, int y0, int z0, int width, int height, int depth)
    Crops a rectangular region from the input 3D image.
    static ij.process.ImageProcessor cropRect​(ij.process.ImageProcessor image, int x0, int y0, int width, int height)
    Crops a rectangular region from the input image.

    Methods inherited from class java.lang.Object

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

    • addBorders

      public static final ij.process.ImageProcessor addBorders​(ij.process.ImageProcessor image, int left, int right, int top, int bottom)
      Adds the specified number of pixels around the input image, and returns the resulting image.
      Parameters:
      image - the input image
      left - the number of pixels to add to the left of the image
      right - the number of pixels to add to the right of the image
      top - the number of pixels to add on top of the image
      bottom - the number of pixels to add at the bottom of the image
      Returns:
      a new image with extended borders
    • addBorders

      public static final ij.ImageStack addBorders​(ij.ImageStack image, int left, int right, int top, int bottom, int front, int back)
      Adds the specified number of voxels around the input image, and returns the resulting image.
      Parameters:
      image - the input image
      left - the number of pixels to add to the left of the image
      right - the number of pixels to add to the right of the image
      top - the number of pixels to add on top of the image
      bottom - the number of pixels to add at the bottom of the image
      front - the number of pixels to add on the front of the image
      back - the number of pixels to add at the back of the image
      Returns:
      a new ImageStack with extended borders
    • cropRect

      public static final ij.process.ImageProcessor cropRect​(ij.process.ImageProcessor image, int x0, int y0, int width, int height)
      Crops a rectangular region from the input image.
      Parameters:
      image - the image to crop
      x0 - the x-position of the upper-left corner of the region to crop
      y0 - the y-position of the upper-left corner of the region to crop
      width - the width of the region to crop
      height - the height of the region to crop
      Returns:
      a new ImageProcessor corresponding to the cropped region.
    • cropRect

      public static final ij.ImageStack cropRect​(ij.ImageStack image, int x0, int y0, int z0, int width, int height, int depth)
      Crops a rectangular region from the input 3D image.
      Parameters:
      image - the image to crop
      x0 - the x-position of the upper-left corner of the region to crop
      y0 - the y-position of the upper-left corner of the region to crop
      z0 - the z-position of the upper-left corner of the region to crop
      width - the width of the region to crop
      height - the height of the region to crop
      depth - the depth of the region to crop
      Returns:
      a new ImageStack corresponding to the cropped region.