public class ImageShort extends ImageInt
This file is part of tango
tango is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see
| Modifier and Type | Field and Description |
|---|---|
short[][] |
pixels |
| Constructor and Description |
|---|
ImageShort(ImageHandler im,
boolean scaling)
Constructor from another generic ImageHandler
will convert to write format if necessary
|
ImageShort(ImagePlus img)
Constructor from ImagePlus
|
ImageShort(ImageStack img)
Constructor from ImageStack
|
ImageShort(short[][] pixels,
java.lang.String title,
int sizeX)
Generic constructor with array of pixels
|
ImageShort(java.lang.String title,
int sizeX,
int sizeY,
int sizeZ)
Generic consructor to generate a black image
|
| Modifier and Type | Method and Description |
|---|---|
void |
appendMasks(java.lang.Iterable<ImageInt> images,
int startLabel)
??
|
static short[] |
convert(byte[] input)
convert from byte array to short array
|
static short[] |
convert(float[] input,
boolean scaling)
convert from float array to short array
|
ImageByte |
convertToByte(boolean scaling)
Convert to byte image
|
ImageByte |
convertToByte(double saturation)
Convert to byte image using saturation of the values
|
ImageFloat |
convertToFloat(boolean scaling)
Convert to float 32 bit image
|
void |
copy(ImageShort destination)
Copy the pixels values into the parameter image
|
int |
countMaskVolume() |
ImageShort |
crop3D(java.lang.String title,
int x_min_,
int x_max_,
int y_min_,
int y_max_,
int z_min_,
int z_max_) |
ImageShort[] |
crop3D(java.util.TreeMap<java.lang.Float,int[]> bounds) |
ImageByte |
crop3DBinary(java.lang.String title,
float label,
int x_min_,
int x_max_,
int y_min_,
int y_max_,
int z_min_,
int z_max_) |
ImageShort |
crop3DMask(java.lang.String title,
ImageInt mask,
float label,
int x_min_,
int x_max_,
int y_min_,
int y_max_,
int z_min_,
int z_max_) |
ImageHandler |
deleteSlices(int zmin,
int zmax) |
void |
draw(Object3D o,
float value) |
void |
draw(Object3D o,
int value) |
ImageShort |
duplicate() |
void |
erase() |
void |
fill(double value,
int min,
int max) |
protected void |
flushPixels() |
java.lang.Object |
getArray1D()
get the 1D array as java Object
|
java.lang.Object |
getArray1D(int z)
get the 1D array as java Object for one slice
|
static short[] |
getArray1DShort(ImagePlus img)
(Should be somewhere else --> ImageJUtils ?)
Get the 1D array of a 3D image stored in ImagePlus
|
protected int[] |
getHisto(ImageInt mask) |
protected int[] |
getHisto(ImageInt mask,
int nBins,
double min,
double max) |
static ImagePlus |
getImagePlus(short[] pixels,
int sizeX,
int sizeY,
int sizeZ,
boolean setMinAndMax)
(Should be somewhere else --> ImageJUtils ?)
Get the ImagePlus from a 1D array of pixels
|
protected void |
getMinAndMax(ImageInt mask) |
float |
getPixel(int coord)
Deprecated.
|
float |
getPixel(int xy,
int z) |
float |
getPixel(int x,
int y,
int z) |
float |
getPixel(Point3D v) |
float |
getPixel(Point3DInt P) |
int |
getPixelInt(int coord)
Deprecated.
|
int |
getPixelInt(int xy,
int z) |
int |
getPixelInt(int x,
int y,
int z) |
int |
getPixelInt(Point3D v) |
float |
getPixelInterpolated(Point3D P) |
int |
getPixelIntInterpolated(Point3D P) |
double |
getSizeInMb() |
int |
getType() |
void |
intersectMask(ImageHandler mask) |
void |
intersectMask(ImageInt mask)
Deprecated.
|
void |
intersectMask2D(ImageInt mask,
int z) |
void |
invert(ImageInt mask) |
boolean |
isOpened() |
protected ImageFloat |
normalize_(ImageInt mask,
double saturation) |
ImageFloat |
normalize(double min,
double max) |
ImageShort |
resample(int newZ,
int method)
Rescale the image to new dimension, only in Z
|
ImageShort |
resample(int newX,
int newY,
int newZ,
int method)
Rescale the image to new dimension, in X Y and Z
|
ImageHandler |
resize(int dX,
int dY,
int dZ)
Enlarge the canvas size of the image in X, Y and Z .
|
void |
setPixel(int coord,
float value)
Deprecated.
|
void |
setPixel(int xy,
int z,
float value) |
void |
setPixel(int xy,
int z,
int value) |
void |
setPixel(int x,
int y,
int z,
float value) |
void |
setPixel(int x,
int y,
int z,
int value) |
void |
setPixel(Point3D point,
float value) |
void |
setPixel(Voxel3D v,
short value)
Set the pixel value at a given Voxel3D position (position will be rounded)
|
void |
setPixelCross3D(int x,
int y,
int z,
int value) |
boolean |
shiftIndexes(java.util.TreeMap<java.lang.Integer,int[]> bounds) |
ImageByte |
threshold(float thld,
boolean keepUnderThld,
boolean strict) |
void |
thresholdCut(float thld,
boolean keepUnderThld,
boolean strict) |
ImageByte |
thresholdRangeExclusive(float min,
float max) |
ImageByte |
thresholdRangeInclusive(float min,
float max) |
ImageByte |
toMask() |
void |
trimSlices(int zmin,
int zmax) |
adaptiveFilter, adaptiveFilter, addImage, crop3DBinary, crop3DBinary, cropRadius, diffAbsImage, erode, filterGeneric, filterGeneric, filterGeneric, filterGeneric, filterPooling, filterPooling, firstVoxelValueInt, getDistanceMapInsideMask, getListMaxima, getListMaxima, getObject3DBackground, getObjectMask, getObjects3D, getObjects3D, getObjects3DPopulation, getUniqueValues, getUniqueValues, hasOneValueInt, invertMask, isBinary, isBinary, mathGeneric, operationGeneric, projectAVG, replacePixelsValue, replacePixelsValue, replacePixelsValue, replacePixelsValue, sobelFilter, substractImage, subtractImage, subtractImageInt, toCenterMask, wrap, wrapaddImage, addImage, addValue, closeImagePlus, contains, contains, contains, contains, convertToByte, convertToByte, createListVoxels, createSameDimensions, createSameType, divideByValue, divideImage, enlarge, extractLine, fill, flush, getBinaryData, getBounds, getCalibration, getDistanceMap, getHistogram, getHistogram, getHistogram, getHistogram, getHistogram, getHyperStack, getImagePlus, getImageStack, getImageStats, getLineX, getLineY, getLineZ, getMax, getMax, getMaxBelowValue, getMaxPosition, getMean, getMean, getMin, getMin, getMinAboveValue, getMinAndMaxArray, getMinAndMaxArray, getMoments, getNeighborhood, getNeighborhood3x3x3, getNeighborhood3x3x3CenterList, getNeighborhood3x3x3ListCenter, getNeighborhood3x3x3ListNoCenter, getNeighborhood3x3x3NoCenterList, getNeighborhoodBrick, getNeighborhoodCross3D, getNeighborhoodCross3DList, getNeighborhoodKernel, getNeighborhoodKernel, getNeighborhoodKernelAdd, getNeighborhoodKernelSubstract, getNeighborhoodLayer, getNeighborhoodLayer, getNeighborhoodLayerAngle, getNeighborhoodLayerList, getNeighborhoodLayerList, getNeighborhoodSphere, getNeighborhoodXY3x3, getPercentile, getPixel, getPixel, getScaleXY, getScaleZ, getThumbNail, getThumbNail, getThumbnailImage, getTitle, getUnit, hasOneValue, hide, homogenizeBitDepth, insert, invert, invertBackground, isVisible, maskContains, merge3D, merge3DBinary, merge3DRaw, multiplyByValue, multiplyImage, newBlankImageHandler, normaliseValue, normalize, openImage, powImage, radialDistribution, radialDistribution, radialDistribution, resetStats, resetStats, sameDimensions, sameDimensions, sameDimentions, sameDimentions, save, save, saveThumbNail, set332RGBLut, setCalibration, setGraysLut, setLineX, setLineY, setLineZ, setMinAndMax, setMinAndMax, setOffset, setOffset, setPixelIncrement, setPixelIncrement, setScale, setScale, setTitle, show, show, showDuplicate, substractImage, subtractImage, thresholdAboveExclusive, thresholdAboveInclusive, ToByte, touchBorders, transfertPixelValues, updateDisplay, zoompublic ImageShort(ImagePlus img)
img - ImagePluspublic ImageShort(ImageStack img)
img - ImageStackpublic ImageShort(short[][] pixels,
java.lang.String title,
int sizeX)
pixels - 2D array of pixels, a slice being a 1D arraytitle - the title *sizeX - the size in X of the array, sizeY and sizeZ will be extracted from the array lengthpublic ImageShort(java.lang.String title,
int sizeX,
int sizeY,
int sizeZ)
title - title of the imagesizeX - size in XsizeY - size in YsizeZ - size in Zpublic ImageShort(ImageHandler im, boolean scaling)
im - the generic imagescaling - do scaling if converting from other format (8 bits or 32 bit)public static short[] getArray1DShort(ImagePlus img)
img - the imagePluspublic static ImagePlus getImagePlus(short[] pixels,
int sizeX,
int sizeY,
int sizeZ,
boolean setMinAndMax)
pixels - the 1D array of shortsizeX - the size XsizeY - the size YsizeZ - the size ZsetMinAndMax - adjust the min and max valuespublic static short[] convert(float[] input,
boolean scaling)
input - the array of float valuesscaling - scaling the valuespublic static short[] convert(byte[] input)
input - the array of byte valuespublic java.lang.Object getArray1D()
getArray1D in class ImageHandlerpublic java.lang.Object getArray1D(int z)
getArray1D in class ImageHandlerz - slice (starts at 0)public ImageByte convertToByte(boolean scaling)
scaling - do scaling of valuespublic ImageByte convertToByte(double saturation)
saturation - saturation value (0.0 - 1.0)public ImageFloat convertToFloat(boolean scaling)
scaling - scalig the valuespublic void erase()
erase in class ImageHandlerpublic void fill(double value,
int min,
int max)
fill in class ImageHandlerpublic ImageShort duplicate()
public void copy(ImageShort destination)
destination - the image where the values will be copied to@Deprecated public float getPixel(int coord)
getPixel in class ImageHandlerpublic float getPixel(Point3DInt P)
getPixel in class ImageHandlerpublic int getPixelInt(Point3D v)
getPixelInt in class ImageIntpublic float getPixel(int x,
int y,
int z)
getPixel in class ImageHandlerpublic float getPixel(int xy,
int z)
getPixel in class ImageHandlerpublic int getPixelInt(int x,
int y,
int z)
getPixelInt in class ImageIntpublic int getPixelInt(int xy,
int z)
getPixelInt in class ImageInt@Deprecated public int getPixelInt(int coord)
getPixelInt in class ImageInt@Deprecated
public void setPixel(int coord,
float value)
setPixel in class ImageHandlerpublic void setPixel(Point3D point, float value)
setPixel in class ImageHandlerpublic void setPixel(int x,
int y,
int z,
float value)
setPixel in class ImageHandlerpublic void setPixel(int xy,
int z,
float value)
setPixel in class ImageHandlerpublic void setPixel(int x,
int y,
int z,
int value)
public void setPixelCross3D(int x,
int y,
int z,
int value)
setPixelCross3D in class ImageIntpublic void setPixel(Voxel3D v, short value)
v - the voxel positionvalue - the valueprotected void getMinAndMax(ImageInt mask)
getMinAndMax in class ImageHandlerprotected int[] getHisto(ImageInt mask)
getHisto in class ImageHandlerprotected int[] getHisto(ImageInt mask, int nBins, double min, double max)
getHisto in class ImageHandlerpublic ImageByte thresholdRangeInclusive(float min, float max)
thresholdRangeInclusive in class ImageHandlerpublic ImageByte thresholdRangeExclusive(float min, float max)
thresholdRangeExclusive in class ImageHandlerpublic ImageByte threshold(float thld, boolean keepUnderThld, boolean strict)
threshold in class ImageHandlerpublic void thresholdCut(float thld,
boolean keepUnderThld,
boolean strict)
thresholdCut in class ImageHandlerpublic ImageShort crop3D(java.lang.String title, int x_min_, int x_max_, int y_min_, int y_max_, int z_min_, int z_max_)
public ImageShort[] crop3D(java.util.TreeMap<java.lang.Float,int[]> bounds)
public ImageShort crop3DMask(java.lang.String title, ImageInt mask, float label, int x_min_, int x_max_, int y_min_, int y_max_, int z_min_, int z_max_)
crop3DMask in class ImageIntpublic ImageByte crop3DBinary(java.lang.String title, float label, int x_min_, int x_max_, int y_min_, int y_max_, int z_min_, int z_max_)
crop3DBinary in class ImageIntpublic void appendMasks(java.lang.Iterable<ImageInt> images, int startLabel)
images - startLabel - public boolean shiftIndexes(java.util.TreeMap<java.lang.Integer,int[]> bounds)
shiftIndexes in class ImageIntpublic ImageHandler resize(int dX, int dY, int dZ)
ImageHandlerresize in class ImageHandlerdX - the border to add in X, both on left and rightdY - the border to add in Y, both on top and bottomdZ - the border to add in Z, both above and belowpublic ImageShort resample(int newX, int newY, int newZ, int method)
ImageHandlerpublic ImageShort resample(int newZ, int method)
protected ImageFloat normalize_(ImageInt mask, double saturation)
normalize_ in class ImageHandlerpublic ImageFloat normalize(double min, double max)
normalize in class ImageHandlerpublic void invert(ImageInt mask)
invert in class ImageHandlerpublic void draw(Object3D o, float value)
draw in class ImageHandlerprotected void flushPixels()
flushPixels in class ImageHandlerpublic boolean isOpened()
isOpened in class ImageHandlerpublic float getPixelInterpolated(Point3D P)
getPixelInterpolated in class ImageIntpublic int getPixelIntInterpolated(Point3D P)
getPixelIntInterpolated in class ImageIntpublic ImageHandler deleteSlices(int zmin, int zmax)
deleteSlices in class ImageHandlerpublic void trimSlices(int zmin,
int zmax)
trimSlices in class ImageHandler@Deprecated public void intersectMask(ImageInt mask)
intersectMask in class ImageHandlerpublic void intersectMask(ImageHandler mask)
intersectMask in class ImageHandlerpublic double getSizeInMb()
getSizeInMb in class ImageHandlerpublic int getType()
getType in class ImageHandlerpublic int countMaskVolume()
countMaskVolume in class ImageIntpublic void intersectMask2D(ImageInt mask, int z)
intersectMask2D in class ImageHandler