I’m playing with ImgLib2 ‘lazy’ processing. What I would like to have is a way to display the borders of a 3D label image which is:
- lazy, meaning it’s only computed where I’m looking at,
- and fast
The ‘fast’ part is my problem now.
To show the issue, I’ve made a self-contained groovy script which:
- creates a model label Image and displays it in BigDataViewer
- calls a fonction
getBorderLabelImage(RandomAccessibleInterval<T> lblImg), which returns the border image, that’s the function which needs to be changed/optimized
- displays the border image on BigDataViewer
If you execute this groovy script, you’ll see it in action:
Now the problem is that it takes about 50 seconds to compute and display this border image.
For a correct interactivity, I’d like to shrink this value to about 0.1s.
I’ll try some things, but I’m happy to hear about your insights and the performance you can reach ;-).
So far I didn’t find a way to compute the time it takes to finish the lazy processing. Is there a way to measure it ?
Thanks for reading this long message!
PS : A solution with ‘Converters’ could work, as @Christian_Tischer explained me. I’m interested in knowing this option, but I’m also interested in retrieving a part of the whole 3D image when it’s computed, that’s why the cached image is my preferred one for the moment.