Skip to content

Commit 23f7196

Browse files
committed
Update parent to pom-scijava 21.0.0
This brings in imglib2-roi 0.5.1, and makes the changes necessary to account for backwards-incompatible changes in its API. Yes, 0.5.0 -> 0.5.1 should not break API under normal circumstances. But for whatever crazy reasons, IIRC, we decided that the removal of "writable" from the GeomMasks method names was a "bug fix".
1 parent 71a9f1d commit 23f7196

File tree

2 files changed

+24
-32
lines changed

2 files changed

+24
-32
lines changed

pom.xml

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.scijava</groupId>
77
<artifactId>pom-scijava</artifactId>
8-
<version>19.2.0</version>
8+
<version>21.0.0</version>
99
<relativePath />
1010
</parent>
1111

@@ -145,8 +145,6 @@ Institute of Molecular Cell Biology and Genetics.</license.copyrightOwners>
145145
<releaseProfiles>deploy-to-imagej</releaseProfiles>
146146

147147
<scijava-common.version>2.73.0</scijava-common.version>
148-
<imglib2.version>5.1.0</imglib2.version>
149-
<imglib2-roi.version>0.5.0</imglib2-roi.version>
150148
</properties>
151149

152150
<repositories>

src/main/java/net/imagej/roi/ROIService.java

+23-29
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@
5252
import net.imglib2.roi.RealMask;
5353
import net.imglib2.roi.RealMaskRealInterval;
5454
import net.imglib2.roi.geom.GeomMasks;
55-
import net.imglib2.roi.geom.real.DefaultWritableRealPointCollection;
5655
import net.imglib2.roi.geom.real.RealPointCollection;
57-
import net.imglib2.roi.geom.real.RealPointSampleListWritableRealPointCollection;
5856
import net.imglib2.roi.geom.real.WritableBox;
5957
import net.imglib2.roi.geom.real.WritableEllipsoid;
6058
import net.imglib2.roi.geom.real.WritableLine;
@@ -247,7 +245,7 @@ RealRandomAccessibleRealInterval<BoolType> toRealRandomAccessibleRealInterval(
247245
* @return a {@link WritableBox} with the given min/max
248246
*/
249247
default WritableBox closedBox(final double[] min, final double[] max) {
250-
return GeomMasks.closedWritableBox(min, max);
248+
return GeomMasks.closedBox(min, max);
251249
}
252250

253251
/**
@@ -259,7 +257,7 @@ default WritableBox closedBox(final double[] min, final double[] max) {
259257
* @return a {@link WritableBox} with the given min/max
260258
*/
261259
default WritableBox openBox(final double[] min, final double[] max) {
262-
return GeomMasks.openWritableBox(min, max);
260+
return GeomMasks.openBox(min, max);
263261
}
264262

265263
// ---- Ellipsoid ----
@@ -276,7 +274,7 @@ default WritableBox openBox(final double[] min, final double[] max) {
276274
default WritableEllipsoid closedEllipsoid(final double[] center,
277275
final double[] semiAxisLengths)
278276
{
279-
return GeomMasks.closedWritableEllipsoid(center, semiAxisLengths);
277+
return GeomMasks.closedEllipsoid(center, semiAxisLengths);
280278
}
281279

282280
/**
@@ -291,7 +289,7 @@ default WritableEllipsoid closedEllipsoid(final double[] center,
291289
default WritableEllipsoid openEllipsoid(final double[] center,
292290
final double[] semiAxisLengths)
293291
{
294-
return GeomMasks.openWritableEllipsoid(center, semiAxisLengths);
292+
return GeomMasks.openEllipsoid(center, semiAxisLengths);
295293
}
296294

297295
// ---- Line ----
@@ -306,7 +304,7 @@ default WritableEllipsoid openEllipsoid(final double[] center,
306304
default WritableLine line(final RealLocalizable pointOne,
307305
final RealLocalizable pointTwo)
308306
{
309-
return GeomMasks.writableLine(pointOne, pointTwo);
307+
return GeomMasks.line(pointOne, pointTwo);
310308
}
311309

312310
/**
@@ -321,7 +319,7 @@ default WritableLine line(final RealLocalizable pointOne,
321319
default WritableLine line(final double[] pointOne, final double[] pointTwo,
322320
final boolean copy)
323321
{
324-
return GeomMasks.writableLine(pointOne, pointTwo, copy);
322+
return GeomMasks.line(pointOne, pointTwo, copy);
325323
}
326324

327325
// ---- Point ----
@@ -333,7 +331,7 @@ default WritableLine line(final double[] pointOne, final double[] pointTwo,
333331
* @return a point at the given location
334332
*/
335333
default WritablePointMask pointMask(final double[] point) {
336-
return (WritablePointMask) GeomMasks.writablePointMask(point);
334+
return GeomMasks.pointMask(point);
337335
}
338336

339337
/**
@@ -343,7 +341,7 @@ default WritablePointMask pointMask(final double[] point) {
343341
* @return a point at the given location
344342
*/
345343
default WritablePointMask pointMask(final RealLocalizable point) {
346-
return (WritablePointMask) GeomMasks.writablePointMask(point);
344+
return GeomMasks.pointMask(point);
347345
}
348346

349347
// ---- Polygon2D ----
@@ -358,7 +356,7 @@ default WritablePointMask pointMask(final RealLocalizable point) {
358356
default WritablePolygon2D polygon2D(
359357
final List<? extends RealLocalizable> vertices)
360358
{
361-
return GeomMasks.writablePolygon2D(vertices);
359+
return GeomMasks.polygon2D(vertices);
362360
}
363361

364362
/**
@@ -370,7 +368,7 @@ default WritablePolygon2D polygon2D(
370368
* @return a 2D polygon with the given vertices
371369
*/
372370
default WritablePolygon2D polygon2D(final double[] x, final double[] y) {
373-
return GeomMasks.writablePolygon2D(x, y);
371+
return GeomMasks.polygon2D(x, y);
374372
}
375373

376374
/**
@@ -383,7 +381,7 @@ default WritablePolygon2D polygon2D(final double[] x, final double[] y) {
383381
default WritablePolygon2D closedPolygon2D(
384382
final List<? extends RealLocalizable> vertices)
385383
{
386-
return GeomMasks.closedWritablePolygon2D(vertices);
384+
return GeomMasks.closedPolygon2D(vertices);
387385
}
388386

389387
/**
@@ -397,7 +395,7 @@ default WritablePolygon2D closedPolygon2D(
397395
default WritablePolygon2D closedPolygon2D(final double[] x,
398396
final double[] y)
399397
{
400-
return GeomMasks.closedWritablePolygon2D(x, y);
398+
return GeomMasks.closedPolygon2D(x, y);
401399
}
402400

403401
/**
@@ -410,7 +408,7 @@ default WritablePolygon2D closedPolygon2D(final double[] x,
410408
default WritablePolygon2D openPolygon2D(
411409
final List<? extends RealLocalizable> vertices)
412410
{
413-
return GeomMasks.openWritablePolygon2D(vertices);
411+
return GeomMasks.openPolygon2D(vertices);
414412
}
415413

416414
/**
@@ -422,7 +420,7 @@ default WritablePolygon2D openPolygon2D(
422420
* @return a 2D polygon with the given vertices
423421
*/
424422
default WritablePolygon2D openPolygon2D(final double[] x, final double[] y) {
425-
return GeomMasks.openWritablePolygon2D(x, y);
423+
return GeomMasks.openPolygon2D(x, y);
426424
}
427425

428426
// ---- Polyline ----
@@ -438,7 +436,7 @@ default WritablePolygon2D openPolygon2D(final double[] x, final double[] y) {
438436
default WritablePolyline polyline(
439437
final List<? extends RealLocalizable> vertices)
440438
{
441-
return GeomMasks.writablePolyline(vertices);
439+
return GeomMasks.polyline(vertices);
442440
}
443441

444442
// ---- RealPointCollection ----
@@ -453,8 +451,7 @@ default WritablePolyline polyline(
453451
default <L extends RealLocalizable> WritableRealPointCollection<L>
454452
realPointCollection(final HashMap<TDoubleArrayList, L> points)
455453
{
456-
// TODO: Use GeomMasks once this is fixed
457-
return new DefaultWritableRealPointCollection<>(points);
454+
return GeomMasks.realPointCollection(points);
458455
}
459456

460457
/**
@@ -466,8 +463,7 @@ default WritablePolyline polyline(
466463
default <L extends RealLocalizable> WritableRealPointCollection<L>
467464
realPointCollection(final Collection<L> points)
468465
{
469-
return (WritableRealPointCollection<L>) GeomMasks
470-
.writableRealPointCollection(points);
466+
return GeomMasks.realPointCollection(points);
471467
}
472468

473469
/**
@@ -503,13 +499,11 @@ default WritablePolyline polyline(
503499
* @param points contains the locations of the points in the collection
504500
* @return a {@link WritableRealPointCollection} containing the given points
505501
*/
506-
@SuppressWarnings("unchecked")
507502
default <L extends RealLocalizable> WritableRealPointCollection<L>
508503
realPointSampleListRealPointCollection(
509504
final RealPointSampleList<L> points)
510505
{
511-
return (WritableRealPointCollection<L>) GeomMasks
512-
.realPointSampleListWritableRealPointCollection(points);
506+
return GeomMasks.realPointSampleListRealPointCollection(points);
513507
}
514508

515509
/**
@@ -522,7 +516,7 @@ default WritablePolyline polyline(
522516
realPointSampleListRealPointCollection(final Collection<L> points)
523517
{
524518
// TODO: Replace with GeoMasks when that's fixed
525-
return new RealPointSampleListWritableRealPointCollection<>(points);
519+
return GeomMasks.realPointSampleListRealPointCollection(points);
526520
}
527521

528522
// ---- Sphere ----
@@ -538,7 +532,7 @@ default WritablePolyline polyline(
538532
default WritableSphere closedSphere(final double[] center,
539533
final double radius)
540534
{
541-
return GeomMasks.closedWritableSphere(center, radius);
535+
return GeomMasks.closedSphere(center, radius);
542536
}
543537

544538
/**
@@ -552,7 +546,7 @@ default WritableSphere closedSphere(final double[] center,
552546
default WritableSphere openSphere(final double[] center,
553547
final double radius)
554548
{
555-
return GeomMasks.openWritableSphere(center, radius);
549+
return GeomMasks.openSphere(center, radius);
556550
}
557551

558552
// ---- SuperEllispoid ----
@@ -570,7 +564,7 @@ default WritableSphere openSphere(final double[] center,
570564
default WritableSuperEllipsoid closedSuperEllipsoid(final double[] center,
571565
final double[] semiAxisLengths, final double exponent)
572566
{
573-
return GeomMasks.closedWritableSuperEllipsoid(center, semiAxisLengths,
567+
return GeomMasks.closedSuperEllipsoid(center, semiAxisLengths,
574568
exponent);
575569
}
576570

@@ -587,7 +581,7 @@ default WritableSuperEllipsoid closedSuperEllipsoid(final double[] center,
587581
default WritableSuperEllipsoid openSuperEllipsoid(final double[] center,
588582
final double[] semiAxisLengths, final double exponent)
589583
{
590-
return GeomMasks.openWritableSuperEllipsoid(center, semiAxisLengths,
584+
return GeomMasks.openSuperEllipsoid(center, semiAxisLengths,
591585
exponent);
592586
}
593587
}

0 commit comments

Comments
 (0)