|
||||||||
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.MTBContour2D
public class MTBContour2D
Class to create 2D contour objects with a vector of points, belonging to the contour. Every contour can include a set of inner contours.
Field Summary | |
---|---|
private java.util.Vector<MTBContour2D> |
inner
Set of inner contours if available. |
private int |
pointNum
The number of contour points. |
private java.util.Vector<java.awt.geom.Point2D.Double> |
points
The contour pixels. |
Constructor Summary | |
---|---|
MTBContour2D()
Standard constructor. |
|
MTBContour2D(java.util.Vector<java.awt.geom.Point2D.Double> _points)
Constructor to create an 2D contour object from a 2D point vector. |
Method Summary | |
---|---|
void |
addInner(MTBContour2D C)
Add a inner contour to the existing contour object. |
void |
addPixel(int x,
int y)
Add a 2D point to the existing contour. |
MTBContour2D |
clone()
Override java.lang.Object.clone() to create and return a copy of this object. |
int |
countInner()
Get the number of inner contours including in the contour object. |
java.util.Vector<MTBContour2D> |
getAllInner()
Get all inner contours from the contour object. |
double[] |
getBoundingBox()
Calculates the axes-parallel bounding box of the contour. |
int[] |
getChaincode()
Calculates chaincode from the outer contour. |
MTBContour2D |
getContour()
Get a Contour2D copy of this object. |
double |
getContourLength()
Calculates the length of the outer contour using it's chaincode. |
MTBContour2D |
getInner(int index)
Get a specific inner contour from the contour object. |
java.awt.geom.Point2D.Double |
getPointAt(int index)
Get a specific 2D point belonging to the contour object. |
int |
getPointNum()
Get the number of points of the contour object. |
java.util.Vector<java.awt.geom.Point2D.Double> |
getPoints()
Get all points belonging to the contour object. |
MTBRegion2D |
getRegion(int imageSizeX,
int imageSizeY)
Method to get the included region in a 2D contour as Region2D object. |
void |
setInner(java.util.Vector<MTBContour2D> C)
Set the inner contours of the contour object. |
MTBImage |
toMTBImage(java.lang.String file,
MTBImage image)
Method to save a contour with all inner contours in a given MTBImage image. |
MTBImageByte |
toMTBImageByte(java.lang.String file,
int width,
int height)
Method to save a contour with all inner contours on a binary image with specific width and height. |
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDData |
---|
cloneProperties, getLocation, getProperty, getPropertyKeys, print, setLocation, setProperty |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Vector<MTBContour2D> inner
private int pointNum
private java.util.Vector<java.awt.geom.Point2D.Double> points
Constructor Detail |
---|
public MTBContour2D()
public MTBContour2D(java.util.Vector<java.awt.geom.Point2D.Double> _points)
_points
- vector with 2D pointsMethod Detail |
---|
public void addInner(MTBContour2D C)
C
- the new 2D inner contourpublic void addPixel(int x, int y)
x
- x-coordinate of the new pointy
- y-coordinate of the new pointpublic MTBContour2D clone()
clone
in class java.lang.Object
public int countInner()
public java.util.Vector<MTBContour2D> getAllInner()
public double[] getBoundingBox()
The function extracts the coordinates of the upper left and lower right corner of the bounding box of the contour. Note that the there is at least one point of the contour lying on each side of the bounding box, i.e. the contour not just touches the box, but lies on it.
The result array contains the corner coordinates in the following order: [xmin, ymin, xmax, ymax]
public int[] getChaincode()
public MTBContour2D getContour()
public double getContourLength()
public MTBContour2D getInner(int index)
index
- specific index of the inner contour to get from the inner contour
vector
public java.awt.geom.Point2D.Double getPointAt(int index)
public int getPointNum()
public java.util.Vector<java.awt.geom.Point2D.Double> getPoints()
public MTBRegion2D getRegion(int imageSizeX, int imageSizeY) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
imageSizeX
- width of image that includes the regionimageSizeY
- height of image that includes the region
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
public void setInner(java.util.Vector<MTBContour2D> C)
C
- vector with the inner contours belonging to the contour objectpublic MTBImage toMTBImage(java.lang.String file, MTBImage image) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
file
- path where the file should be saved, can be nullimage
- image where the contours should be drawn in
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
public MTBImageByte toMTBImageByte(java.lang.String file, int width, int height) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
file
- path where the file should be saved, can be nullwidth
- width of the binary imageheight
- height of the binary image
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |