当前位置: 首页>>代码示例>>Java>>正文


Java PlanarImage.getTileIndices方法代码示例

本文整理汇总了Java中javax.media.jai.PlanarImage.getTileIndices方法的典型用法代码示例。如果您正苦于以下问题:Java PlanarImage.getTileIndices方法的具体用法?Java PlanarImage.getTileIndices怎么用?Java PlanarImage.getTileIndices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.media.jai.PlanarImage的用法示例。


在下文中一共展示了PlanarImage.getTileIndices方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: detectSegmentations

import javax.media.jai.PlanarImage; //导入方法依赖的package包/类
public List<Shape> detectSegmentations(int minSegmentationSize, PlanarImage sourceImage) {
    logger.trace("getSegmentations (minSegmentation=" + minSegmentationSize + ")");
    rf.initializeClassColors();
    //if (rf.getNegativeChannel() != null) rf.getNegativeChannel().initializeClassColors();
    if (sourceImage == null) return new ArrayList<Shape>(0);
    short[][] smap = new short[sourceImage.getWidth()][sourceImage.getHeight()];

    for (int x = 0; x < sourceImage.getWidth(); x++)
        for (int y = 0; y < sourceImage.getHeight(); y++)
            smap[x][y] = Short.MAX_VALUE;

    // init
    Point[] tileArr = sourceImage.getTileIndices(null);
    int c;
    for (Point tileNum : tileArr) {
        if (isCancelled()) break;
        final int b = 2;

        Raster raster = sourceImage.getTile(tileNum.x, tileNum.y);
        for (int x = sourceImage.tileXToX(tileNum.x) + b; x < Math.min(sourceImage.tileXToX(tileNum.x) + sourceImage.getTileWidth() - b, sourceImage.getWidth()); x++) {
            for (int y = sourceImage.tileYToY(tileNum.y) + b; y < Math.min(sourceImage.tileYToY(tileNum.y) + sourceImage.getTileHeight() - b, sourceImage.getHeight()); y++) {
                if (fullRoi != null && !(fullRoi.contains(x + roi.getBounds().x, y + roi.getBounds().y))) {
                    continue;
                }

                c = raster.getSample(x, y, 0) < 200 ? 0 : 1; // dark=foreground, white=background (only red channel is taken into account)
                if (c == 0) {  // not background, not assigned
                    smap[x][y] = 1; // 1
                } else {
                    smap[x][y] = 0; // 0
                }
            } //y
        } // x
    } // tileNum


    if (isCancelled()) return null;
    return findPolygons(smap, minSegmentationSize);
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:40,代码来源:NerveDetectionWorker.java

示例2: detectSegmentations

import javax.media.jai.PlanarImage; //导入方法依赖的package包/类
public List<Shape> detectSegmentations(int minSegmentationSize, PlanarImage sourceImage, Shape roi) {
    logger.trace("getSegmentations (minSegmentation=" + minSegmentationSize + ")");
    if (sourceImage == null) return new ArrayList<Shape>(0);
    short[][] smap = new short[sourceImage.getWidth()][sourceImage.getHeight()];

    for (int x = 0; x < sourceImage.getWidth(); x++)
        for (int y = 0; y < sourceImage.getHeight(); y++)
            smap[x][y] = Short.MAX_VALUE;

    // init
    Point[] tileArr = sourceImage.getTileIndices(null);
    int c;
    for (Point tileNum : tileArr) {
        if (isCancelled()) break;
        final int b = 2;

        Raster raster = sourceImage.getTile(tileNum.x, tileNum.y);
        for (int x = sourceImage.tileXToX(tileNum.x) + b; x < Math.min(sourceImage.tileXToX(tileNum.x) + sourceImage.getTileWidth() - b, sourceImage.getWidth()); x++) {
            for (int y = sourceImage.tileYToY(tileNum.y) + b; y < Math.min(sourceImage.tileYToY(tileNum.y) + sourceImage.getTileHeight() - b, sourceImage.getHeight()); y++) {
                if (fullRoi != null && !(fullRoi.contains(x + roi.getBounds().x, y + roi.getBounds().y))) {
                    continue;
                }

                c = raster.getSample(x, y, 0) < 200 ? 0 : 1; // dark=foreground, white=background (only red channel is taken into account)
                if (c == 0) {  // not background, not assigned
                    smap[x][y] = 1; // 1
                } else {
                    smap[x][y] = 0; // 0
                }
            } //y
        } // x
    } // tileNum


    if (isCancelled()) return null;
    return findPolygons(smap, orderPoints, minSegmentationSize, roi);
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:38,代码来源:NerveDetectionWorkerMultiCore.java


注:本文中的javax.media.jai.PlanarImage.getTileIndices方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。