imglib / imglib2-roi

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

Improve the Regions class #50

Closed ctrueden closed 4 years ago

ctrueden commented 5 years ago

In particular, add three new Regions.sample signatures.

Previously, there was no one-liner for binding a RealMask to a RandomAccessibleInterval. We covered it in the Learnathon's imagej-roi-course, but it was not intuitive. I would not expect new users of ImgLib2 to ever be able to figure out how to combine these utility functions, or even necessarily know about them, since they are spread across Views, Masks and Regions. Even knowing these methods are there in the back of my mind, I still forget exactly what needs to be converted to what in order to bind stuff together. So I'm in favor of introducing more convenience functions, to ease the pain.

There are no tests, because Regions didn't have tests before. 😞 @tpietzsch @awalter17 If you like this change, but are too uncomfortable with the lack of tests, I'll add some; let me know.