Loading GUI/src/main/java/cz/fidentis/analyst/distance/DistanceAction.java +14 −23 Original line number Diff line number Diff line Loading @@ -10,7 +10,6 @@ import cz.fidentis.analyst.visitors.face.HausdorffDistancePrioritized; import cz.fidentis.analyst.visitors.mesh.HausdorffDistance.Strategy; import java.awt.Color; import java.awt.event.ActionEvent; import java.util.Collection; import java.util.DoubleSummaryStatistics; import java.util.HashMap; import java.util.List; Loading Loading @@ -140,28 +139,20 @@ public class DistanceAction extends ControlPanelAction { return; } final Map<FeaturePointType, Map<MeshFacet, Double>> faceWeights = visitor.getFeaturePointWeights() .get(getSecondaryDrawableFace().getHumanFace()); final Map<FeaturePointType, Double> featurePointWeights = new HashMap<>(faceWeights.size()); for (final Map.Entry<FeaturePointType, Map<MeshFacet, Double>> fpWeights: faceWeights.entrySet()) { final Collection<Double> weightsList = fpWeights.getValue().values(); final double average; if (weightsList.isEmpty()) { average = Double.NaN; } else { double sum = 0; for (final double weight: weightsList) { sum += weight; } average = sum / weightsList.size(); } featurePointWeights.put(fpWeights.getKey(), average); } controlPanel.updateFeaturePointWeights(featurePointWeights); controlPanel.updateFeaturePointWeights( visitor.getFeaturePointWeights() .get(getSecondaryDrawableFace().getHumanFace()) // Get FP weights for the secondary face .entrySet() .stream() .collect( Collectors.toMap( Map.Entry::getKey, // For each FP type at the secondary face... weights -> weights.getValue() // ... compute average FP weight over all its facets .values() .stream() .mapToDouble(weight -> weight) .average() .orElse(Double.NaN)))); } private Map<MeshFacet, List<Double>> calculateHausdorffDistance() { Loading Loading
GUI/src/main/java/cz/fidentis/analyst/distance/DistanceAction.java +14 −23 Original line number Diff line number Diff line Loading @@ -10,7 +10,6 @@ import cz.fidentis.analyst.visitors.face.HausdorffDistancePrioritized; import cz.fidentis.analyst.visitors.mesh.HausdorffDistance.Strategy; import java.awt.Color; import java.awt.event.ActionEvent; import java.util.Collection; import java.util.DoubleSummaryStatistics; import java.util.HashMap; import java.util.List; Loading Loading @@ -140,28 +139,20 @@ public class DistanceAction extends ControlPanelAction { return; } final Map<FeaturePointType, Map<MeshFacet, Double>> faceWeights = visitor.getFeaturePointWeights() .get(getSecondaryDrawableFace().getHumanFace()); final Map<FeaturePointType, Double> featurePointWeights = new HashMap<>(faceWeights.size()); for (final Map.Entry<FeaturePointType, Map<MeshFacet, Double>> fpWeights: faceWeights.entrySet()) { final Collection<Double> weightsList = fpWeights.getValue().values(); final double average; if (weightsList.isEmpty()) { average = Double.NaN; } else { double sum = 0; for (final double weight: weightsList) { sum += weight; } average = sum / weightsList.size(); } featurePointWeights.put(fpWeights.getKey(), average); } controlPanel.updateFeaturePointWeights(featurePointWeights); controlPanel.updateFeaturePointWeights( visitor.getFeaturePointWeights() .get(getSecondaryDrawableFace().getHumanFace()) // Get FP weights for the secondary face .entrySet() .stream() .collect( Collectors.toMap( Map.Entry::getKey, // For each FP type at the secondary face... weights -> weights.getValue() // ... compute average FP weight over all its facets .values() .stream() .mapToDouble(weight -> weight) .average() .orElse(Double.NaN)))); } private Map<MeshFacet, List<Double>> calculateHausdorffDistance() { Loading