Skip to content

Commit

Permalink
Use specialized point(-match) classes in identity-connections
Browse files Browse the repository at this point in the history
  • Loading branch information
minnerbe committed Jan 25, 2025
1 parent d4eb29e commit dc23520
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import mpicbg.models.IdentityModel;
import mpicbg.models.InterpolatedAffineModel1D;
import mpicbg.models.NoninvertibleModelException;
import mpicbg.models.Point;
import mpicbg.models.PointMatch;
import mpicbg.models.Tile;
import mpicbg.models.TileConfiguration;
Expand Down Expand Up @@ -321,16 +320,14 @@ private static void equilibrateIntensity(final Tile<?> coefficientTile,
final Tile<?> equilibrationTile,
final Double average,
final double weight) {
final PointMatch eqMatch = new PointMatch(new Point(new double[] { average }),
new Point(new double[] { 0.5 }),
weight);
final PointMatch eqMatch = new PointMatch1D(new Point1D(average), new Point1D(0.5), weight);
coefficientTile.connect(equilibrationTile, List.of(eqMatch));
}

static protected void identityConnect(final Tile<?> t1, final Tile<?> t2) {
final ArrayList<PointMatch> matches = new ArrayList<>();
matches.add(new PointMatch(new Point(new double[] { 0 }), new Point(new double[] { 0 })));
matches.add(new PointMatch(new Point(new double[] { 1 }), new Point(new double[] { 1 })));
matches.add(new PointMatch1D(new Point1D(0), new Point1D(0)));
matches.add(new PointMatch1D(new Point1D(1), new Point1D(1)));
t1.connect(t2, matches);
}

Expand Down

0 comments on commit dc23520

Please sign in to comment.