TestImageGenerator.java 文件源码

java
阅读 15 收藏 0 点赞 0 评论 0

项目:orbit-image-analysis 作者:
public TestImageGenerator(double[][] matrix, double[] gain, String[] channelNames, int width, int height) {
    this.matrix = matrix;
    this.gain = gain;
    this.channelNames = channelNames;
    this.rand = new Random();
    this.sizeC = channelNames.length;
    this.width = width;
    this.height = height;
    this.concentrations = new List[sizeC];
    this.signals = new double[sizeC][numCells];


    // generate concentrations
    for (int s=0; s<sizeC; s++) {
         concentrations[s] = new ArrayList<>(numCells);
        for (int i=0; i<numCells; i++) {
            int x = rand.nextInt((int)(width-cellRadius));
            int y = rand.nextInt((int)(height-cellRadius));
            Arc2D p = new Arc2D.Double(Arc2D.CHORD);
            p.setArcByCenter(x, y, cellRadius, 0d, 360d, Arc2D.CHORD);
            concentrations[s].add(p);
            double density = (rand.nextGaussian() * 100d) + 100;
            signals[s][i] = density;
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号