|
||||||||
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
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.
Field Summary | |
---|---|
private MTBPoint3D |
centroid
The centroid of the region (not normalised by volume!) |
private int |
id
ID of the region (uniqueness is not guaranteed nor checked!) |
private java.util.Vector<MTBPoint3D> |
points
Points belonging to the region |
private int |
volume
The volume of the region (number of points included). |
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(java.util.Vector<MTBPoint3D> p)
Construct a new MTBRegion3D object from the given points. |
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(java.util.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. |
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. |
int |
getID()
Return the ID of the region. |
java.util.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). |
void |
regionToFile(java.lang.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 |
Field Detail |
---|
private MTBPoint3D centroid
private int id
private java.util.Vector<MTBPoint3D> points
private int volume
Constructor Detail |
---|
public MTBRegion3D()
public MTBRegion3D(de.unihalle.informatik.MiToBo_xml.MTBXMLRegion3DType xmlregion3D)
xmlregion3D
- 3D-region in xml-representationpublic MTBRegion3D(java.util.Vector<MTBPoint3D> p)
p
- vector of region pointsMethod Detail |
---|
public void addPoint(double px, double py, double pz)
px
- coordinate in x-dimensionpy
- coordinate in y-dimensionpz
- coordinate in z-dimensionpublic void addPoint(MTBPoint3D p)
p
- point to addpublic MTBPoint3D calcCentre(java.util.Vector<MTBPoint3D> p)
p
- vector of Point3D
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]
public MTBPoint3D getCentre()
public double getCentreX()
public double getCentreY()
public double getCentreZ()
public int getID()
public java.util.Vector<MTBPoint3D> getPoints()
public int getSizeX()
public int getSizeY()
public int getSizeZ()
public double getVolume()
public void regionToFile(java.lang.String fileName)
fileName
- File name to store the region on disk.public void setID(int id)
id
- region IDpublic de.unihalle.informatik.MiToBo_xml.MTBXMLRegion3DType toXMLType()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |