public abstract class AbstractVirtualStack
extends ij.VirtualStack
VirtualStack
.
This class is intended to be used in ImageJVirtualStack
and PlanarImgToVirtualStack
.
Constructor and Description |
---|
AbstractVirtualStack(int width,
int height,
int size,
int bitDepth) |
Modifier and Type | Method and Description |
---|---|
void |
addSlice(ij.process.ImageProcessor ip) |
void |
addSlice(String name) |
void |
addSlice(String sliceLabel,
ij.process.ImageProcessor ip) |
void |
addSlice(String sliceLabel,
ij.process.ImageProcessor ip,
int n) |
void |
addSlice(String sliceLabel,
Object pixels) |
void |
addUnsignedShortSlice(String sliceLabel,
Object pixels) |
ij.ImageStack |
convertToFloat() |
ij.ImageStack |
crop(int x,
int y,
int z,
int width,
int height,
int depth) |
void |
deleteLastSlice() |
void |
deleteSlice(int n) |
void |
drawSphere(double radius,
int xc,
int yc,
int zc) |
ij.ImageStack |
duplicate() |
int |
getBitDepth() |
ColorModel |
getColorModel() |
String |
getDirectory() |
String |
getFileName(int n) |
int |
getHeight() |
Object[] |
getImageArray() |
Object |
getPixels(int n) |
protected abstract Object |
getPixelsZeroBasedIndex(int index)
This method is used internally by
AbstractVirtualStack to implement getPixels(int) . |
ij.process.ImageProcessor |
getProcessor(int n) |
Rectangle |
getRoi() |
String |
getShortSliceLabel(int n) |
int |
getSize() |
String |
getSliceLabel(int n) |
String[] |
getSliceLabels() |
protected RandomAccessibleInterval<?> |
getSliceZeroBasedIndex(int index)
This method is used internally by
AbstractVirtualStack to implement getVoxels(int, int, int, int, int, int, float[]) and setVoxels(int, int, int, int, int, int, float[]) . |
float[] |
getVoxels(int x0,
int y0,
int z0,
int w,
int h,
int d,
float[] voxels) |
float[] |
getVoxels(int x0,
int y0,
int z0,
int w,
int h,
int d,
float[] voxels,
int channel) |
int |
getWidth() |
boolean |
isHSB() |
boolean |
isLab() |
boolean |
isRGB() |
boolean |
isVirtual() |
protected boolean |
isWritable()
If this method return's false the methods
setPixels(java.lang.Object, int) and setVoxels(int, int, int, int, int, int, float[]) will have no effect. |
int |
saveChanges(int n)
Currently not implemented
|
void |
setBitDepth(int bitDepth) |
void |
setColorModel(ColorModel cm) |
protected void |
setMinAndMax(double min,
double max) |
void |
setPixels(Object pixels,
int n) |
protected abstract void |
setPixelsZeroBasedIndex(int index,
Object pixels)
This method is used internally by
AbstractVirtualStack to implement setPixels(java.lang.Object, int) . |
void |
setProcessor(ij.process.ImageProcessor ip,
int n) |
void |
setRoi(Rectangle roi) |
void |
setSliceLabel(String label,
int n) |
void |
setVoxels(int x0,
int y0,
int z0,
int w,
int h,
int d,
float[] voxels) |
void |
setVoxels(int x0,
int y0,
int z0,
int w,
int h,
int d,
float[] voxels,
int channel) |
int |
size() |
ij.ImageStack |
sortDicom(String[] strings,
String[] info,
int maxDigits) |
String |
toString() |
void |
trim() |
void |
update(ij.process.ImageProcessor ip) |
public AbstractVirtualStack(int width, int height, int size, int bitDepth)
protected void setMinAndMax(double min, double max)
public final Object getPixels(int n)
getPixels
in class ij.VirtualStack
public final void setPixels(Object pixels, int n)
setPixels
in class ij.VirtualStack
protected boolean isWritable()
setPixels(java.lang.Object, int)
and setVoxels(int, int, int, int, int, int, float[])
will have no effect.protected abstract Object getPixelsZeroBasedIndex(int index)
AbstractVirtualStack
to implement getPixels(int)
.
Returns an array that contains the pixels of the specified XY-plane.
The type of the array must be byte[], short[], int[] or float[] and must match the type indicated by getBitDepth()
.
index
- Zero based index of the plane. (Warning VirtualStack.getPixels(int)
uses one base indices).ImageStack.getBitDepth()
protected abstract void setPixelsZeroBasedIndex(int index, Object pixels)
AbstractVirtualStack
to implement setPixels(java.lang.Object, int)
.
Set all pixels in the specified XY-plane.
index
- Zero based index of the plane. (Warning VirtualStack.getPixels(int)
uses one base indices).pixels
- Array that contains the pixel data. Array length must equal getWidth()
times getHeight()
.
Type of the array must be byte[], short[], int[] or float[] and match the type indicated by getBitDepth()
.protected RandomAccessibleInterval<?> getSliceZeroBasedIndex(int index)
AbstractVirtualStack
to implement getVoxels(int, int, int, int, int, int, float[])
and setVoxels(int, int, int, int, int, int, float[])
.
Returns a two dimensional RandomAccessibleInterval
that provides read and write access to the specified XY-plane.
The pixel type must be match getBitDepth()
. RealType
for 8, 16 and 32 bit images, and ARGBType
fot 32-bit images.
index
- Zero based index of the plane. (Warning VirtualStack.getPixels(int)
uses one base indices).public ij.process.ImageProcessor getProcessor(int n)
getProcessor
in class ij.VirtualStack
public void addSlice(String name)
addSlice
in class ij.VirtualStack
public void addSlice(String sliceLabel, Object pixels)
addSlice
in class ij.VirtualStack
public void addSlice(String sliceLabel, ij.process.ImageProcessor ip)
addSlice
in class ij.VirtualStack
public void addSlice(String sliceLabel, ij.process.ImageProcessor ip, int n)
addSlice
in class ij.VirtualStack
public void deleteSlice(int n)
deleteSlice
in class ij.VirtualStack
public void deleteLastSlice()
deleteLastSlice
in class ij.VirtualStack
public int saveChanges(int n)
saveChanges
in class ij.VirtualStack
public int getSize()
getSize
in class ij.VirtualStack
public String getSliceLabel(int n)
getSliceLabel
in class ij.VirtualStack
public Object[] getImageArray()
getImageArray
in class ij.VirtualStack
public void setSliceLabel(String label, int n)
setSliceLabel
in class ij.VirtualStack
public boolean isVirtual()
isVirtual
in class ij.VirtualStack
public void trim()
trim
in class ij.VirtualStack
public String getDirectory()
getDirectory
in class ij.VirtualStack
public String getFileName(int n)
getFileName
in class ij.VirtualStack
public void setBitDepth(int bitDepth)
setBitDepth
in class ij.VirtualStack
public int getBitDepth()
getBitDepth
in class ij.VirtualStack
public ij.ImageStack sortDicom(String[] strings, String[] info, int maxDigits)
sortDicom
in class ij.VirtualStack
public void addUnsignedShortSlice(String sliceLabel, Object pixels)
addUnsignedShortSlice
in class ij.ImageStack
public void addSlice(ij.process.ImageProcessor ip)
addSlice
in class ij.ImageStack
public int getWidth()
getWidth
in class ij.ImageStack
public int getHeight()
getHeight
in class ij.ImageStack
public void setRoi(Rectangle roi)
setRoi
in class ij.ImageStack
public Rectangle getRoi()
getRoi
in class ij.ImageStack
public void update(ij.process.ImageProcessor ip)
update
in class ij.ImageStack
public int size()
size
in class ij.VirtualStack
public String[] getSliceLabels()
getSliceLabels
in class ij.ImageStack
public String getShortSliceLabel(int n)
getShortSliceLabel
in class ij.ImageStack
public void setProcessor(ij.process.ImageProcessor ip, int n)
setProcessor
in class ij.ImageStack
public void setColorModel(ColorModel cm)
setColorModel
in class ij.ImageStack
public ColorModel getColorModel()
getColorModel
in class ij.ImageStack
public boolean isRGB()
isRGB
in class ij.ImageStack
public boolean isHSB()
isHSB
in class ij.ImageStack
public boolean isLab()
isLab
in class ij.ImageStack
public String toString()
toString
in class ij.ImageStack
public float[] getVoxels(int x0, int y0, int z0, int w, int h, int d, float[] voxels)
getVoxels
in class ij.ImageStack
public float[] getVoxels(int x0, int y0, int z0, int w, int h, int d, float[] voxels, int channel)
getVoxels
in class ij.ImageStack
public void setVoxels(int x0, int y0, int z0, int w, int h, int d, float[] voxels)
setVoxels
in class ij.ImageStack
public void setVoxels(int x0, int y0, int z0, int w, int h, int d, float[] voxels, int channel)
setVoxels
in class ij.ImageStack
public void drawSphere(double radius, int xc, int yc, int zc)
drawSphere
in class ij.ImageStack
public ij.ImageStack duplicate()
duplicate
in class ij.ImageStack
public ij.ImageStack crop(int x, int y, int z, int width, int height, int depth)
crop
in class ij.ImageStack
public ij.ImageStack convertToFloat()
convertToFloat
in class ij.ImageStack
Copyright © 2015–2022 ImgLib2. All rights reserved.