52
52
import net .imglib2 .roi .RealMask ;
53
53
import net .imglib2 .roi .RealMaskRealInterval ;
54
54
import net .imglib2 .roi .geom .GeomMasks ;
55
- import net .imglib2 .roi .geom .real .DefaultWritableRealPointCollection ;
56
55
import net .imglib2 .roi .geom .real .RealPointCollection ;
57
- import net .imglib2 .roi .geom .real .RealPointSampleListWritableRealPointCollection ;
58
56
import net .imglib2 .roi .geom .real .WritableBox ;
59
57
import net .imglib2 .roi .geom .real .WritableEllipsoid ;
60
58
import net .imglib2 .roi .geom .real .WritableLine ;
@@ -247,7 +245,7 @@ RealRandomAccessibleRealInterval<BoolType> toRealRandomAccessibleRealInterval(
247
245
* @return a {@link WritableBox} with the given min/max
248
246
*/
249
247
default WritableBox closedBox (final double [] min , final double [] max ) {
250
- return GeomMasks .closedWritableBox (min , max );
248
+ return GeomMasks .closedBox (min , max );
251
249
}
252
250
253
251
/**
@@ -259,7 +257,7 @@ default WritableBox closedBox(final double[] min, final double[] max) {
259
257
* @return a {@link WritableBox} with the given min/max
260
258
*/
261
259
default WritableBox openBox (final double [] min , final double [] max ) {
262
- return GeomMasks .openWritableBox (min , max );
260
+ return GeomMasks .openBox (min , max );
263
261
}
264
262
265
263
// ---- Ellipsoid ----
@@ -276,7 +274,7 @@ default WritableBox openBox(final double[] min, final double[] max) {
276
274
default WritableEllipsoid closedEllipsoid (final double [] center ,
277
275
final double [] semiAxisLengths )
278
276
{
279
- return GeomMasks .closedWritableEllipsoid (center , semiAxisLengths );
277
+ return GeomMasks .closedEllipsoid (center , semiAxisLengths );
280
278
}
281
279
282
280
/**
@@ -291,7 +289,7 @@ default WritableEllipsoid closedEllipsoid(final double[] center,
291
289
default WritableEllipsoid openEllipsoid (final double [] center ,
292
290
final double [] semiAxisLengths )
293
291
{
294
- return GeomMasks .openWritableEllipsoid (center , semiAxisLengths );
292
+ return GeomMasks .openEllipsoid (center , semiAxisLengths );
295
293
}
296
294
297
295
// ---- Line ----
@@ -306,7 +304,7 @@ default WritableEllipsoid openEllipsoid(final double[] center,
306
304
default WritableLine line (final RealLocalizable pointOne ,
307
305
final RealLocalizable pointTwo )
308
306
{
309
- return GeomMasks .writableLine (pointOne , pointTwo );
307
+ return GeomMasks .line (pointOne , pointTwo );
310
308
}
311
309
312
310
/**
@@ -321,7 +319,7 @@ default WritableLine line(final RealLocalizable pointOne,
321
319
default WritableLine line (final double [] pointOne , final double [] pointTwo ,
322
320
final boolean copy )
323
321
{
324
- return GeomMasks .writableLine (pointOne , pointTwo , copy );
322
+ return GeomMasks .line (pointOne , pointTwo , copy );
325
323
}
326
324
327
325
// ---- Point ----
@@ -333,7 +331,7 @@ default WritableLine line(final double[] pointOne, final double[] pointTwo,
333
331
* @return a point at the given location
334
332
*/
335
333
default WritablePointMask pointMask (final double [] point ) {
336
- return ( WritablePointMask ) GeomMasks .writablePointMask (point );
334
+ return GeomMasks .pointMask (point );
337
335
}
338
336
339
337
/**
@@ -343,7 +341,7 @@ default WritablePointMask pointMask(final double[] point) {
343
341
* @return a point at the given location
344
342
*/
345
343
default WritablePointMask pointMask (final RealLocalizable point ) {
346
- return ( WritablePointMask ) GeomMasks .writablePointMask (point );
344
+ return GeomMasks .pointMask (point );
347
345
}
348
346
349
347
// ---- Polygon2D ----
@@ -358,7 +356,7 @@ default WritablePointMask pointMask(final RealLocalizable point) {
358
356
default WritablePolygon2D polygon2D (
359
357
final List <? extends RealLocalizable > vertices )
360
358
{
361
- return GeomMasks .writablePolygon2D (vertices );
359
+ return GeomMasks .polygon2D (vertices );
362
360
}
363
361
364
362
/**
@@ -370,7 +368,7 @@ default WritablePolygon2D polygon2D(
370
368
* @return a 2D polygon with the given vertices
371
369
*/
372
370
default WritablePolygon2D polygon2D (final double [] x , final double [] y ) {
373
- return GeomMasks .writablePolygon2D (x , y );
371
+ return GeomMasks .polygon2D (x , y );
374
372
}
375
373
376
374
/**
@@ -383,7 +381,7 @@ default WritablePolygon2D polygon2D(final double[] x, final double[] y) {
383
381
default WritablePolygon2D closedPolygon2D (
384
382
final List <? extends RealLocalizable > vertices )
385
383
{
386
- return GeomMasks .closedWritablePolygon2D (vertices );
384
+ return GeomMasks .closedPolygon2D (vertices );
387
385
}
388
386
389
387
/**
@@ -397,7 +395,7 @@ default WritablePolygon2D closedPolygon2D(
397
395
default WritablePolygon2D closedPolygon2D (final double [] x ,
398
396
final double [] y )
399
397
{
400
- return GeomMasks .closedWritablePolygon2D (x , y );
398
+ return GeomMasks .closedPolygon2D (x , y );
401
399
}
402
400
403
401
/**
@@ -410,7 +408,7 @@ default WritablePolygon2D closedPolygon2D(final double[] x,
410
408
default WritablePolygon2D openPolygon2D (
411
409
final List <? extends RealLocalizable > vertices )
412
410
{
413
- return GeomMasks .openWritablePolygon2D (vertices );
411
+ return GeomMasks .openPolygon2D (vertices );
414
412
}
415
413
416
414
/**
@@ -422,7 +420,7 @@ default WritablePolygon2D openPolygon2D(
422
420
* @return a 2D polygon with the given vertices
423
421
*/
424
422
default WritablePolygon2D openPolygon2D (final double [] x , final double [] y ) {
425
- return GeomMasks .openWritablePolygon2D (x , y );
423
+ return GeomMasks .openPolygon2D (x , y );
426
424
}
427
425
428
426
// ---- Polyline ----
@@ -438,7 +436,7 @@ default WritablePolygon2D openPolygon2D(final double[] x, final double[] y) {
438
436
default WritablePolyline polyline (
439
437
final List <? extends RealLocalizable > vertices )
440
438
{
441
- return GeomMasks .writablePolyline (vertices );
439
+ return GeomMasks .polyline (vertices );
442
440
}
443
441
444
442
// ---- RealPointCollection ----
@@ -453,8 +451,7 @@ default WritablePolyline polyline(
453
451
default <L extends RealLocalizable > WritableRealPointCollection <L >
454
452
realPointCollection (final HashMap <TDoubleArrayList , L > points )
455
453
{
456
- // TODO: Use GeomMasks once this is fixed
457
- return new DefaultWritableRealPointCollection <>(points );
454
+ return GeomMasks .realPointCollection (points );
458
455
}
459
456
460
457
/**
@@ -466,8 +463,7 @@ default WritablePolyline polyline(
466
463
default <L extends RealLocalizable > WritableRealPointCollection <L >
467
464
realPointCollection (final Collection <L > points )
468
465
{
469
- return (WritableRealPointCollection <L >) GeomMasks
470
- .writableRealPointCollection (points );
466
+ return GeomMasks .realPointCollection (points );
471
467
}
472
468
473
469
/**
@@ -503,13 +499,11 @@ default WritablePolyline polyline(
503
499
* @param points contains the locations of the points in the collection
504
500
* @return a {@link WritableRealPointCollection} containing the given points
505
501
*/
506
- @ SuppressWarnings ("unchecked" )
507
502
default <L extends RealLocalizable > WritableRealPointCollection <L >
508
503
realPointSampleListRealPointCollection (
509
504
final RealPointSampleList <L > points )
510
505
{
511
- return (WritableRealPointCollection <L >) GeomMasks
512
- .realPointSampleListWritableRealPointCollection (points );
506
+ return GeomMasks .realPointSampleListRealPointCollection (points );
513
507
}
514
508
515
509
/**
@@ -522,7 +516,7 @@ default WritablePolyline polyline(
522
516
realPointSampleListRealPointCollection (final Collection <L > points )
523
517
{
524
518
// TODO: Replace with GeoMasks when that's fixed
525
- return new RealPointSampleListWritableRealPointCollection <> (points );
519
+ return GeomMasks . realPointSampleListRealPointCollection (points );
526
520
}
527
521
528
522
// ---- Sphere ----
@@ -538,7 +532,7 @@ default WritablePolyline polyline(
538
532
default WritableSphere closedSphere (final double [] center ,
539
533
final double radius )
540
534
{
541
- return GeomMasks .closedWritableSphere (center , radius );
535
+ return GeomMasks .closedSphere (center , radius );
542
536
}
543
537
544
538
/**
@@ -552,7 +546,7 @@ default WritableSphere closedSphere(final double[] center,
552
546
default WritableSphere openSphere (final double [] center ,
553
547
final double radius )
554
548
{
555
- return GeomMasks .openWritableSphere (center , radius );
549
+ return GeomMasks .openSphere (center , radius );
556
550
}
557
551
558
552
// ---- SuperEllispoid ----
@@ -570,7 +564,7 @@ default WritableSphere openSphere(final double[] center,
570
564
default WritableSuperEllipsoid closedSuperEllipsoid (final double [] center ,
571
565
final double [] semiAxisLengths , final double exponent )
572
566
{
573
- return GeomMasks .closedWritableSuperEllipsoid (center , semiAxisLengths ,
567
+ return GeomMasks .closedSuperEllipsoid (center , semiAxisLengths ,
574
568
exponent );
575
569
}
576
570
@@ -587,7 +581,7 @@ default WritableSuperEllipsoid closedSuperEllipsoid(final double[] center,
587
581
default WritableSuperEllipsoid openSuperEllipsoid (final double [] center ,
588
582
final double [] semiAxisLengths , final double exponent )
589
583
{
590
- return GeomMasks .openWritableSuperEllipsoid (center , semiAxisLengths ,
584
+ return GeomMasks .openSuperEllipsoid (center , semiAxisLengths ,
591
585
exponent );
592
586
}
593
587
}
0 commit comments