Package ij
Class VirtualStack
- java.lang.Object
-
- ij.ImageStack
-
- ij.VirtualStack
-
- Direct Known Subclasses:
AVI_Reader
,FileInfoVirtualStack
,ListVirtualStack
,PlotVirtualStack
public class VirtualStack extends ImageStack
This class represents an array of disk-resident images.
-
-
Constructor Summary
Constructors Constructor Description VirtualStack()
Default constructor.VirtualStack(int width, int height)
VirtualStack(int width, int height, int slices)
Creates a virtual stack with no backing storage.VirtualStack(int width, int height, ColorModel cm, String path)
Creates an empty virtual stack.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSlice(String name)
Adds an image to the end of the stack.void
addSlice(String sliceLabel, ImageProcessor ip)
Does nothing..void
addSlice(String sliceLabel, ImageProcessor ip, int n)
Does noting.void
addSlice(String sliceLabel, Object pixels)
Does nothing.void
deleteLastSlice()
Deletes the last slice in the stack.void
deleteSlice(int n)
Deletes the specified slice, were 1<=n<=nslices.int
getBitDepth()
Returns the bit depth (8, 16, 24 or 32), or 0 if the bit depth is not known.String
getDirectory()
Returns the path to the directory containing the images.String
getFileName(int n)
Returns the file name of the specified slice, were 1<=n<=nslices.Object[]
getImageArray()
Returns null.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.Properties
getProperties()
Returns the ImagePlus Properties assoctated with the current slice, or null.int
getSize()
Returns the number of slices in this stack.String
getSliceLabel(int n)
Returns the label of the Nth image.boolean
isVirtual()
Always return true.int
saveChanges(int n)
Currently not implementedvoid
setBitDepth(int bitDepth)
Sets the bit depth (8, 16, 24 or 32).void
setPixels(Object pixels, int n)
Assigns a pixel array to the specified slice, were 1<=n<=nslices.void
setSliceLabel(String label, int n)
Does nothing.ImageStack
sortDicom(String[] strings, String[] info, int maxDigits)
void
trim()
Does nothing.-
Methods inherited from class ij.ImageStack
addSlice, addUnsignedShortSlice, convertToFloat, create, crop, drawSphere, duplicate, getColorModel, getHeight, getRoi, getShortSliceLabel, getSliceLabels, getVoxel, getVoxels, getVoxels, getWidth, isHSB, isLab, isRGB, setColorModel, setProcessor, setRoi, setVoxel, setVoxels, setVoxels, size, toString, update
-
-
-
-
Constructor Detail
-
VirtualStack
public VirtualStack()
Default constructor.
-
VirtualStack
public VirtualStack(int width, int height)
-
VirtualStack
public VirtualStack(int width, int height, ColorModel cm, String path)
Creates an empty virtual stack.
-
VirtualStack
public VirtualStack(int width, int height, int slices)
Creates a virtual stack with no backing storage. This example creates a one million slice virtual stack that uses just 1MB of RAM:stack = new VirtualStack(1024,1024,1000000); new ImagePlus("No Backing Store Virtual Stack",stack).show();
-
-
Method Detail
-
addSlice
public void addSlice(String name)
Adds an image to the end of the stack.
-
addSlice
public void addSlice(String sliceLabel, Object pixels)
Does nothing.- Overrides:
addSlice
in classImageStack
-
addSlice
public void addSlice(String sliceLabel, ImageProcessor ip)
Does nothing..- Overrides:
addSlice
in classImageStack
-
addSlice
public void addSlice(String sliceLabel, ImageProcessor ip, int n)
Does noting.- Overrides:
addSlice
in classImageStack
-
deleteSlice
public void deleteSlice(int n)
Deletes the specified slice, were 1<=n<=nslices.- Overrides:
deleteSlice
in classImageStack
-
deleteLastSlice
public void deleteLastSlice()
Deletes the last slice in the stack.- Overrides:
deleteLastSlice
in classImageStack
-
getPixels
public Object getPixels(int n)
Returns the pixel array for the specified slice, were 1<=n<=nslices.- Overrides:
getPixels
in classImageStack
-
setPixels
public void setPixels(Object pixels, int n)
Assigns a pixel array to the specified slice, were 1<=n<=nslices.- Overrides:
setPixels
in classImageStack
-
getProcessor
public ImageProcessor getProcessor(int n)
Returns an ImageProcessor for the specified slice, were 1<=n<=nslices. Returns null if the stack is empty.- Overrides:
getProcessor
in classImageStack
-
saveChanges
public int saveChanges(int n)
Currently not implemented
-
getSize
public int getSize()
Returns the number of slices in this stack.- Overrides:
getSize
in classImageStack
-
getSliceLabel
public String getSliceLabel(int n)
Returns the label of the Nth image.- Overrides:
getSliceLabel
in classImageStack
-
getImageArray
public Object[] getImageArray()
Returns null.- Overrides:
getImageArray
in classImageStack
-
setSliceLabel
public void setSliceLabel(String label, int n)
Does nothing.- Overrides:
setSliceLabel
in classImageStack
-
isVirtual
public boolean isVirtual()
Always return true.- Overrides:
isVirtual
in classImageStack
-
trim
public void trim()
Does nothing.- Overrides:
trim
in classImageStack
-
getDirectory
public String getDirectory()
Returns the path to the directory containing the images.
-
getFileName
public String getFileName(int n)
Returns the file name of the specified slice, were 1<=n<=nslices.
-
setBitDepth
public void setBitDepth(int bitDepth)
Sets the bit depth (8, 16, 24 or 32).
-
getBitDepth
public int getBitDepth()
Returns the bit depth (8, 16, 24 or 32), or 0 if the bit depth is not known.- Overrides:
getBitDepth
in classImageStack
-
sortDicom
public ImageStack sortDicom(String[] strings, String[] info, int maxDigits)
-
getProperties
public Properties getProperties()
Returns the ImagePlus Properties assoctated with the current slice, or null.
-
-