Package net.sourceforge.theba.core.math

Examples of net.sourceforge.theba.core.math.Point3D


        int height = control.getStack().getHeight();
        int depth = control.getStack().getDepth();
        automerge = (1 == control.getPreferences().getInt("autoMerge", 0));
        Point[][] skeleton = new Point[control.MAX_FIBERS][depth];
        Collections.sort(seeds);
        Point3D s;
        Iterator<LumenCandidate> iter = seeds.iterator();
        int count = 0;
        keepTracking = true;
        while (iter.hasNext() && keepTracking && !control.isStopped()) {
            while (paused)
View Full Code Here


            return 0;
        int s = volume.getVoxelUnchecked(xp, yp, zp);
        if (s == val)
            return 0;
        LinkedList<Point3D> queue = new LinkedList<Point3D>();
        queue.addFirst(new Point3D(xp, yp, zp));
        while (queue.isEmpty() == false) {
            Point3D p = queue.removeLast();
            int x = p.x;
            int y = p.y;
            int z = p.z;
            int pixelIndex = x + y * width;
            short[] pixels = volume.getSlice(z);
            pixels[pixelIndex] = val;
            count++;
            if (x < width - 1 && pixels[pixelIndex + 1] == s) {
                queue.addFirst(new Point3D(x + 1, y, z));
                pixels[pixelIndex + 1] = -1;
            }
            if (x - 1 >= 0 && pixels[pixelIndex - 1] == s) {
                queue.addFirst(new Point3D(x - 1, y, z));
                pixels[pixelIndex - 1] = -1;
            }
            if (y < height - 1 && pixels[pixelIndex + width] == s) {
                queue.addFirst(new Point3D(x, y + 1, z));
                pixels[pixelIndex + width] = -1;
            }
            if (y - 1 >= 0 && pixels[pixelIndex - width] == s) {
                queue.addFirst(new Point3D(x, y - 1, z));
                pixels[pixelIndex - width] = -1;
            }
            if (z >= 1 && volume.getSlice(z - 1)[pixelIndex] == s) {
                queue.addFirst(new Point3D(x, y, z - 1));
                volume.getSlice((z - 1))[pixelIndex] = -1;
            }
            if (z < depth - 1 && volume.getSlice(z + 1)[pixelIndex] == s) {
                queue.addFirst(new Point3D(x, y, z + 1));
                volume.getSlice((z + 1))[pixelIndex] = -1;
            }
        }
        return count;
    }
View Full Code Here

//    Skeleton structure for each fiber based on 2D centroids
        Point[][] skeleton = new Point[control.MAX_FIBERS][depth];

        Collections.sort(seeds); //sort seeds according to size (biggest seeds first)
        Point3D s;
        Iterator<LumenCandidate> iter = seeds.iterator();
        int count = 0;
        keepTracking = true;

        while (iter.hasNext() && keepTracking && !control.isStopped()) {
View Full Code Here

                    "Warning", JOptionPane.YES_NO_OPTION);
            if (ans == JOptionPane.NO_OPTION)
                return 0;
        }
        LinkedList<Point3D> queue = new LinkedList<Point3D>();
        queue.addFirst(new Point3D(xp, yp, zp));
        while (queue.isEmpty() == false) {
            Point3D p = queue.removeLast();
            int x = p.x;
            int y = p.y;
            int z = p.z;
            count++;
            volume.setVoxelUnchecked(x, y, z, newValue);
            for (int i = -1; i < 2; i++)
                for (int j = -1; j < 2; j++)
                    for (int k = -1; k < 2; k++) {
                        int xx = i + x;
                        int yy = j + y;
                        int zz = k + z;
                        if (xx < 0 || xx >= width)
                            continue;
                        if (yy < 0 || yy >= height)
                            continue;
                        if (zz < 0 || zz >= depth)
                            continue;
                        short voxel = volume.getVoxel(xx, yy, zz);
                        if (voxel == oldValue) {
                            queue.addFirst(new Point3D(xx, yy, zz));
                            volume.setVoxel(xx, yy, zz, 0);
                        }
                    }
        }
        return count;
View Full Code Here

                        ImageFunctions.floodFill3D26(volume, e.getX(), e.getY(), currentSlice(), (short) 0);
                        updateImage();
                    } else if (measureButton.isSelected()) {
                        measure(e.getPoint());
                    } else if (measureButton3d.isSelected()) {
                        measure3D(new Point3D(e.getX(), e.getY(), currentSlice()));
                    } else {
                        tracker.mouseClicked(new Point3D(e.getX(), e.getY(), currentSlice()));
                    }
                    iw.setEnabled(true);
                    enableMenus();
                }
            });
View Full Code Here

TOP

Related Classes of net.sourceforge.theba.core.math.Point3D

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.