本文整理汇总了Java中ij.gui.TextRoi类的典型用法代码示例。如果您正苦于以下问题:Java TextRoi类的具体用法?Java TextRoi怎么用?Java TextRoi使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextRoi类属于ij.gui包,在下文中一共展示了TextRoi类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testPointRoiCoordinates
import ij.gui.TextRoi; //导入依赖的package包/类
@Test
public void testPointRoiCoordinates() throws Exception {
final PointRoi pointRoi = new PointRoi(8, 9);
pointRoi.setPosition(13);
when(MOCK_ROI_MANAGER.getRoisAsArray()).thenReturn(new Roi[] { new Roi(1, 2,
1, 1), pointRoi, new TextRoi(3, 4, "foo") });
final List<Vector3d> points = RoiManagerUtil.pointROICoordinates(
MOCK_ROI_MANAGER);
assertEquals(1, points.size());
final Vector3d point = points.get(0);
assertEquals(pointRoi.getXBase(), point.x, 1e-12);
assertEquals(pointRoi.getYBase(), point.y, 1e-12);
assertEquals(pointRoi.getPosition(), point.z, 1e-12);
}
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:17,代码来源:RoiManagerUtilTest.java
示例2: label
import ij.gui.TextRoi; //导入依赖的package包/类
protected void label(Overlay overlay) {
NumberFormat nf = NumberFormat.getInstance();
nf.setMaximumFractionDigits(2);
nf.setMinimumFractionDigits(2);
for (int n = 0; n < tool.cBeads.size(); n++) {
CalibrationBead first = tool.cBeads.get(n);
TextRoi text = new TextRoi(first.getU(), first.getV() - 20, "Bead "
/*
* + tool.ids[n] + " (" + nf.format(first.getX()) + ", " +
* nf.format(first.getY()) + ", " + nf.format(first.getZ()) + " | "
* + nf.format(first.getU()) + ", " + nf.format(first.getV()) + ")"
*/);
overlay.add(text);
}
}
开发者ID:akmaier,项目名称:CONRAD,代码行数:19,代码来源:GeometricCalibrationGUI.java
示例3: generateVisualizationRoisFromTrack
import ij.gui.TextRoi; //导入依赖的package包/类
public static ArrayList<Roi> generateVisualizationRoisFromTrack(Subtrajectory t, Color c, boolean showID, double pixelsize){
ArrayList<Roi> proi = new ArrayList<Roi>();
FloatPolygon p = new FloatPolygon();
double sumx = 0;
double sumy = 0;
TextRoi.setFont("TimesRoman", 5, Font.PLAIN);
for(int i = 0; i < t.getParent().size(); i++){
int to = t.size();
if(i< t.size()){
sumx += t.get(i).x/pixelsize;
sumy += t.get(i).y/pixelsize;
p.addPoint(t.get(i).x/pixelsize, t.get(i).y/pixelsize);
to = i+1;
}
PolygonRoi pr = new PolygonRoi(new FloatPolygon(p.xpoints, p.ypoints,to), PolygonRoi.POLYLINE);
pr.setStrokeColor(c);
pr.setPosition(t.getRelativeStartTimepoint()+i+1);
proi.add(pr);
if(showID){
long parentID = t.getParent().getID();
TextRoi troi = new TextRoi(sumx/to, sumy/to," "+parentID+":"+t.getID()+" ");
troi.setPosition(t.getRelativeStartTimepoint()+i+1);
troi.setFillColor(Color.BLACK);
troi.setStrokeColor(c);
troi.setAntialiased(true);
proi.add(troi);
}
}
return proi;
}
开发者ID:thorstenwagner,项目名称:ij-trajectory-classifier,代码行数:35,代码来源:VisualizationUtils.java
示例4: addTriplet
import ij.gui.TextRoi; //导入依赖的package包/类
private void addTriplet(int count, Overlay o, AssignedPoint p1, AssignedPoint p2, AssignedPoint p3,
int classification)
{
float[] x = new float[3];
float[] y = new float[3];
x[0] = p1.x;
x[1] = p2.x;
x[2] = p3.x;
y[0] = p1.y;
y[1] = p2.y;
y[2] = p3.y;
PolygonRoi roi = new PolygonRoi(x, y, 3, Roi.POLYGON);
Color color;
switch (classification)
{
case TRANSLOCATION:
color = Color.CYAN;
break;
case NO_TRANSLOCATION:
color = Color.MAGENTA;
break;
case UNKNOWN:
default:
color = Color.YELLOW;
}
roi.setStrokeColor(color);
o.add(roi);
TextRoi text = new TextRoi(Maths.max(x) + 1, Maths.min(y),
Integer.toString(count) + CLASSIFICATION[classification].charAt(0));
text.setStrokeColor(color);
o.add(text);
}
开发者ID:aherbert,项目名称:GDSC,代码行数:34,代码来源:TranslocationFinder.java
示例5: DLabel
import ij.gui.TextRoi; //导入依赖的package包/类
public DLabel(final Project project, final String text, final double x, final double y) {
super(project, text, x, y);
this.type = TEXT; // default
this.width = 1;
this.height = 1;
this.font = new Font(TextRoi.getFont(), TextRoi.getStyle(), TextRoi.getSize());
addToDatabase();
}
开发者ID:trakem2,项目名称:TrakEM2,代码行数:9,代码来源:DLabel.java
示例6: addString
import ij.gui.TextRoi; //导入依赖的package包/类
void addString(final String text, final int x, final int y, final Color color, final Font font) {
final TextRoi roi = new TextRoi(x, y, text, font);
roi.setLocation(x - text.length() * (int) (fontSize / scale) / 4, y - (int) (fontSize / scale) / 2);
roi.setStrokeColor(color);
overlay.add(roi);
}
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:7,代码来源:Orienteer.java
注:本文中的ij.gui.TextRoi类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论