imglib / imglib2-roi

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

Simplify mask usage #48

Closed acardona closed 5 years ago

acardona commented 5 years ago

Following the conversation at https://forum.image.sc/t/examples-of-usage-of-imglib2-roi/22855/19?u=albertcardona , here there are two methods:

Masks.toIterableInterval( RealMaskRealInterval ) returning an IterableRegion.

Regions.sample( RealMaskRealInterval, RandomAccessible ) returning an IterableInterval over the samples of the RandomAccessible that fall within the true parts of the mask.

acardona commented 5 years ago

Thanks @imagejan, which there was a button to simply accept the comments as a diff.

acardona commented 5 years ago

Travis complains about javadoc issues that I fixed above. I don't understand what's going on.

(In addition to a large amount of preexisting errors in javadoc outside of the scope of this PR.)

imagejan commented 5 years ago

They're in fact all warnings (the [ERROR] is misleading, what matters is the warning further down the line), except these two, which I apparently missed in my first read:

[ERROR] /home/travis/build/imglib/imglib2-roi/src/main/java/net/imglib2/roi/Masks.java:258: error: malformed HTML
[ERROR]      * @return IterableRegion< BoolType > 
[ERROR]                              ^
[ERROR] /home/travis/build/imglib/imglib2-roi/src/main/java/net/imglib2/roi/Masks.java:258: error: bad use of '>'
[ERROR]      * @return IterableRegion< BoolType > 
[ERROR]                                         ^
acardona commented 5 years ago

Thanks, fixed that one.

ctrueden commented 5 years ago

which there was a button to simply accept the comments as a diff.

GitHub has a new feature like that! https://github.blog/2018-11-01-suggested-changes-update/

acardona commented 5 years ago

Ready to merge?

tpietzsch commented 5 years ago

👍

tpietzsch commented 5 years ago

@acardona I just noticed that the method should be named toIterableRegion instead of toIterableInterval. I just changed it on master.

acardona commented 5 years ago

Hi @tpietzsch, thanks, but you didn't edit the example code in the javadoc, which still reads toIterableInterval.

tpietzsch commented 5 years ago

Thanks @acardona! I fixed it