Examples of usage of imglib2-roi



Thanks very much! Looking forward to it. So far, I am glad that I was nonetheless capable to waddle through the code and get good usage out of it.


A quick test would tell us this: nope, it seems that I need a new Regions.iterable over the Views.raster, etc. for each location.


In the work I mentioned above, I’m almost done with cleaning up Regions.positionable(), which would let you take the result of Views.raster, and make it into a PositionableIterableRegion which can be moved around. If this would be helpful, I can bump the priority of that and get it done this week for sure.
However, this is moving the rasterized sphere on the integer grid. Not sure if that is enough.

It would be of course nice to be able to not bake in anything in the Regions.iterable() (optionally, for efficiency reasons…), and be able to re-position the sphere and have the rasterization adapt. I need to think more about that.


Hi @tpietzsch,
thanks very much for your work and for letting me know about what you have in store for imgli2-roi.
At the moment, I was able to measure ~250,000 spheres (597 at each of 400 time points) in less than 5 minutes with a 7-year-old computer (including lots of I/O time, which likely dominates) over a ~100 GB 4D volume stored as GZIP in N5. This was done with 597 distinct sphere instances, each independently rasterized and wrapped. So the performance is not bad, but of course I don’t know how much better it could be.

In the near future we are going to be doing hundreds of these measurements, so indeed an efficient imglib2-roi would be a boon to us, but like I said, what exists now is already good enough (for each data set, computation time is dominated by I/O and image registration across time).

Would be very happy though to test out Regions.positionable().


split this topic #25

6 posts were split to a new topic: Contains interface of imglib2-roi is gone


Following the conversation, @awalter17 @tpietzsch, here is a PR https://github.com/imglib/imglib2-roi/pull/48 with two methods that simplify lots the usage of ROIs in imglib2-roi:

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.