@ALDParametrizedClass
public class MTBRegion3D
extends de.unihalle.informatik.Alida.operator.ALDData
Modifier and Type | Field and Description |
---|---|
private MTBPoint3D |
centroid
The centroid of the region (not normalised by volume!)
|
private double |
compactFactor
factors needed for compactness calculation
|
private double |
five_thirds |
private int |
id
ID of the region (uniqueness is not guaranteed nor checked!)
|
private Vector<MTBPoint3D> |
points
Points belonging to the region
|
private int |
volume
The volume of the region (number of points included).
|
Constructor and Description |
---|
MTBRegion3D()
Construct a new MTBRegion3D object.
|
MTBRegion3D(de.unihalle.informatik.MiToBo_xml.MTBXMLRegion3DType xmlregion3D)
Construct a new MTBRegion3D from a 3D-region in xml-representation.
|
MTBRegion3D(Vector<MTBPoint3D> p)
Construct a new MTBRegion3D object from the given points.
|
MTBRegion3D(Vector<MTBPoint3D> p,
int id)
Construct a new MTBRegion3D object from the given points and set its id
|
Modifier and Type | Method and Description |
---|---|
void |
addPoint(double px,
double py,
double pz)
Append a point to the region from the given coordinates.
|
void |
addPoint(MTBPoint3D p)
Append a 3D point to the region.
|
MTBPoint3D |
calcCentre(Vector<MTBPoint3D> p)
Calculate the centroid (not yet normalized by volume) of a given vector of
points.
|
double[] |
getBoundingBox()
Calculates the axes-parallel bounding box of the region.
|
double |
getCentralMoment(int p,
int q,
int r) |
MTBPoint3D |
getCentre()
Return the center of the region as 3D point.
|
double |
getCentreX()
Return the x-coordinate of the center of the region.
|
double |
getCentreY()
Return the y-coordinate of the center of the region.
|
double |
getCentreZ()
Return the z-coordinate of the center of the region.
|
double |
getCompactness()
calculates compactness value according to
Carlos Martinez-Ortiz. "2D and 3D Shape Descriptors". |
int |
getID()
Return the ID of the region.
|
double |
getMoment(int p,
int q,
int r) |
Vector<MTBPoint3D> |
getPoints()
Return the points which are included in the 3D region.
|
int |
getSizeX()
Calculate the expansion in x-direction of the region.
|
int |
getSizeY()
Calculate the expansion in y-direction of the region.
|
int |
getSizeZ()
Calculate the expansion in z-direction of the region.
|
double |
getVolume()
Return the volume of the 3D region (number of points within the region).
|
protected void |
hookPointsUpdated()
Function to update object state after setting new point list.
|
void |
regionToFile(String fileName)
Write the coordinates of the included 3D points into a text file.
|
void |
setID(int id)
Set the ID of the region.
|
de.unihalle.informatik.MiToBo_xml.MTBXMLRegion3DType |
toXMLType() |
@ALDClassParameter(label="List of points", changeValueHook="hookPointsUpdated") private Vector<MTBPoint3D> points
private int volume
private MTBPoint3D centroid
private int id
private final double compactFactor
private final double five_thirds
public MTBRegion3D()
public MTBRegion3D(Vector<MTBPoint3D> p)
p
- vector of region pointspublic MTBRegion3D(Vector<MTBPoint3D> p, int id)
p
- id
- public MTBRegion3D(de.unihalle.informatik.MiToBo_xml.MTBXMLRegion3DType xmlregion3D)
xmlregion3D
- 3D-region in xml-representationpublic de.unihalle.informatik.MiToBo_xml.MTBXMLRegion3DType toXMLType()
public void setID(int id)
id
- region IDpublic int getID()
public Vector<MTBPoint3D> getPoints()
public double getVolume()
public MTBPoint3D getCentre()
public double getCentreX()
public double getCentreY()
public double getCentreZ()
public void addPoint(MTBPoint3D p)
p
- point to addpublic void addPoint(double px, double py, double pz)
px
- coordinate in x-dimensionpy
- coordinate in y-dimensionpz
- coordinate in z-dimensionpublic MTBPoint3D calcCentre(Vector<MTBPoint3D> p)
p
- vector of Point3Dpublic double getMoment(int p, int q, int r)
p
- q
- r
- public double getCentralMoment(int p, int q, int r)
p
- q
- r
- public double getCompactness()
public int getSizeZ()
public int getSizeY()
public int getSizeX()
public void regionToFile(String fileName)
fileName
- File name to store the region on disk.public double[] getBoundingBox()
The function extracts the coordinates of the back upper left and front lower right corner of the bounding box of the region. Note that the there is at least one point of the region lying on each side of the bounding box, i.e. the region not just touches the box, but lies on it.
The result array contains the corner coordinates in the following order: [xmin, ymin, zmin, xmax, ymax, zmax]
protected void hookPointsUpdated()
It is assumed that point list is up-to-date before calling the hook.
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.