public class ImageStack
extends java.lang.Object
ImagePlus
Constructor and Description |
---|
ImageStack()
Default constructor.
|
ImageStack(int width,
int height)
Creates a new, empty image stack.
|
ImageStack(int width,
int height,
java.awt.image.ColorModel cm)
Creates a new, empty image stack using the specified color model.
|
ImageStack(int width,
int height,
int size)
Creates a new, empty image stack with a capacity of 'size'.
|
Modifier and Type | Method and Description |
---|---|
void |
addSlice(ImageProcessor ip)
Adds the image in 'ip' to the end of the stack.
|
void |
addSlice(java.lang.String sliceLabel,
ImageProcessor ip)
Adds the image in 'ip' to the end of the stack, setting
the string 'sliceLabel' as the slice metadata.
|
void |
addSlice(java.lang.String sliceLabel,
ImageProcessor ip,
int n)
Adds the image in 'ip' to the stack following slice 'n'.
|
void |
addSlice(java.lang.String sliceLabel,
java.lang.Object pixels)
Adds an image in the form of a pixel array to the end of the stack.
|
void |
addUnsignedShortSlice(java.lang.String sliceLabel,
java.lang.Object pixels)
Deprecated.
Short images are always unsigned.
|
ImageStack |
convertToFloat()
Creates a float version of this stack.
|
static ImageStack |
create(int width,
int height,
int depth,
int bitdepth)
Creates a new ImageStack.
|
ImageStack |
crop(int x,
int y,
int z,
int width,
int height,
int depth)
Creates a new stack by cropping this one.
|
void |
deleteLastSlice()
Deletes the last slice in the stack.
|
void |
deleteSlice(int n)
Deletes the specified slice, were 1<=n<=nslices.
|
void |
drawSphere(double radius,
int xc,
int yc,
int zc)
Experimental
|
ImageStack |
duplicate()
Duplicates this stack.
|
int |
getBitDepth()
Returns the bit depth (8=byte, 16=short, 24=RGB, 32=float).
|
java.awt.image.ColorModel |
getColorModel()
Returns this stack's color model.
|
int |
getHeight() |
java.lang.Object[] |
getImageArray()
Returns the stack as an array of 1D pixel arrays.
|
java.lang.Object |
getPixels(int n)
Returns the pixel array for the specified slice, were 1<=n<=nslices.
|
ImageProcessor |
getProcessor(int n)
Returns an ImageProcessor for the specified slice,
were 1<=n<=nslices.
|
java.awt.Rectangle |
getRoi() |
java.lang.String |
getShortSliceLabel(int n)
Returns a shortened version (up to the first 60 characters or first newline and
suffix removed) of the label of the specified slice.
|
int |
getSize()
Returns the number of slices in this stack.
|
java.lang.String |
getSliceLabel(int n)
Returns the label of the specified slice, were 1<=n<=nslices.
|
java.lang.String[] |
getSliceLabels()
Returns the slice labels as an array of Strings.
|
double |
getVoxel(int x,
int y,
int z)
Returns, as a double, the specified voxel.
|
float[] |
getVoxels(int x0,
int y0,
int z0,
int w,
int h,
int d,
float[] voxels)
Experimental
|
float[] |
getVoxels(int x0,
int y0,
int z0,
int w,
int h,
int d,
float[] voxels,
int channel)
Experimental
|
int |
getWidth() |
boolean |
isHSB()
Returns true if this is a 3-slice HSB stack.
|
boolean |
isRGB()
Returns true if this is a 3-slice RGB stack.
|
boolean |
isVirtual()
Returns true if this is a virtual (disk resident) stack.
|
void |
setColorModel(java.awt.image.ColorModel cm)
Assigns a new color model to this stack.
|
void |
setPixels(java.lang.Object pixels,
int n)
Assigns a pixel array to the specified slice,
were 1<=n<=nslices.
|
void |
setProcessor(ImageProcessor ip,
int n)
Assigns the pixel array of an ImageProcessor to the
specified slice, were 1<=n<=nslices.
|
void |
setRoi(java.awt.Rectangle roi) |
void |
setSliceLabel(java.lang.String label,
int n)
Sets the label of the specified slice, were 1<=n<=nslices.
|
void |
setVoxel(int x,
int y,
int z,
double value) |
void |
setVoxels(int x0,
int y0,
int z0,
int w,
int h,
int d,
float[] voxels)
Experimental
|
void |
setVoxels(int x0,
int y0,
int z0,
int w,
int h,
int d,
float[] voxels,
int channel)
Experimental
|
java.lang.String |
toString() |
void |
trim()
Frees memory by deleting a few slices from the end of the stack.
|
void |
update(ImageProcessor ip)
Updates this stack so its attributes, such as min, max,
calibration table and color model, are the same as 'ip'.
|
public ImageStack()
public ImageStack(int width, int height)
public ImageStack(int width, int height, int size)
public ImageStack(int width, int height, java.awt.image.ColorModel cm)
public void addSlice(java.lang.String sliceLabel, java.lang.Object pixels)
public void addUnsignedShortSlice(java.lang.String sliceLabel, java.lang.Object pixels)
public void addSlice(ImageProcessor ip)
public void addSlice(java.lang.String sliceLabel, ImageProcessor ip)
public void addSlice(java.lang.String sliceLabel, ImageProcessor ip, int n)
public void deleteSlice(int n)
public void deleteLastSlice()
public int getWidth()
public int getHeight()
public void setRoi(java.awt.Rectangle roi)
public java.awt.Rectangle getRoi()
public void update(ImageProcessor ip)
public java.lang.Object getPixels(int n)
public void setPixels(java.lang.Object pixels, int n)
public java.lang.Object[] getImageArray()
public int getSize()
public java.lang.String[] getSliceLabels()
public java.lang.String getSliceLabel(int n)
public java.lang.String getShortSliceLabel(int n)
public void setSliceLabel(java.lang.String label, int n)
public ImageProcessor getProcessor(int n)
public void setProcessor(ImageProcessor ip, int n)
public void setColorModel(java.awt.image.ColorModel cm)
public java.awt.image.ColorModel getColorModel()
public boolean isRGB()
public boolean isHSB()
public boolean isVirtual()
public void trim()
public java.lang.String toString()
toString
in class java.lang.Object
public final double getVoxel(int x, int y, int z)
public final void setVoxel(int x, int y, int z, double value)
public float[] getVoxels(int x0, int y0, int z0, int w, int h, int d, float[] voxels)
public float[] getVoxels(int x0, int y0, int z0, int w, int h, int d, float[] voxels, int channel)
public void setVoxels(int x0, int y0, int z0, int w, int h, int d, float[] voxels)
public void setVoxels(int x0, int y0, int z0, int w, int h, int d, float[] voxels, int channel)
public void drawSphere(double radius, int xc, int yc, int zc)
public int getBitDepth()
public static ImageStack create(int width, int height, int depth, int bitdepth)
width
- width in pixelsheight
- height in pixelsdepth
- number of imagesbitdepth
- 8, 16, 32 (float) or 24 (RGB)public ImageStack duplicate()
public ImageStack crop(int x, int y, int z, int width, int height, int depth)
public ImageStack convertToFloat()