Open tischi opened 4 years ago
I've done something very similar here:
I think there could be many reasons for the slow behaviour:
The second point can be easily improved : just do something like a parallelstream on indices The first point can also be improved. But making it automatic is a bit annoying (compare the voxel size of the source with the one asked by the user).
If you look on my link, that's what I've done.
Regarding the third point, it's maybe the most relevant. Maybe you can split your image by block and fill the array in parallel. Personnally I used https://github.com/BIOP/bigdataviewer_scijava/blob/6f4ad5af3325e2e2de217d3ec4f421bffd8c1f17/src/main/java/ch/epfl/biop/bdv/scijava/export/BDVSlicesToImgPlus.java#L197
But I think it's not parallel. (Bdv is retrieving the data in parallel) And is sometimes terribly slow.
you take the full resolution source (may be there are mipmaps)
Veeeery good point! I could have bet I find the most appropriate resolution already, but apparently I use the highest. Very dumb. I think that will help a lot!
@NicoKiaru Do you have code to programmatically generate a source with more then 1 level? I would need this for testing. I know things like below but they only create one level:
final RandomAccessibleIntervalSource< ? > source = new RandomAccessibleIntervalSource( rai, Util.getTypeFromInterval( rai ), "image" );
Thanks! In fact this was the first thing I looked at, but frankly I had trouble understanding it enough to make it it work for me, in terms of:
CompositeImage
such that people can still play around this the LUTs
This is very slow! Any ideas why? The idea is to have an option in Bdv to capture the current view at a arbitrary resolution. It works, but super slow.