imglib / imglib2-ij

Translation between ImgLib & ImageJ data structures (both 1.x and 2)
Other
4 stars 8 forks source link

multithreaded show methods #10

Closed hoerldavid closed 7 years ago

hoerldavid commented 7 years ago

In our BigStitcher and corresponding newer versions of SPIM_Registration, @StephanPreibisch and I create large virtual RAIs, that we wish to display as plain-old ImagePluss. Since the virtual fusion of every plane can be quite computationally intensive, doing it multi-threaded provides a great speed improvement (and a more responsive user experience).

To achieve this, we wrote MultithreadedIterableIntervalProjector2D, a multi-threaded version of IterableIntervalProjector2D. We overload the constructors of ImageJVirtualStack and subclasses to take an additional ExecutorService. This may be null, in which case the "old" IterableIntervalProjector2D is used. The old constructors default to single-threaded behaviour. The same goes for the RAI -> ImagePlus methods in ImageJFunctions: we provide versions that take an ExecutorService and use it to perform multi-threaded plane filling. The old signatures provide unchanged, single-threaded beahviour.