public class Image5D
extends ij.ImagePlus
An Image5D has a current "position", i.e. a currently active channel, slice and frame. The image belonging to this position is displayed. The stack returned by getStack() is a stack containing all slices belonging to the current channel and frame. In this way the Image5D is backward compatible to plugins, which work on image stacks.
When dealing with "position"s, indices range from 0 to dimensionSize-1 When dealing with "Channel", "Slice", "Frame", indices range from 1 to NChannels... This is to have the same behaviour as ImageJ has for Slices. The image data of an Image5D is stored in the imageStack (of type ij.ImageStack). Calibration data is stored in the ImagePlus.calibration field (type ij.measure.Calibration), the chCalibration array (components of type ChannelCalibration) and in the calibration5D field (of type Calibration5D) (TODO: will contain scaling of channel and time axes) The current display properties are stored in the array chDisplayProps (of type ChannelDisplayProperties). Working copies of the data are copied to the "channelIPs" array and to the ImagePlus.stack. To replace the "pixels" Object for the imageStack and the working copies, use the method: setPixels(Object pixels, int channel, int slice, int frame) Also, the display settings and calibration functions are copied to the "channelIPs" array. display settings and calibration functions can be brought to the same state by the methods: storeChannelProperties(), restoreChannelProperties(), storeCurrenChannelProperties(), and restoreCurrentChannelProperties().
Modifier and Type | Field and Description |
---|---|
protected boolean |
activated5d |
protected ChannelImagePlus[] |
channelImps |
protected ij.process.ImageProcessor[] |
channelIPs |
protected int |
colorDimension |
protected int[] |
currentPosition |
protected boolean |
displayAllGray |
protected boolean |
displayGrayInTiles |
protected int |
displayMode |
protected ij.ImageStack |
imageStack |
protected int |
imageStackSize |
protected boolean |
isInitialized |
protected int |
nDimensions |
static String |
VERSION |
protected int |
xSav |
protected int |
ySav |
changes, CLOSED, COLOR_256, COLOR_RGB, compositeImage, currentSlice, dimensionsSet, flattenTitle, GRAY16, GRAY32, GRAY8, height, img, ip, locked, nChannels, nFrames, nSlices, OPENED, roi, setIJMenuBar, UPDATED, width, win
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
ADD_TO_OVERLAY, ALL_STATS, AREA, AREA_FRACTION, CENTER_OF_MASS, CENTROID, CIRCULARITY, ELLIPSE, FERET, INTEGRATED_DENSITY, INVERT_Y, KURTOSIS, LABELS, LIMIT, MAX_STANDARDS, MEAN, MEDIAN, MIN_MAX, MODE, NaN_EMPTY_CELLS, PERIMETER, RECT, SCIENTIFIC_NOTATION, SHAPE_DESCRIPTORS, SKEWNESS, SLICE, STACK_POSITION, STD_DEV
Constructor and Description |
---|
Image5D() |
Image5D(String pathOrURL) |
Image5D(String title,
Image img) |
Image5D(String title,
ij.process.ImageProcessor ip) |
Image5D(String title,
ij.ImageStack stack)
Makes an Image5D (one channel and one frame) from an ImageStack.
|
Image5D(String title,
ij.ImageStack stack,
int nChannels,
int nSlices,
int nFrames)
Makes an Image5D from an ImageStack and dimension sizes.
|
Image5D(String title,
int type,
int[] dimensions,
boolean fill) |
Image5D(String title,
int type,
int width,
int height,
int nChannels,
int nSlices,
int nFrames,
boolean fill)
Same as Image5D(String title, int type, int[] dimensions, boolean fill),
but the array dimensions[] replaced by the individual elements width,
height, nChannels, nSlices and nFrames.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkChannel(int channel) |
protected void |
checkFrame(int frame) |
protected void |
checkSlice(int slice) |
static int |
compareToVersion(String testVersion)
Compares the "testVersion" to the version of the installed class.
|
void |
copy(boolean cut)
Copies the active channel to the ImageJ clipboard, if only one channel is
displayed.
|
Object |
createEmptyPixels()
Creates an empty pixels-array of size width*height and type of this image,
and returns a reference to it.
|
protected static ij.process.ImageProcessor |
createProcessorFromDims(int type,
int[] dimensionSizes)
Called from constructor Image5D(String title, int type, int[] dimensions,
boolean fill) in call to super().
|
protected static ij.ImageStack |
createZStackFromImageStack(ij.ImageStack imageStack,
int nChannels,
int nSlices,
int nFrames)
Called from constructor Image5D(String title, ImageStack stack, int
nChannels, int nSlices, int nFrames) in call to super().
|
void |
draw()
Draws the image.
|
Image5D |
duplicate() |
void |
expandDimension(int dimension,
int newSize,
boolean fill)
Expands Image5D to larger size in one dimension.
|
void |
flush()
Sets the image arrays to null to help the garbage collector do its job.
|
ChannelCalibration |
getChannelCalibration(int channel)
Get reference to ChannelCalibration item of a channel.
|
ChannelDisplayProperties |
getChannelDisplayProperties(int channel)
Get reference to ChannelDisplayProperties item of a channel.
|
ChannelImagePlus |
getChannelImagePlus(int channel)
Get reference to ChannelImagePlus item of a channel.
|
int |
getColorDimension() |
int |
getCurrentChannel() |
int |
getCurrentFrame() |
int |
getCurrentImageStackIndex()
Returns the index in the imageStack corresponding to the current position.
|
int[] |
getCurrentPosition() |
int |
getCurrentPosition(int dimension) |
int |
getCurrentSlice() |
protected int |
getCurrentSliceOffset() |
protected int |
getCurrentStackIncrement() |
protected int |
getCurrentStackOffset() |
String |
getDimensionLabel(int dimension) |
int |
getDimensionSize(int dimension)
Returns the size of a dimension.
|
int |
getDisplayMode() |
ij.io.FileInfo |
getFileInfo() |
String |
getI5DMetaData()
Returns Image5D-specific metadata to be saved in TIFF-file.
|
Image |
getImage() |
ij.ImageStack |
getImageStack()
Returns a reference to the imageStack that contains all channels, slices
and frames.
|
int |
getImageStackIndex(int channel,
int slice,
int frame)
Returns the index in the imageStack corresponding to the specified
position.
|
int |
getImageStackSize()
Returns the full size of the ImageStack, not just that of the current
channel/frame.
|
int |
getNDimensions() |
Object |
getPixels(int channel,
int slice,
int frame)
Returns a reference to the image data of the given channel, slice and
frame: An object of type byte-array, short-array or float-array.
|
ij.process.ImageProcessor |
getProcessor(int channel) |
protected String |
getStatusString(int x,
int y) |
boolean |
isDisplayAllGray()
true: all channels are displayed in gray
|
boolean |
isDisplayedGray(int channel) |
boolean |
isDisplayedInOverlay(int channel) |
boolean |
isDisplayGrayInTiles() |
void |
mouseMoved(int x,
int y) |
void |
paste()
Inserts the contents of the internal clipboard into the active image.
|
void |
putRoi(Roi newRoi)
Assigns the specified ROI to this image and displays it without saving it
as previousRoi as it is done by
setRoi() . |
void |
restoreChannelProperties(int channel) |
void |
restoreCurrentChannelProperties() |
void |
setActivated()
Called by ImageWindow.windowActivated().
|
void |
setChannel(int index) |
void |
setChannelCalibration(int channel,
ChannelCalibration cal)
Sets the ChannelCalibration item of a channel.
|
void |
setChannelColorModel(int channel,
ColorModel model)
Changes the color model of a channel to this one.
|
void |
setChannelDisplayProperties(int channel,
ChannelDisplayProperties props)
Sets the ChannelDisplayProperties item of a channel.
|
void |
setChannelMinMax(int channel,
double minValue,
double maxValue)
Changes the min- and max-value of a channel to these ones.
|
void |
setCurrentPosition(int[] position)
THE method to set the current Position in the Image5D.
|
void |
setCurrentPosition(int dimension,
int position) |
void |
setCurrentPosition(int x,
int y,
int ch,
int z,
int t) |
void |
setDefaultChannelNames() |
void |
setDefaultColors() |
void |
setDimensions(int nChannels,
int nSlices,
int nFrames)
Make setDimensions non-functional, so that no one messes up stack
dimensions in the GUI.
|
void |
setDisplayedGray(int channel,
boolean displayedGray) |
void |
setDisplayedInOverlay(int channel,
boolean displayed) |
void |
setDisplayGrayInTiles(boolean displayGrayInTiles)
Sets, whether all channels in TILED mode are displayed with a grayscale
colormap and updates the ChannelControl of the Image5DWindow.
|
void |
setDisplayMode(int displayMode)
Sets the displayMode of the Image5D to one of
ChannelControl.ONE_CHANNEL_GRAY, ONE_CHANNEL_COLOR, OVERLAY or TILED and
updates the ChannelControl of the Image5DWindow.
|
void |
setFrame(int index) |
void |
setImage(Image img)
Replaces the AWT image, if any, with the one specified.
|
void |
setPixels(Object pixels)
Assigns a pixel array to the current position,
|
void |
setPixels(Object pixels,
int channel,
int slice,
int frame)
Assigns a pixel array to the specified position,
|
void |
setProcessor(String title,
ij.process.ImageProcessor ip)
Replaces the ImageProcessor, if any, with the one specified.
|
void |
setSlice(int index) |
void |
setStack(String title,
ij.ImageStack stack)
Replaces the current stack, with the one specified.
|
protected void |
setType(int type) |
void |
show(String statusMessage) |
void |
storeChannelProperties(int channel) |
void |
storeCurrentChannelProperties() |
void |
updateAndDraw()
Updates this image from the pixel data in its associated ImageProcessor,
then displays it.
|
void |
updateImage()
ImageCanvas.paint() calls this method when the ImageProcessor has generated
a new image.
|
void |
updateImageAndDraw()
Causes the AWT image returned by getImage() to be fully recalculated.
|
void |
updateStatusbarValue() |
void |
updateWindowControls()
Updates the window controls of the Image5DWindow.
|
addImageListener, clone, close, convertIndexToPosition, copy, copyAttributes, copyScale, copyToSystem, createEmptyStack, createHyperStack, createImagePlus, createLut, createNewRoi, createRoiMask, createThresholdMask, crop, crop, crop, crop, cropAndSave, cut, deleteRoi, draw, flatten, flattenStack, getAllStatistics, getBitDepth, getBufferedImage, getBytesPerPixel, getC, getCalibration, getCanvas, getChannel, getChannelProcessor, getClipboard, getCompositeMode, getDefault16bitRange, getDimensions, getDimensions, getDisplayRangeMax, getDisplayRangeMin, getFrame, getGlobalCalibration, getHeight, getHideOverlay, getID, getImageProperties, getInfoProperty, getLocalCalibration, getLocationAsString, getLuts, getMask, getNChannels, getNFrames, getNSlices, getNumericProp, getNumericProperty, getOpenAsHyperStack, getOriginalFileInfo, getOverlay, getPixel, getPlot, getProcessor, getProp, getProperties, getPropertiesAsArray, getProperty, getPropsInfo, getRawStatistics, getRoi, getShortTitle, getSizeInBytes, getSlice, getStack, getStackIndex, getStackSize, getStartTime, getStaticGlobalCalibration, getStatistics, getStatistics, getStatistics, getStatistics, getStringProperty, getT, getTitle, getType, getWidth, getWindow, getZ, hide, imageUpdate, isComposite, isDisplayedHyperStack, isHyperStack, isInvertedLut, isLocked, isLockedByAnotherThread, isProcessor, isStack, isThreshold, isVisible, killRoi, killStack, lock, lockSilently, logImageListeners, notifyListeners, okToDeleteRoi, paste, plotHistogram, plotHistogram, removeImageListener, repaintWindow, resetClipboard, resetDisplayRange, resetStack, resize, resize, restoreRoi, revert, saveRoi, setActiveChannels, setAntialiasRendering, setC, setCalibration, setColor, setDefault16bitRange, setDisplayRange, setDisplayRange, setFileInfo, setGlobalCalibration, setHideOverlay, setIgnoreFlush, setIgnoreGlobalCalibration, setIJMenuBar, setIJMenuBar, setImage, setLut, setOpenAsHyperStack, setOverlay, setOverlay, setOverlay, setPlot, setPosition, setPosition, setPositionWithoutUpdate, setProcessor, setProp, setProp, setProperties, setProperty, setRoi, setRoi, setRoi, setRoi, setSliceWithoutUpdate, setStack, setStack, setT, setTitle, setTypeToColor256, setWindow, setZ, show, startTiming, tempOverlay, toString, trimProcessor, unlock, updateAndRepaintWindow, updateChannelAndDraw, updatePosition, updateVirtualSlice
public static final String VERSION
protected int nDimensions
protected boolean isInitialized
protected ij.ImageStack imageStack
protected int imageStackSize
protected int[] currentPosition
protected ChannelImagePlus[] channelImps
protected ij.process.ImageProcessor[] channelIPs
protected int colorDimension
protected int displayMode
protected boolean displayAllGray
protected boolean displayGrayInTiles
protected boolean activated5d
protected int xSav
protected int ySav
public Image5D(String title, int type, int[] dimensions, boolean fill)
title
- type
- dimensions
- array containing width, height, nChannels, nSlices and
nFrames.fill
- If true, data is allocated for each combination of
<ch, z, t>
("position"). If false, only references to one
and the same pixel array will be created. This is much faster,
but changes to one position will apply to all positions.public Image5D(String title, int type, int width, int height, int nChannels, int nSlices, int nFrames, boolean fill)
public Image5D(String title, ij.process.ImageProcessor ip)
title
- ip
- public Image5D(String title, ij.ImageStack stack)
title
- title of the imagestack
- stack containing the image datapublic Image5D(String title, ij.ImageStack stack, int nChannels, int nSlices, int nFrames)
title
- title of the imagestack
- stack containing the image data. Changes first by channel,
then by slice then by frame.nChannels
- nSlices
- nFrames
- public Image5D()
public Image5D(String pathOrURL)
public static int compareToVersion(String testVersion)
testVersion < VERSION
, +1, if testVersion > VERSION
and 0
if both are the same. Version numbering is expected in the format x.y.z
where x, y and z are positive integer numbers. E.g. this method was
introduced in Image5D version 1.1.6. If z is not specified, it is counted
as 0. No letters are allowed in the version, only digits.public void setStack(String title, ij.ImageStack stack)
setStack
in class ij.ImagePlus
public void updateWindowControls()
public void updateImageAndDraw()
public void mouseMoved(int x, int y)
mouseMoved
in class ij.ImagePlus
public void updateStatusbarValue()
updateStatusbarValue
in class ij.ImagePlus
protected String getStatusString(int x, int y)
public void setImage(Image img)
setImage
in class ij.ImagePlus
public void setProcessor(String title, ij.process.ImageProcessor ip)
setProcessor
in class ij.ImagePlus
protected void setType(int type)
setType
in class ij.ImagePlus
public void setChannel(int index)
public void setSlice(int index)
setSlice
in class ij.ImagePlus
public void setFrame(int index)
public void setCurrentPosition(int dimension, int position)
public void setCurrentPosition(int x, int y, int ch, int z, int t)
public void setCurrentPosition(int[] position)
position
- public int getNDimensions()
getNDimensions
in class ij.ImagePlus
public String getDimensionLabel(int dimension)
public int getDimensionSize(int dimension)
public int getImageStackSize()
getImageStackSize
in class ij.ImagePlus
public ij.ImageStack getImageStack()
getImageStack
in class ij.ImagePlus
public String getI5DMetaData()
public ij.io.FileInfo getFileInfo()
getFileInfo
in class ij.ImagePlus
public Object getPixels(int channel, int slice, int frame)
public void setPixels(Object pixels)
pixels
- public void setPixels(Object pixels, int channel, int slice, int frame)
pixels
- public Object createEmptyPixels()
public int getColorDimension()
public int getCurrentImageStackIndex()
public int getImageStackIndex(int channel, int slice, int frame)
public int[] getCurrentPosition()
public int getCurrentPosition(int dimension)
public int getCurrentChannel()
public int getCurrentSlice()
getCurrentSlice
in class ij.ImagePlus
public int getCurrentFrame()
public void setChannelColorModel(int channel, ColorModel model)
channel
- model
- public void setChannelMinMax(int channel, double minValue, double maxValue)
public int getDisplayMode()
getDisplayMode
in class ij.ImagePlus
public void setDisplayMode(int displayMode)
setDisplayMode
in class ij.ImagePlus
public void setDisplayGrayInTiles(boolean displayGrayInTiles)
public boolean isDisplayGrayInTiles()
public boolean isDisplayedInOverlay(int channel)
public void setDisplayedInOverlay(int channel, boolean displayed)
public boolean isDisplayedGray(int channel)
public void setDisplayedGray(int channel, boolean displayedGray)
public boolean isDisplayAllGray()
public void setActivated()
setActivated
in class ij.ImagePlus
public void show(String statusMessage)
show
in class ij.ImagePlus
public Image getImage()
getImage
in class ij.ImagePlus
public void updateImage()
updateImage
in class ij.ImagePlus
public void draw()
draw
in class ij.ImagePlus
public void updateAndDraw()
updateAndDraw
in class ij.ImagePlus
public void setDefaultColors()
public void setDefaultChannelNames()
public void flush()
flush
in class ij.ImagePlus
public void paste()
paste
in class ij.ImagePlus
public void copy(boolean cut)
copy
in class ij.ImagePlus
public void putRoi(Roi newRoi)
setRoi()
.public void expandDimension(int dimension, int newSize, boolean fill)
newSize <= current size
. Works only for dimension >=2
(i.e. channel, slice, frame) at present.dimension
- newSize
- fill
- if true, create black image for each position, if false, link a
common dummy image to each positionpublic void setDimensions(int nChannels, int nSlices, int nFrames)
setDimensions
in class ij.ImagePlus
protected int getCurrentSliceOffset()
protected int getCurrentStackOffset()
protected int getCurrentStackIncrement()
protected void checkChannel(int channel)
protected void checkSlice(int slice)
protected void checkFrame(int frame)
public ChannelImagePlus getChannelImagePlus(int channel)
public ChannelCalibration getChannelCalibration(int channel)
public void setChannelCalibration(int channel, ChannelCalibration cal)
public ChannelDisplayProperties getChannelDisplayProperties(int channel)
public void setChannelDisplayProperties(int channel, ChannelDisplayProperties props)
public void storeCurrentChannelProperties()
public void restoreCurrentChannelProperties()
public void storeChannelProperties(int channel)
public void restoreChannelProperties(int channel)
public ij.process.ImageProcessor getProcessor(int channel)
public Image5D duplicate()
duplicate
in class ij.ImagePlus
protected static ij.process.ImageProcessor createProcessorFromDims(int type, int[] dimensionSizes)
protected static ij.ImageStack createZStackFromImageStack(ij.ImageStack imageStack, int nChannels, int nSlices, int nFrames)
Copyright © 2015–2021 Fiji. All rights reserved.