imglib / imglib2-roi

Regions of interest (ROIs) and labelings for ImgLib2
Other
8 stars 8 forks source link

Improve WritablePolygon2D and WritablePolyline #35

Closed ctrueden closed 5 years ago

ctrueden commented 6 years ago

This branch makes the following improvements:

Note that WritableRealPointCollection still does not have addPoints or removePoints methods; I considered doing them as part of this PR, but I have no immediate use case, so I've held off for now.

With these changes, it will be more feasible to pass WritablePolyshape objects as outputs into which calculated points can be injected. In particular, it will become feasible to recast ImageJ Ops's geometry operations such as geom.convexHull(Polygon2D) as computer ops rather than function ops.

awalter17 commented 6 years ago

@ctrueden Thank you for your work on this (and cleaning up some of my tests)!

Add methods to GeomMaths to compare Localizable and RealLocalizable positions. (Maybe these should go into net.imglib2.util.Util? What do others think?)

I think these methods should go in net.imglib2.util.Util, because they seem more general than GeomMaths.

Aside from that though, I think these changes are wonderful and (pending a decision on the above) are good to merge. Thoughts @tpietzsch?

ctrueden commented 6 years ago

Thanks for reviewing, @awalter17. I filed imglib/imglib2#211 to add the locationsEqual methods to Util in ImgLib2 core. @tpietzsch If you like it, we can leave this PR here until it is merged and released and then update the PR accordingly. Or if not, close it and I'll put those methods wherever you deem best.

ctrueden commented 6 years ago

Rebased over the latest master. I also added a commit cleaning up the GeomMasks javadoc. And I removed the GeomMaths.locationsEqual methods in favor of Util.locationsEqual from imglib/imglib2#211. This PR depends on imglib/imglib2#211 being merged and released first.

imagejan commented 5 years ago

The build on master failed because of a typo in the javadoc here: @Link -> @link

ctrueden commented 5 years ago

Fixed with 07f5716162c1c95f81389a9d8df9819d17f227d7