本文整理汇总了Java中ij.gui.Roi.setPosition方法的典型用法代码示例。如果您正苦于以下问题:Java Roi.setPosition方法的具体用法?Java Roi.setPosition怎么用?Java Roi.setPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ij.gui.Roi
的用法示例。
在下文中一共展示了Roi.setPosition方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractSelection
import ij.gui.Roi; //导入方法依赖的package包/类
private Roi extractSelection(ImageProcessor maskIp, int maskId, int channel, int slice, int frame)
{
maskIp.setThreshold(maskId, maskId, ImageProcessor.NO_LUT_UPDATE);
ThresholdToSelection ts = new ThresholdToSelection();
Roi roi = ts.convert(maskIp);
if (imp.getStackSize() == 1)
{
roi.setPosition(0);
}
else if (imp.isDisplayedHyperStack())
{
if (showOverlay != 1)
slice = 0; // Display across entire slice stack
roi.setPosition(channel, slice, frame);
}
else
{
// We cannot support display across the entire stack if this is not a hyperstack
int index = imp.getStackIndex(channel, slice, frame);
roi.setPosition(index);
}
Rectangle roiBounds = roi.getBounds();
roi.setLocation(bounds.x + roiBounds.x, bounds.y + roiBounds.y);
return roi;
}
示例2: addToOverlay
import ij.gui.Roi; //导入方法依赖的package包/类
private void addToOverlay(Overlay o, Roi roi, boolean isHyperStack, int frame)
{
if (isHyperStack)
roi.setPosition(0, 0, frame);
else
roi.setPosition(frame);
o.add(roi);
}
示例3: addToProjectionOverlay
import ij.gui.Roi; //导入方法依赖的package包/类
private void addToProjectionOverlay(Overlay mainOverlay, Overlay overlay, int frame, int channel)
{
if (projectionImp.getNFrames() == 1)
frame = 1;
overlay = overlay.duplicate();
Roi[] rois = overlay.toArray();
for (Roi roi : rois)
{
if (dualChannel)
roi.setPosition(channel, 1, frame);
else
roi.setPosition(frame);
mainOverlay.add(roi);
}
}
示例4: getPerimeter
import ij.gui.Roi; //导入方法依赖的package包/类
@SuppressWarnings("unused")
private double getPerimeter(ImageProcessor maskIp, int maskId, Overlay overlay, int z)
{
maskIp.setThreshold(maskId, maskId, ImageProcessor.NO_LUT_UPDATE);
ThresholdToSelection ts = new ThresholdToSelection();
Roi roi = ts.convert(maskIp);
if (overlay != null)
{
roi.setPosition(z);
roi.setLocation(bounds.x, bounds.y);
overlay.add(roi);
}
double perimeter = roi.getLength();
return perimeter;
}