private void filter(KDTreeCell cell, ArrayList<FCECenter> candidates) {
        try {
            ArrayList<FCECenter> input = new ArrayList<>();
            input.addAll(candidates);
            if (cell.isLeafNode() && !cell.isEmpty()) {
                Collections.sort(input, new CenterDistanceComparator(cell.getPoint()));
                input.get(0).addToCount(1);
                input.get(0).addToSum(cell.getPoint());
            } else {
                Collections.sort(input, new CenterDistanceComparator(cell.getCenter()));
                FCECenter closest = input.get(0);
                Iterator<FCECenter> it = input.iterator();
                it.next();
                while (it.hasNext()) {
                    FCECenter z = it.next();
                    Point midpoint = closest.getCenter().midpointFromPoint(z.getCenter());
                    Vector normal = new Vector(midpoint, closest.getCenter());
                    if (cell.getBoundingBox().intersectWithPlane(new Plane(midpoint, normal)) == BoundingBox.BB_INFRONT)
                        it.remove();
                }
                if (input.size() > 1) {
                    ArrayList<FCECenter> newCandidates = new ArrayList<>();
                    newCandidates.addAll(input);
                    this.filter(cell.getChild(0), newCandidates);
                    this.filter(cell.getChild(1), input);
                } else {
                    closest.addToCount(cell.getPointCount());
                    closest.addToSum(cell.getSum());
                }
            }
        } catch (CenterDistanceComparatorException cdce) {
        } catch (GeometryException | KDTreeCellException ge) {
        } catch (FCEException fcee) {}
    }