Java Code Examples for ij.gui.Roi#POLYLINE

The following examples show how to use ij.gui.Roi#POLYLINE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MaxFeretDiameterPlugin.java    From MorphoLibJ with GNU Lesser General Public License v3.0 6 votes vote down vote up
private Roi createDiametersRoi(PointPair2D pointPair, Calibration calib)
{
	if (pointPair == null)
   	{
   		return null;
   	}

	Point2D p1 = calibToPixel(pointPair.p1, calib);
	Point2D p2 = calibToPixel(pointPair.p2, calib);
	
	// Convert to Polyline ROI
	float[] x = new float[2];
       float[] y = new float[2];
       x[0] = (float) p1.getX();
       y[0] = (float) p1.getY();
       x[1] = (float) p2.getX();
       y[1] = (float) p2.getY();
       return new PolygonRoi(x, y, 2, Roi.POLYLINE);
}
 
Example 2
Source File: M.java    From TrakEM2 with GNU General Public License v3.0 5 votes vote down vote up
/** Returns true if the roi is of closed shape type like an OvalRoi, ShapeRoi, a Roi rectangle, etc. */
static public final boolean isAreaROI(final Roi roi) {
	switch (roi.getType()) {
		case Roi.POLYLINE:
		case Roi.FREELINE:
		case Roi.LINE:
		case Roi.POINT:
			return false;
	}
	return true;
}