public class ImageJVirtualStack<T extends NativeType<T>> extends AbstractVirtualStack
VirtualStack
that wraps around a RandomAccessibleInterval
of
type UnsignedByteType
, UnsignedShortType
, FloatType
or ARGBType
.
By default ImageJVirtualStack
is not writable. A call to
AbstractVirtualStack.setPixels(java.lang.Object, int)
or AbstractVirtualStack.setVoxels(int, int, int, int, int, int, float[])
has no effect. Buf if
setWritable(boolean)
is set to true, the pixels set by this methods
are copied to the RandomAccessibleInterval
.
A call to AbstractVirtualStack.getPixels(int)
will return a copy of pixels of the specified image
plane. Writing to the returned array has no effect.
The ImageProcessor
returned by AbstractVirtualStack.getProcessor(int)
wraps around a copy of the pixels of the image plane too. So methods like
ImageProcessor.set(int, int, int)
will not change the content of
wrapped RandomAccessibleInterval
.
Modifier and Type | Field and Description |
---|---|
protected ExecutorService |
service |
Modifier | Constructor and Description |
---|---|
protected |
ImageJVirtualStack(RandomAccessibleInterval<S> source,
Converter<? super S,T> converter,
T type,
int bitDepth) |
protected |
ImageJVirtualStack(RandomAccessibleInterval<S> source,
Converter<? super S,T> converter,
T type,
int bitDepth,
ExecutorService service) |
protected |
ImageJVirtualStack(RandomAccessibleInterval<T> source,
int bitDepth) |
Modifier and Type | Method and Description |
---|---|
protected Object |
getPixelsZeroBasedIndex(int index)
This method is used internally by
AbstractVirtualStack to implement AbstractVirtualStack.getPixels(int) . |
protected RandomAccessibleInterval<T> |
getSliceZeroBasedIndex(int index)
This method is used internally by
AbstractVirtualStack to implement AbstractVirtualStack.getVoxels(int, int, int, int, int, int, float[]) and AbstractVirtualStack.setVoxels(int, int, int, int, int, int, float[]) . |
boolean |
isWritable()
True if the image is writable.
|
void |
setExecutorService(ExecutorService service) |
protected void |
setPixelsZeroBasedIndex(int index,
Object pixels)
This method is used internally by
AbstractVirtualStack to implement AbstractVirtualStack.setPixels(java.lang.Object, int) . |
void |
setWritable(boolean writable)
Set if the
ImageStack is writable. |
addSlice, addSlice, addSlice, addSlice, addSlice, addUnsignedShortSlice, convertToFloat, crop, deleteLastSlice, deleteSlice, drawSphere, duplicate, getBitDepth, getColorModel, getDirectory, getFileName, getHeight, getImageArray, getPixels, getProcessor, getRoi, getShortSliceLabel, getSize, getSliceLabel, getSliceLabels, getVoxels, getVoxels, getWidth, isHSB, isLab, isRGB, isVirtual, saveChanges, setBitDepth, setColorModel, setMinAndMax, setPixels, setProcessor, setRoi, setSliceLabel, setVoxels, setVoxels, size, sortDicom, toString, trim, update
protected ExecutorService service
protected ImageJVirtualStack(RandomAccessibleInterval<S> source, Converter<? super S,T> converter, T type, int bitDepth)
protected ImageJVirtualStack(RandomAccessibleInterval<S> source, Converter<? super S,T> converter, T type, int bitDepth, ExecutorService service)
protected ImageJVirtualStack(RandomAccessibleInterval<T> source, int bitDepth)
public void setExecutorService(ExecutorService service)
public void setWritable(boolean writable)
ImageStack
is writable.
No call to any method of this class will change the wrapped RandomAccessibleInterval
,
if this ImageStack
is not writable.
If writable, the pixels written to the image by the methods AbstractVirtualStack.setPixels(Object, int)
or AbstractVirtualStack.setVoxels(int, int, int, int, int, int, float[])
will be copied to the wrapped RandomAccessibleInterval
.
Please note: The ImageProcessor
cannot be used to persistently change the image
content.
public boolean isWritable()
isWritable
in class AbstractVirtualStack
protected Object getPixelsZeroBasedIndex(int index)
AbstractVirtualStack
AbstractVirtualStack
to implement AbstractVirtualStack.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 AbstractVirtualStack.getBitDepth()
.
getPixelsZeroBasedIndex
in class AbstractVirtualStack
index
- Zero based index of the plane. (Warning VirtualStack.getPixels(int)
uses one base indices).ImageStack.getBitDepth()
protected void setPixelsZeroBasedIndex(int index, Object pixels)
AbstractVirtualStack
AbstractVirtualStack
to implement AbstractVirtualStack.setPixels(java.lang.Object, int)
.
Set all pixels in the specified XY-plane.
setPixelsZeroBasedIndex
in class AbstractVirtualStack
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 AbstractVirtualStack.getWidth()
times AbstractVirtualStack.getHeight()
.
Type of the array must be byte[], short[], int[] or float[] and match the type indicated by AbstractVirtualStack.getBitDepth()
.protected RandomAccessibleInterval<T> getSliceZeroBasedIndex(int index)
AbstractVirtualStack
AbstractVirtualStack
to implement AbstractVirtualStack.getVoxels(int, int, int, int, int, int, float[])
and AbstractVirtualStack.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 AbstractVirtualStack.getBitDepth()
. RealType
for 8, 16 and 32 bit images, and ARGBType
fot 32-bit images.
getSliceZeroBasedIndex
in class AbstractVirtualStack
index
- Zero based index of the plane. (Warning VirtualStack.getPixels(int)
uses one base indices).Copyright © 2015–2022 ImgLib2. All rights reserved.