本文整理汇总了Java中ij.gui.Roi.setStrokeWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Roi.setStrokeWidth方法的具体用法?Java Roi.setStrokeWidth怎么用?Java Roi.setStrokeWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.gui.Roi
的用法示例。
在下文中一共展示了Roi.setStrokeWidth方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makePolygon
import ij.gui.Roi; //导入方法依赖的package包/类
@Deprecated
public static Roi makePolygon(Point2D[] points, double strokeWidth, Color color) {
Path2D poly = new Path2D.Double();
if (points.length > 0) {
poly.moveTo(points[0].getX(), points[0].getY());
for (int i = 1; i < points.length; i++) {
poly.lineTo(points[i].getX(), points[i].getY());
}
poly.closePath();
}
Roi shapeRoi = new ShapeRoi(poly);
shapeRoi.setStrokeWidth(strokeWidth);
shapeRoi.setStrokeColor(color);
return shapeRoi;
}
示例2: addPath
import ij.gui.Roi; //导入方法依赖的package包/类
void addPath(final Shape shape, final Color color, final BasicStroke stroke) {
final Roi roi = new ShapeRoi(shape);
roi.setStrokeColor(color);
roi.setStroke(stroke);
roi.setStrokeWidth(roi.getStrokeWidth() / (float) scale);
overlay.add(roi);
}
示例3: getOverlay
import ij.gui.Roi; //导入方法依赖的package包/类
private final Overlay getOverlay(Color overlayColor, float overlayWidth) {
Roi[] rois = roiManager.getRoisAsArray();
Overlay over = new Overlay();
for (int j = 0; j < rois.length; j++) {
Roi roi = rois[j];
roi.setStrokeColor(overlayColor);
roi.setStrokeWidth(overlayWidth);
over.add(roi);
}
return over;
}
示例4: overlayRAG
import ij.gui.Roi; //导入方法依赖的package包/类
private void overlayRAG(Set<LabelPair> adjList, ImagePlus imagePlus, ImagePlus targetPlus)
{
IJ.log("display RAG");
// first compute centroids
ImageProcessor image = imagePlus.getProcessor();
int[] labels = LabelImages.findAllLabels(image);
Map<Integer, Integer> labelMap = LabelImages.mapLabelIndices(labels);
double[][] centroids = GeometricMeasures2D.centroids(image, labels);
// create an overlay for drawing edges
Overlay overlay = new Overlay();
// iterate over adjacencies to add edges to overlay
for (LabelPair pair : adjList)
{
// first retrieve index in centroid array
int ind1 = labelMap.get(pair.label1);
int ind2 = labelMap.get(pair.label2);
// coordinates of edge extremities
int x1 = (int) centroids[ind1][0];
int y1 = (int) centroids[ind1][1];
int x2 = (int) centroids[ind2][0];
int y2 = (int) centroids[ind2][1];
// draw current edge
Roi roi = new Line(x1, y1, x2, y2);
roi.setStrokeColor(Color.GREEN);
roi.setStrokeWidth(2);
overlay.add(roi);
}
targetPlus.setOverlay(overlay);
}
示例5: configureOverlayRoi
import ij.gui.Roi; //导入方法依赖的package包/类
private static void configureOverlayRoi(Roi roi)
{
roi.setStrokeWidth(1);
roi.setStrokeColor(Color.CYAN);
roi.setFillColor(Color.YELLOW);
}