|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.Alida.operator.ALDData
de.unihalle.informatik.MiToBo.core.datatypes.MTBRegion3D
@ALDParametrizedClass public class MTBRegion3D
Class to create a 3D region object. The center of mass and the volume of the 3D region can be calculated as well as other 3D region properties.
Constructor Summary | |
---|---|
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 |
Method Summary | |
---|---|
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()
|
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDData |
---|
cloneProperties, getLocation, getProperty, getPropertyKeys, print, setLocation, setProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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-representationMethod Detail |
---|
public 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 Point3D
public 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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |