本文整理汇总了Java中ij.plugin.filter.ThresholdToSelection类的典型用法代码示例。如果您正苦于以下问题:Java ThresholdToSelection类的具体用法?Java ThresholdToSelection怎么用?Java ThresholdToSelection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ThresholdToSelection类属于ij.plugin.filter包,在下文中一共展示了ThresholdToSelection类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: extractSelection
import ij.plugin.filter.ThresholdToSelection; //导入依赖的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;
}
开发者ID:aherbert,项目名称:GDSC,代码行数:26,代码来源:SpotDistance.java
示例2: labelsToConnectedROIs
import ij.plugin.filter.ThresholdToSelection; //导入依赖的package包/类
/**
* Create ROIs from labels in an image.
*
* This differs from labelsToConnectedROIs in that the ROIs created may be
* disconnected and contain holes.
*
* @param ipLabels
* @param n
* @return
*/
public static Roi[] labelsToConnectedROIs(ImageProcessor ipLabels, int n) {
Roi[] rois = new Roi[n];
int w = ipLabels.getWidth();
int h = ipLabels.getHeight();
ByteProcessor bpCompleted = new ByteProcessor(w, h);
bpCompleted.setValue(255);
ThresholdToSelection tts = new ThresholdToSelection();
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
if (bpCompleted.get(x, y) != 0)
continue;
float val = ipLabels.getf(x, y);
if (val > 0 && val <= n) {
Wand wand = new Wand(ipLabels);
ipLabels.resetThreshold();
wand.autoOutline(x, y, val, val, Wand.EIGHT_CONNECTED);
Roi roi = wandToRoi(wand);
// Check if ROI contains holes, and create if necessary
ipLabels.setRoi(roi);
ImageStatistics stats = ipLabels.getStatistics();
if (stats.max != stats.min || rois[(int)val-1] != null) {
ipLabels.setThreshold(val-0.25, val+0.25, ImageProcessor.NO_LUT_UPDATE);
roi = tts.convert(ipLabels);
}
rois[(int)val-1] = roi;
bpCompleted.fill(roi);
}
}
}
return rois;
}
开发者ID:qupath,项目名称:qupath,代码行数:44,代码来源:ROILabeling.java
示例3: getPerimeter
import ij.plugin.filter.ThresholdToSelection; //导入依赖的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;
}
开发者ID:aherbert,项目名称:GDSC,代码行数:16,代码来源:SpotDistance.java
注:本文中的ij.plugin.filter.ThresholdToSelection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论