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 SummaryModifier and Type Method Description static ij.ImageStackaddBorders(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.ImageProcessoraddBorders(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.ImageStackcropRect(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.ImageProcessorcropRect(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.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
- 
Method Details- 
addBorderspublic 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
 
- 
addBorderspublic 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
 
- 
cropRectpublic 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.
 
- 
cropRectpublic 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.
 
 
-