public abstract class Object3D extends java.lang.Object implements java.lang.Comparable<Object3D>
This file is part of mcib3d
mcib3d 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
package mcib3d.geom;
/** Abstract class for 3D objects, compute various measurements, and also distance analysis.
Modifier and Type | Field and Description |
---|---|
protected double |
areaContactUnit
Area in units
|
protected double |
areaContactVoxels |
protected double |
areaNbVoxels
Area in voxels
|
protected double |
bx
IsoBarycenter x
|
protected double |
by
IsoBarycenter x
|
protected double |
bz
IsoBarycenter y
|
protected java.lang.String |
comment
comment on the object (not used yet)
|
double |
compare |
protected java.util.LinkedList<Voxel3D> |
contours
Contours pixels
|
protected ImageHandler |
currentQuantifImage
current image used for quantification (to compute results once)
|
protected double |
cx
Center of mass x
|
protected double |
cy
Center of mass y
|
protected double |
cz
Center of mass z
|
protected EigenvalueDecomposition |
eigen
Matrix of decomposition
|
protected double |
feret
feret diameter
|
protected Voxel3D |
feret1
Pixel 1 for feret diameter
|
protected Voxel3D |
feret2
Pixel 2 for feret diameter
|
protected double |
integratedDensity
Integrated density (sum of pixels)
|
protected KDTreeC |
kdtreeContours
kd-tree for the contour
|
protected ImageHandler |
labelImage
label image, starts at 0,0,0
|
protected double |
meanDensity |
static byte |
MEASURE_AREA_PIX |
static byte |
MEASURE_AREA_UNIT |
static byte |
MEASURE_COMPACTNESS_UNITS |
static byte |
MEASURE_COMPACTNESS_VOXELS |
static byte |
MEASURE_DC_AVG |
static byte |
MEASURE_DC_SD |
static byte |
MEASURE_INTENSITY_AVG |
static byte |
MEASURE_INTENSITY_MAX |
static byte |
MEASURE_INTENSITY_MEDIAN |
static byte |
MEASURE_INTENSITY_MIN |
static byte |
MEASURE_INTENSITY_SD |
static byte |
MEASURE_MAIN_ELONGATION |
static byte |
MEASURE_NONE |
static byte |
MEASURE_VOLUME_PIX |
static byte |
MEASURE_VOLUME_UNIT |
protected ImageInt |
miniLabelImage
The image where the object lies with offset usually xmin, ymin and zmin
|
boolean |
multiThread
use multithreading mode (not used ?)
|
protected java.lang.String |
name
name the object (not used yet)
|
protected double |
pixmax
Max pix value in object
|
protected double |
pixmin
Min pix value in object
|
protected double |
resXY
the resolution in XY
|
protected double |
resZ
the resolution in Z
|
protected double |
s002 |
protected double |
s003 |
protected double |
s004 |
protected double |
s011 |
protected double |
s012 |
protected double |
s013 |
protected double |
s020 |
protected double |
s021 |
protected double |
s022 |
protected double |
s030 |
protected double |
s031 |
protected double |
s040 |
protected double |
s101 |
protected double |
s102 |
protected double |
s103 |
protected double |
s110 |
protected double |
s111 |
protected double |
s112 |
protected double |
s120 |
protected double |
s121 |
protected double |
s130 |
double |
s200
Centred Moments order 2
|
protected double |
s201 |
protected double |
s202 |
protected double |
s210 |
protected double |
s211 |
protected double |
s220 |
protected double |
s300
Centred Moments order 3
|
protected double |
s301 |
protected double |
s310 |
protected double |
s400
Centred Moments order 4
|
protected double |
sigma
standard deviation
|
protected int |
type
category of the object (not used yet)
|
protected java.lang.String |
units
the unit for resolution
|
protected int |
value
Value (grey-level)
|
boolean |
verbose
use verbose mode (not used ?)
|
protected int |
volume
volume in voxels
|
protected int |
xmax
Bounding box
|
protected int |
xmin
Bounding box
|
protected int |
ymax
Bounding box
|
protected int |
ymin
Bounding box
|
protected int |
zmax
Bounding box
|
protected int |
zmin
Bounding box
|
Constructor and Description |
---|
Object3D() |
Modifier and Type | Method and Description |
---|---|
double |
angle(Object3D a,
Object3D b)
Angle between (a, this, b) with real coordinates
|
boolean |
b_closed(float radX,
float radY,
float radZ) |
boolean |
b_open(float radX,
float radY,
float radZ) |
boolean |
centerInside() |
int |
compareTo(Object3D o) |
protected abstract void |
computeBounding()
Compute the bounding box of the object
|
protected abstract void |
computeCenter()
Compute the barycenter of the object
|
abstract void |
computeContours()
Compute the contour voxels of the object
|
void |
computeContours(ImageHandler ima)
The contours is given in an image (see OC3D)
|
protected void |
computeEigen()
Constructor for the computeEigen object
|
protected abstract void |
computeMassCenter(ImageHandler ima)
Compute the mass center of the object using signal from an image
|
protected abstract void |
computeMassCenter(ImageHandler ima,
ImageHandler mask)
Compute the mass center of the object using signal from an image and within a mask
|
java.util.List |
computeMeshSurface(boolean calibrated)
Deprecated.
use Object3D-IJUtils
|
protected abstract void |
computeMoments2(boolean normalize)
Compute the moments of the object (for ellipsoid orientation), order 2
|
protected abstract void |
computeMoments3()
Compute the moments of the object, order 3
|
protected abstract void |
computeMoments4()
Compute the moments of the object, order 4
|
ImageHandler |
createIntersectionImage(Object3D other,
int val1,
int val2)
Create an intersection image around two objects (with no extra borders)
|
ImageHandler |
createIntersectionImage(Object3D other,
int val1,
int val2,
int border)
Create an intersection image around two objects
|
abstract Roi |
createRoi(int z)
Deprecated.
use Object3D-IJUtils
create a roi for a slice
|
ImageHandler |
createSegImage(int bx,
int by,
int bz) |
ImageHandler |
createSegImage(int xmi,
int ymi,
int zmi,
int xma,
int yma,
int zma,
int val) |
ImageInt |
createSegImageMini2D(int val,
int borderSize) |
boolean |
disjointBox(Object3D other) |
double |
distBorderPixel(Object3D other)
the minimum distance between two objets (in real distance) computed on
the contours pixels
|
double |
distBorderUnit(Object3D other)
the minimum distance between two objets (in real distance) computed on
the contours pixels
|
double |
distBorderUnit(Point3D point0,
Object3D other,
Point3D point1,
boolean opposite)
The border to border distance along a direction (EXPERIMENTAL)
|
double |
distCenter2DUnit(Object3D autre)
2D distance from center to center (in real distance)
|
double |
distCenterBorderUnit(Object3D autre)
Distance center of this object to the border of the other
|
double |
distCenterPixel(Object3D other)
distance from center to center (in pixel)
|
double |
distCenterUnit(Object3D autre)
distance from center to center (in real distance)
|
double |
distHausdorffUnit(Object3D other) |
double |
distPixelBorder(Point3D P) |
double |
distPixelBorderUnit(double x,
double y,
double z)
Distance from a point to the border of the object
|
double |
distPixelBorderUnit(double x,
double y,
double z,
Vector3D V)
Distance from a point along a direction to the border of the object
|
double |
distPixelCenter(double x,
double y,
double z)
The distance between center and a point with coordinates
|
double |
distPixelCenter(Point3D P)
The distance between center and a Point3D
|
abstract boolean |
draw(ByteProcessor mask,
int z,
int col)
Deprecated.
use Object3D-IJUtils
drawing inside a 2D byteprocessor
|
void |
draw(ImageHandler mask)
Drawing inside an image, with default value = object value
|
abstract void |
draw(ImageHandler mask,
float val)
drawing inside an ImageHandler
|
abstract void |
draw(ImageHandler mask,
int col,
int tx,
int ty,
int tz) |
abstract void |
draw(ImageStack mask,
int col)
Deprecated.
use Object3D-IJUtils
drawing inside an imagestack
|
abstract void |
draw(ImageStack mask,
int r,
int g,
int b)
Deprecated.
use Object3D-IJUtils
drawing inside an imagestack, in rgb color
|
abstract void |
draw(ObjectCreator3D obj,
int col)
drawing inside an objectCreator
|
void |
drawAt(ImageHandler mask,
int col,
Point3D center) |
void |
drawLink(ImageHandler mask,
Object3D other,
int col)
Drawing links between two objects
|
int |
edgeContact(Object3D other,
int distSquareMax) |
boolean |
edgeImage(ImageHandler img,
boolean edgeXY,
boolean edgeZ) |
double |
getAreaPixels()
the area of the Object3D (in pixels)
|
double |
getAreaUnit()
Gets the areaUnit attribute of the Object3D object
|
float[] |
getArrayValues(ImageHandler ima)
Gets the list of values inside an image as an array
|
int[] |
getBoundingBox()
Get the bounding box of the object
(Xmin, Xmax, Ymin, Ymax, Zmin, Zmax)
|
java.util.ArrayList<Voxel3D> |
getBoundingOriented() |
Calibration |
getCalibration()
Deprecated.
use Object3D-IJUtils
Gets the calibration of the Object3D (ImageJ)
|
double[] |
getCenterAsArray() |
Point3D |
getCenterAsPoint()
Gets the center attribute of the Object3D object
|
Vector3D |
getCenterAsVector()
Gets the center attribute of the Object3D object
|
Vector3D |
getCenterAsVectorUnit()
Gets the center attribute of the Object3D object
|
Vector3D |
getCenterUnit()
Gets the centerUnit attribute of the Object3D object
|
double |
getCenterX()
x coordinate of the center
|
double |
getCenterY()
y coordinate of the center
|
double |
getCenterZ()
z coordinate of the center
|
Object3DVoxels |
getClosedObject(float radX,
float radY,
float radZ) |
abstract int |
getColoc(Object3D obj) |
java.lang.String |
getComment() |
double |
getCompactness() |
double |
getCompactness(boolean useUnit)
Gets the compactness attribute of the Object3D (unit) related to
sphericity
|
java.util.LinkedList<Voxel3D> |
getContours()
return the list of contour voxels
|
Object3DVoxels |
getConvexObject() |
Object3DVoxels |
getConvexObject(boolean multi) |
PolygonRoi |
getConvexPolygonRoi(int z) |
Object3DSurface |
getConvexSurface() |
Object3DVoxels |
getDilatedObject(float radX,
float radY,
float radZ) |
double |
getDistCenterMax()
the maximum distance between center and contours
|
double |
getDistCenterMaxPixel()
the maximum distance between center and contours
|
double |
getDistCenterMean()
the average distance between center and contours
|
double |
getDistCenterMeanPixel()
the average distance between center and contours
|
double |
getDistCenterMin()
the minimum distance between center and contours
|
double |
getDistCenterMinPixel()
the minimum distance between center and contours
|
double |
getDistCenterSigma()
the sigma value for distances between center and contours
|
double |
getDistCenterSigmaPixel()
the sigma value for distances between center and contours
|
Object3DVoxels |
getEllipsoid() |
Object3DVoxels |
getErodedObject(float radX,
float radY,
float radZ) |
double |
getFeret()
Gets the feret diameter of the object (unit)
|
Voxel3D |
getFeretVoxel1()
Gets the first feret voxel of the object (unit)
|
Voxel3D |
getFeretVoxel2()
Gets the second feret voxel of the object (unit)
|
double[] |
getGeometricInvariants()
Compute geometric invariants, based on orders 4 moments
refer to Xu and Li 2008.
|
double[] |
getHomogeneousInvariants()
Compute homogeneous invariants, based on orders 4 moments
|
double |
getIntegratedDensity(ImageHandler ima)
integrated density of the Object3D in an image
|
double |
getIntegratedDensity(ImageHandler ima,
ImageHandler mask) |
protected int[] |
getIntersectionBox(Object3D other) |
Object3DVoxels |
getIntersectionObject(Object3D other)
Get the intersection voxels as a 3D object
|
ImageHandler |
getLabelImage()
Gets the label image of the object (should start at 0,0
|
Object3DVoxels |
getLayerEVFObject(ImageInt mask,
float ratio) |
Object3DVoxels |
getLayerEVFObject(Object3D mask,
float ratio) |
Object3DVoxels |
getLayerObject(float r1,
float r2) |
Vector3D |
getMainAxis()
Gets the mainAxis attribute of the Object3D object (unit)
|
double |
getMainElongation()
Gets the main elongation of the object
|
double |
getMassCenterX(ImageHandler ima)
x coordinate of the center of mass in an image
|
double |
getMassCenterY(ImageHandler ima)
u coordinate of the center of mass in an image
|
double |
getMassCenterZ(ImageHandler ima)
z coordinate of the center of mass in an image
|
Matrix |
getMatrixAxes()
Gets the main axes vectors as a matrix
|
ImageHandler |
getMaxLabelImage(int val)
Get the label image starting at 0,0,0
|
double |
getMeanPixValueAroundBarycenter(boolean massCenter,
ImageInt objectMap,
ImageHandler ima,
double radXY,
double radZ) |
double |
getMeasure(int Measure)
Utility to perform measurement
|
double |
getMedianElongation()
Gets the flatness of the object
|
double[] |
getMoments3D()
This code is taken from the BIOCAT platform:
http://faculty.cs.niu.edu/~zhou/tool/biocat/ Reference for BIOCAT: J.
|
double[] |
getMomentsRaw2()
Returns the moments order 2
|
double[] |
getMomentsRaw3()
Returns the moments order 3
|
double[] |
getMomentsRaw4()
Returns the moments order 4
|
java.lang.String |
getName()
The name of the object
|
static int |
getNbMoments3D() |
int[] |
getNumbering(ImageHandler ima)
Will count the number of different objects within this object *
|
Object3DSurface |
getObject3DSurface()
Convert the object to surface (if necessary)
|
Object3DVoxels |
getObject3DVoxels()
Convert the object to voxels (if necessary)
|
Object3DVoxels |
getOpenedObject(float radX,
float radY,
float radZ) |
double |
getPixCenterValue(ImageHandler ima) |
Voxel3D |
getPixelBorder(double x,
double y,
double z) |
abstract Voxel3D |
getPixelMax(ImageHandler ima)
compute the voxel with maximum value in an image
|
double |
getPixMaxValue(ImageHandler ima)
Gets the pixMaxValue attribute of the Object3D object
|
double |
getPixMeanValue(ImageHandler ima)
Gets the meanPixValue attribute of the Object3D object
|
double |
getPixMeanValueContour(ImageHandler ima) |
double |
getPixMedianValue(ImageHandler ima) |
double |
getPixMinValue(ImageHandler ima)
Gets the pixMinValue attribute of the Object3D object
|
double |
getPixModeNonZero(ImageHandler ima) |
double |
getPixModeValue(ImageHandler ima) |
double |
getPixStdDevValue(ImageHandler ima)
Gets the SD of pixels in object
|
double |
getQuantilePixValue(ImageHandler ima,
double quantile)
Gets the quantile value of the object in the image
|
double |
getRadiusMoments(int order) |
double |
getRatioBox()
Gets the ration between volume and volume of the bounding box (in units)
|
double |
getRatioEllipsoid()
Gets the ration between volume and volume of the ellipsoid (in units)
|
double |
getResXY()
Gets the calibration in XY of the Object3D
|
double |
getResZ()
Gets the calibration in Z of the Object3D
|
double |
getSphericity() |
double |
getSphericity(boolean useUnit)
Gets the sphericity attribute of the Object3D (unit) related to
compactness
|
int |
getType()
The type
|
java.lang.String |
getUnits()
Gets the unit attribute of the Object3D object
|
int |
getValue()
Value of the Object3D
|
double |
getValueAxis(int order)
Gets the valueAxis attribute of the Object3D object (unit)
|
Vector3D |
getVectorAxis(int order)
Gets the Axis attribute of the Object3D object (unit)
|
double |
getVolumeBoundingBoxOrientedPixel()
the volume of the oriented bounding box FIXME computing of oriented box
|
double |
getVolumeBoundingBoxPixel()
the volume of the bounding box
|
double |
getVolumeEllipseUnit()
The volume of the approximated ellipsoid in unit the main radius is DCMax
|
int |
getVolumePixels()
volume of the Object3D (in pixel)
|
double |
getVolumeUnit()
Gets the volume of the Object3D in units
|
abstract java.util.LinkedList<Voxel3D> |
getVoxels()
Get the list of voxels of the object
|
int |
getXmax()
Gets the xmax attribute of the Object3D
|
int |
getXmin()
Gets the xmin attribute of the Object3D
|
int |
getYmax()
Gets the ymax attribute of the Object3D
|
int |
getYmin()
Gets the ymin attribute of the Object3D
|
int |
getZmax()
Gets the zmax attribute of the Object3D
|
int |
getZmin()
Gets the zmin attribute of the Object3D
|
abstract boolean |
hasOneVoxelColoc(Object3D obj) |
abstract boolean |
hasOneVoxelValueRange(ImageHandler img,
int t0,
int t1) |
boolean |
includedInZonesNone(ImageInt imageZones) |
boolean |
includedInZonesOneMore(ImageInt imageZones) |
boolean |
includedInZonesOneOnly(ImageInt imageZones) |
boolean |
includes(Object3D obj) |
boolean |
includesBox(Object3D autre)
Test if the bouding boxes intersect
|
boolean |
includesMarkersNone(ImageInt imageMarkers) |
boolean |
includesMarkersOneMore(ImageInt imageMarkers) |
boolean |
includesMarkersOneOnly(ImageInt imageMarkers) |
void |
init()
Init default values and compute contours and center
|
boolean |
inside(double x,
double y,
double z)
test if the point is inside the object
|
boolean |
inside(Point3D P) |
boolean |
insideAll(java.util.ArrayList<Point3D> markers) |
boolean |
insideBounding(double x,
double y,
double z)
test if the point is inside the bounding box of the object
|
boolean |
insideBounding(double x,
double y,
double z,
int rx,
int ry,
int rz) |
boolean |
insideBounding(float x,
float y,
float z)
test if the point is inside the bounding box of the object
|
boolean |
insideOne(java.util.ArrayList<Point3D> markers) |
boolean |
isContour(Voxel3D vox) |
boolean |
isEmpty() |
abstract ArrayUtil |
listValues(ImageHandler ima)
Outputs the list of Voxels values using intensity image
|
abstract ArrayUtil |
listValues(ImageHandler ima,
float thresh)
Outputs the list of Voxels values using intensity image above a fixed threshold
|
java.util.LinkedList<Voxel3D> |
listVoxels(ImageHandler ima)
gets the list of all pixels within an image as an ArrayList
|
abstract java.util.LinkedList<Voxel3D> |
listVoxels(ImageHandler ima,
double thresh)
List Voxels in the image with values > threshold
|
abstract java.util.LinkedList<Voxel3D> |
listVoxels(ImageHandler ima,
double thresh0,
double thres1)
List Voxels in the image with values > threshold0 and < threshold1
|
java.util.LinkedList<Voxel3D> |
listVoxelsByDistance(Point3D P0,
double dist0,
double dist1,
boolean contourOnly)
List Voxels in the image with with distances in specific range from a reference point
|
protected java.lang.String |
loadInfo(java.io.BufferedReader bf) |
boolean |
overlapBox(Object3D other) |
double |
pcColoc(Object3D obj)
Percentage of colocalisation between two objects relative to this object
|
static double |
pcColocSum(Object3D A,
Object3D B) |
Point3D |
pointPixelBorder(double x,
double y,
double z,
Vector3D V)
Vector from a point along a direction to the border of the object
|
double |
radiusCenter(Object3D obj)
the radius of the object towards another object
|
double |
radiusCenter(Object3D obj,
boolean opposite)
the radius of the object towards another object, in forward or opposite
direction
|
double |
radiusCenter(Vector3D V)
the radius along a direction
|
double |
radiusPixel(double x,
double y,
double z)
the radius towards a point
|
boolean |
regular(float radX,
float radY,
float radZ) |
void |
resetQuantifImage() |
protected void |
saveInfo(java.io.BufferedWriter bf) |
abstract void |
saveObject(java.lang.String path) |
void |
setCalibration(Calibration cal)
Deprecated.
use Object3D-IJUtils
Sets the calibration of the Object3D (ImageJ)
|
void |
setCalibration(double rxy,
double rz,
java.lang.String u)
Sets the calibration of the Object3D
|
void |
setComment(java.lang.String comment) |
void |
setLabelImage(ImageInt labelImage)
Sets the label image of the object (should start at 0,0,0)
|
void |
setName(java.lang.String name)
Sets the name
|
void |
setNewCenter(double x,
double y,
double z) |
void |
setNewCenter(Object3D obj) |
void |
setNewCenter(Vector3D newCenter) |
void |
setResXY(double rxy)
Sets the calibration in XY of the Object3D
|
void |
setResZ(double rz)
Sets the calibration in Z of the Object3D
|
void |
setType(int type)
Sets the type
|
void |
setUnits(java.lang.String u)
Sets the units attribute for the calibration
|
void |
setValue(int v)
Sets the value attribute of the Object3D object
|
int[] |
surfaceContact(Object3D other,
double dist_max)
Get the contact surfaces between two objects, outside voxels < dist and
number of border voxels of this object included in the objectB
|
java.lang.String |
toString()
Display information
|
boolean |
touchBorders(ImageHandler img,
boolean Z) |
boolean |
touchBorders(ImagePlus img,
boolean Z)
Deprecated.
use Object3D-IJUtils
|
abstract void |
translate(double x,
double y,
double z) |
void |
translate(Vector3D V) |
Vector3D |
vectorBorderBorder(Object3D other)
Gets the areaUnit attribute of the Object3D object
|
Vector3D |
vectorBorderBorder(Point3D point0,
Object3D other,
Point3D point1,
boolean opposite)
The vector between V0 and V1 : V0 is the point on border of object from
point0 along direction V1 is the point on border of other object from
point1 along opposite direction
|
Vector3D |
vectorCenterBorder(Object3D other)
The vector between the center of this object and the border of the other
object
|
Vector3D |
vectorPixelBorder(double x,
double y,
double z)
Vector between a pixel and the closest border
|
Vector3D |
vectorPixelBorder(double x,
double y,
double z,
Vector3D V)
Vector from a point along a direction to the border of the object The
distance is the distance to the point where there is a change in the
object appartenance (inside / outside)
|
Vector3D |
vectorPixelBorder(Vector3D V)
Vector between a voxel defined by a vector and the closest border
|
Vector3D |
vectorPixelUnitBorder(double x,
double y,
double z)
vector between a pixel and the border the point is given is real units
|
Vector3D |
vectorPixelUnitBorder(double x,
double y,
double z,
Vector3D dir)
vector between a pixel and the border, along a direction the vector is
given is real units
|
Vector3D |
vectorPixelUnitBorder(Vector3D V)
vector between a point and the border the vector is given is real units
|
Vector3D |
vectorPixelUnitBorder(Vector3D V,
Vector3D dir)
vector between a point and the border along a direction the point is
given is real units
|
Voxel3D[] |
VoxelsBorderBorder(Object3D other)
Return the two voxels defining the border-border distance
|
public static final byte MEASURE_NONE
public static final byte MEASURE_VOLUME_PIX
public static final byte MEASURE_VOLUME_UNIT
public static final byte MEASURE_MAIN_ELONGATION
public static final byte MEASURE_COMPACTNESS_VOXELS
public static final byte MEASURE_COMPACTNESS_UNITS
public static final byte MEASURE_AREA_PIX
public static final byte MEASURE_AREA_UNIT
public static final byte MEASURE_DC_AVG
public static final byte MEASURE_DC_SD
public static final byte MEASURE_INTENSITY_AVG
public static final byte MEASURE_INTENSITY_SD
public static final byte MEASURE_INTENSITY_MIN
public static final byte MEASURE_INTENSITY_MAX
public static final byte MEASURE_INTENSITY_MEDIAN
public double s200
public boolean verbose
public boolean multiThread
public double compare
protected java.lang.String name
protected int type
protected java.lang.String comment
protected int xmin
protected int ymin
protected int zmin
protected int xmax
protected int ymax
protected int zmax
protected double bx
protected double by
protected double bz
protected double cx
protected double cy
protected double cz
protected double areaNbVoxels
protected double areaContactUnit
protected double areaContactVoxels
protected int volume
protected double feret
protected Voxel3D feret1
protected Voxel3D feret2
protected double integratedDensity
protected double meanDensity
protected double sigma
protected double pixmin
protected double pixmax
protected int value
protected java.util.LinkedList<Voxel3D> contours
protected KDTreeC kdtreeContours
protected double s110
protected double s101
protected double s020
protected double s011
protected double s002
protected double s300
protected double s210
protected double s201
protected double s030
protected double s120
protected double s021
protected double s003
protected double s102
protected double s012
protected double s111
protected double s400
protected double s040
protected double s004
protected double s220
protected double s202
protected double s022
protected double s121
protected double s112
protected double s211
protected double s103
protected double s301
protected double s130
protected double s310
protected double s013
protected double s031
protected EigenvalueDecomposition eigen
protected ImageInt miniLabelImage
protected ImageHandler labelImage
protected ImageHandler currentQuantifImage
protected double resXY
protected double resZ
protected java.lang.String units
public static int getNbMoments3D()
public double getResXY()
public void setResXY(double rxy)
rxy
- The new calibration in XYpublic double getResZ()
public void setResZ(double rz)
rz
- he new calibration in Zpublic java.lang.String getUnits()
public void setUnits(java.lang.String u)
u
- The new units valuepublic Calibration getCalibration()
public void setCalibration(Calibration cal)
cal
- The new calibrationpublic final void setCalibration(double rxy, double rz, java.lang.String u)
rxy
- The new calibration in XYrz
- The new calibration in Zu
- The new calibration unitspublic java.lang.String getName()
public void setName(java.lang.String name)
name
- public int getType()
public void setType(int type)
type
- public java.lang.String getComment()
public void setComment(java.lang.String comment)
public ImageHandler getLabelImage()
public void setLabelImage(ImageInt labelImage)
labelImage
- public ImageHandler getMaxLabelImage(int val)
val
- the value to draw the binary maskpublic int getVolumePixels()
public double getMeasure(int Measure)
Measure
- The index of the measurementpublic double getVolumeUnit()
protected abstract void computeCenter()
protected abstract void computeMassCenter(ImageHandler ima)
ima
- the image with the signal intensityprotected abstract void computeMassCenter(ImageHandler ima, ImageHandler mask)
ima
- the image with the signal intensitymask
- the mask to restrain the computationpublic float[] getArrayValues(ImageHandler ima)
ima
- imagepublic double getQuantilePixValue(ImageHandler ima, double quantile)
ima
- imageprotected abstract void computeBounding()
public abstract void computeContours()
protected abstract void computeMoments2(boolean normalize)
normalize
- normalize by volume or notprotected abstract void computeMoments3()
protected abstract void computeMoments4()
public double[] getMomentsRaw2()
public double[] getMomentsRaw3()
public double[] getMomentsRaw4()
public double[] getGeometricInvariants()
public double[] getHomogeneousInvariants()
public double[] getMoments3D()
public abstract Voxel3D getPixelMax(ImageHandler ima)
ima
- the imagepublic java.util.LinkedList<Voxel3D> listVoxels(ImageHandler ima)
ima
- the image with signalpublic abstract ArrayUtil listValues(ImageHandler ima)
ima
- the intensity imagepublic abstract ArrayUtil listValues(ImageHandler ima, float thresh)
ima
- the intensity imagepublic abstract java.util.LinkedList<Voxel3D> listVoxels(ImageHandler ima, double thresh)
ima
- The image with valuesthresh
- the thresholdpublic abstract java.util.LinkedList<Voxel3D> listVoxels(ImageHandler ima, double thresh0, double thres1)
ima
- The image with valuesthresh0
- the min thresholdthres1
- the max thresholdpublic java.util.LinkedList<Voxel3D> listVoxelsByDistance(Point3D P0, double dist0, double dist1, boolean contourOnly)
P0
- the reference pointdist0
- the min distancedist1
- the max distancecontourOnly
- lsit only voxels from the contour of the objectpublic Object3DVoxels getObject3DVoxels()
public Object3DSurface getObject3DSurface()
public double pcColoc(Object3D obj)
obj
- the other objectpublic abstract void draw(ObjectCreator3D obj, int col)
obj
- the object creatorcol
- the color(grey level)public abstract boolean draw(ByteProcessor mask, int z, int col)
mask
- the byte processorz
- the z slicecol
- the color(grey level)public abstract void draw(ImageStack mask, int col)
mask
- the imagecol
- the color(grey level)public abstract void draw(ImageHandler mask, float val)
mask
- the imageval
- the real valuepublic void drawAt(ImageHandler mask, int col, Point3D center)
public abstract void draw(ImageHandler mask, int col, int tx, int ty, int tz)
mask
- col
- tx
- ty
- tz
- public void draw(ImageHandler mask)
mask
- imagepublic void drawLink(ImageHandler mask, Object3D other, int col)
mask
- other
- col
- public abstract void draw(ImageStack mask, int r, int g, int b)
mask
- the imagestackr
- red valueg
- greeen valueb
- blue valuepublic abstract Roi createRoi(int z)
z
- the z slicepublic PolygonRoi getConvexPolygonRoi(int z)
public void init()
public java.util.LinkedList<Voxel3D> getContours()
public int getValue()
public void setValue(int v)
v
- The new value valuepublic int getXmin()
public int getYmin()
public int getZmin()
public int getXmax()
public int getYmax()
public int getZmax()
public int[] getBoundingBox()
public double getCenterX()
public double getCenterY()
public double getCenterZ()
public boolean isEmpty()
public double getIntegratedDensity(ImageHandler ima)
ima
- the imagepublic double getIntegratedDensity(ImageHandler ima, ImageHandler mask)
public double getMassCenterX(ImageHandler ima)
ima
- the imagepublic void setNewCenter(double x, double y, double z)
x
- y
- z
- public void setNewCenter(Object3D obj)
public void setNewCenter(Vector3D newCenter)
public abstract void translate(double x, double y, double z)
x
- y
- z
- public void translate(Vector3D V)
V
- public double getMassCenterY(ImageHandler ima)
ima
- the imagepublic double getMassCenterZ(ImageHandler ima)
ima
- the imagepublic Vector3D getCenterAsVector()
public Vector3D getCenterAsVectorUnit()
public Point3D getCenterAsPoint()
public double[] getCenterAsArray()
public double getAreaPixels()
public double getAreaUnit()
public double getCompactness(boolean useUnit)
useUnit
- use calibration about area and volumespublic double getCompactness()
public double getSphericity()
public double getSphericity(boolean useUnit)
public double getRatioBox()
public double getRatioEllipsoid()
public double getVolumeBoundingBoxPixel()
public double getVolumeBoundingBoxOrientedPixel()
public java.util.ArrayList<Voxel3D> getBoundingOriented()
public double getVolumeEllipseUnit()
protected void computeEigen()
public Matrix getMatrixAxes()
public double getValueAxis(int order)
order
- the order of the valuepublic Vector3D getMainAxis()
public Vector3D getVectorAxis(int order)
order
- the order of the axispublic double getRadiusMoments(int order)
order
- public double getMainElongation()
public double getMedianElongation()
public void computeContours(ImageHandler ima)
ima
- the image with labelled contourspublic double getDistCenterMin()
public double getDistCenterMax()
public double getDistCenterMean()
public double getDistCenterSigma()
public double getDistCenterMinPixel()
public double getDistCenterMaxPixel()
public double getDistCenterMeanPixel()
public double getDistCenterSigmaPixel()
public boolean centerInside()
public double getFeret()
public Voxel3D getFeretVoxel1()
public Voxel3D getFeretVoxel2()
public java.lang.String toString()
toString
in class java.lang.Object
public double distBorderUnit(Object3D other)
other
- the other Object3Dpublic double distHausdorffUnit(Object3D other)
public double distBorderPixel(Object3D other)
other
- the other Object3Dpublic double distBorderUnit(Point3D point0, Object3D other, Point3D point1, boolean opposite)
point0
- other
- the other objectopposite
- point1
- public double distCenterUnit(Object3D autre)
autre
- the other Object3D (has the same resolution !)public double distCenterPixel(Object3D other)
other
- the other Object3Dpublic double distCenter2DUnit(Object3D autre)
autre
- the other Object3Dpublic double distCenterBorderUnit(Object3D autre)
autre
- Other objectpublic double distPixelBorder(Point3D P)
P
- public double distPixelBorderUnit(double x, double y, double z)
x
- x coordinate of the pointy
- y coordinate of the pointz
- z coordinate of the pointpublic double distPixelBorderUnit(double x, double y, double z, Vector3D V)
x
- x coordinate of the point in pixely
- y coordinate of the point in pixelz
- z coordinate of the point in pixelV
- the direction vectorpublic double distPixelCenter(double x, double y, double z)
x
- x-coordinate of the pointy
- y-coordinate of the pointz
- z-coordinate of the pointpublic double distPixelCenter(Point3D P)
P
- the pointpublic Vector3D getCenterUnit()
public boolean isContour(Voxel3D vox)
vox
- public boolean insideBounding(double x, double y, double z)
x
- x coordinate of the pointy
- y coordinate of the pointz
- z coordinate of the pointpublic boolean insideBounding(float x, float y, float z)
x
- x coordinate of the pointy
- y coordinate of the pointz
- z coordinate of the pointpublic boolean insideBounding(double x, double y, double z, int rx, int ry, int rz)
x
- y
- z
- rx
- ry
- rz
- public boolean inside(Point3D P)
public boolean insideOne(java.util.ArrayList<Point3D> markers)
public boolean insideAll(java.util.ArrayList<Point3D> markers)
public boolean inside(double x, double y, double z)
x
- x-coordinate of the pointy
- y-coordinate of the pointz
- z-coordinate of the pointpublic boolean includesBox(Object3D autre)
autre
- the othe objectprotected int[] getIntersectionBox(Object3D other)
other
- public boolean overlapBox(Object3D other)
other
- public boolean disjointBox(Object3D other)
other
- public ImageHandler createIntersectionImage(Object3D other, int val1, int val2, int border)
other
- the Other objectval1
- the value for this objectval2
- the value for other objectborder
- the border around boxpublic ImageHandler createIntersectionImage(Object3D other, int val1, int val2)
other
- the Other objectval1
- the value for this objectval2
- the value for other objectpublic Object3DVoxels getIntersectionObject(Object3D other)
other
- The other objectpublic int[] surfaceContact(Object3D other, double dist_max)
other
- the objectB objectdist_max
- distance max (in pixel) between two contour points of the
two objectspublic int edgeContact(Object3D other, int distSquareMax)
other
- objectdistSquareMax
- object maximum square distance between two voxels (0
for coloc, 1 for side contact, >1 for diagonal contactpublic boolean edgeImage(ImageHandler img, boolean edgeXY, boolean edgeZ)
public double radiusCenter(Object3D obj)
obj
- the other objectpublic double radiusCenter(Object3D obj, boolean opposite)
obj
- the other objectopposite
- opposite or forward directionpublic double radiusCenter(Vector3D V)
V
- the directionpublic double radiusPixel(double x, double y, double z)
x
- the x-coordinate of the pointy
- the y-coordinate of the pointz
- the z-coordinate of the pointpublic Vector3D vectorBorderBorder(Object3D other)
other
- public Voxel3D[] VoxelsBorderBorder(Object3D other)
other
- The other objectpublic Vector3D vectorBorderBorder(Point3D point0, Object3D other, Point3D point1, boolean opposite)
point0
- the first point on this objectother
- the other objectpoint1
- the second point on other objectopposite
- public Vector3D vectorCenterBorder(Object3D other)
other
- the othe objectpublic Vector3D vectorPixelBorder(Vector3D V)
V
- The 3D point defined as a vectorpublic Voxel3D getPixelBorder(double x, double y, double z)
public Vector3D vectorPixelBorder(double x, double y, double z)
x
- x coordinate of the pixely
- y coordinate of the pixelz
- z coordinate of the pixelpublic Vector3D vectorPixelBorder(double x, double y, double z, Vector3D V)
x
- x coordinate of the pointy
- y coordinate of the pointz
- z coordinate of the pointV
- the direction vectorpublic Point3D pointPixelBorder(double x, double y, double z, Vector3D V)
x
- x coordinate of the pointy
- y coordinate of the pointz
- z coordinate of the pointV
- the direction vectorpublic Vector3D vectorPixelUnitBorder(Vector3D V)
V
- the vector (to describe the point)public Vector3D vectorPixelUnitBorder(Vector3D V, Vector3D dir)
V
- the vector (to describe the point)dir
- the directionpublic Vector3D vectorPixelUnitBorder(double x, double y, double z)
x
- the x-coordinate of the pointy
- the y-coordinate of the pointz
- the z-coordinate of the pointpublic Vector3D vectorPixelUnitBorder(double x, double y, double z, Vector3D dir)
x
- the x-coordinate of the pointy
- the y-coordinate of the pointz
- the z-coordinate of the pointdir
- the directionpublic double angle(Object3D a, Object3D b)
a
- Object3D ab
- Object3D bpublic double getPixMeanValue(ImageHandler ima)
ima
- public double getPixMeanValueContour(ImageHandler ima)
public double getPixMedianValue(ImageHandler ima)
public double getPixModeValue(ImageHandler ima)
public double getPixModeNonZero(ImageHandler ima)
public double getMeanPixValueAroundBarycenter(boolean massCenter, ImageInt objectMap, ImageHandler ima, double radXY, double radZ)
massCenter
- objectMap
- ima
- radXY
- radZ
- public double getPixMaxValue(ImageHandler ima)
ima
- public double getPixCenterValue(ImageHandler ima)
public double getPixMinValue(ImageHandler ima)
ima
- public int[] getNumbering(ImageHandler ima)
ima
- A labelled imagepublic void resetQuantifImage()
public double getPixStdDevValue(ImageHandler ima)
ima
- the 3D imagepublic ImageInt createSegImageMini2D(int val, int borderSize)
val
- borderSize
- public ImageHandler createSegImage(int xmi, int ymi, int zmi, int xma, int yma, int zma, int val)
xmi
- ymi
- zmi
- xma
- yma
- zma
- val
- public ImageHandler createSegImage(int bx, int by, int bz)
public abstract java.util.LinkedList<Voxel3D> getVoxels()
public abstract void saveObject(java.lang.String path)
path
- protected void saveInfo(java.io.BufferedWriter bf) throws java.io.IOException
java.io.IOException
protected java.lang.String loadInfo(java.io.BufferedReader bf) throws java.io.IOException
java.io.IOException
public java.util.List computeMeshSurface(boolean calibrated)
calibrated
- public boolean includesMarkersNone(ImageInt imageMarkers)
public boolean includesMarkersOneOnly(ImageInt imageMarkers)
public boolean includesMarkersOneMore(ImageInt imageMarkers)
public boolean includedInZonesNone(ImageInt imageZones)
public boolean includedInZonesOneOnly(ImageInt imageZones)
public boolean includedInZonesOneMore(ImageInt imageZones)
public boolean includes(Object3D obj)
obj
- public abstract boolean hasOneVoxelColoc(Object3D obj)
obj
- public abstract boolean hasOneVoxelValueRange(ImageHandler img, int t0, int t1)
public abstract int getColoc(Object3D obj)
obj
- public boolean touchBorders(ImageHandler img, boolean Z)
public boolean touchBorders(ImagePlus img, boolean Z)
img
- Z
- public boolean b_closed(float radX, float radY, float radZ)
radX
- radY
- radZ
- public boolean b_open(float radX, float radY, float radZ)
radX
- radY
- radZ
- public boolean regular(float radX, float radY, float radZ)
radX
- radY
- radZ
- public Object3DVoxels getDilatedObject(float radX, float radY, float radZ)
radX
- radY
- radZ
- public Object3DVoxels getErodedObject(float radX, float radY, float radZ)
radX
- radY
- radZ
- public Object3DVoxels getClosedObject(float radX, float radY, float radZ)
radX
- radY
- radZ
- public Object3DVoxels getOpenedObject(float radX, float radY, float radZ)
radX
- radY
- radZ
- public Object3DVoxels getLayerObject(float r1, float r2)
public Object3DVoxels getLayerEVFObject(ImageInt mask, float ratio)
public Object3DVoxels getLayerEVFObject(Object3D mask, float ratio)
public Object3DVoxels getEllipsoid()
public Object3DSurface getConvexSurface()
public Object3DVoxels getConvexObject(boolean multi)
multi
- multiprocessorpublic Object3DVoxels getConvexObject()