Package inra.ijpb.shape
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 imageleft
- the number of pixels to add to the left of the imageright
- the number of pixels to add to the right of the imagetop
- the number of pixels to add on top of the imagebottom
- 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 imageleft
- the number of pixels to add to the left of the imageright
- the number of pixels to add to the right of the imagetop
- the number of pixels to add on top of the imagebottom
- the number of pixels to add at the bottom of the imagefront
- the number of pixels to add on the front of the imageback
- 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 cropx0
- the x-position of the upper-left corner of the region to cropy0
- the y-position of the upper-left corner of the region to cropwidth
- the width of the region to cropheight
- 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 cropx0
- the x-position of the upper-left corner of the region to cropy0
- the y-position of the upper-left corner of the region to cropz0
- the z-position of the upper-left corner of the region to cropwidth
- the width of the region to cropheight
- the height of the region to cropdepth
- the depth of the region to crop- Returns:
- a new ImageStack corresponding to the cropped region.
-