bigdataviewer / bigdataviewer-playground

BSD 2-Clause "Simplified" License
19 stars 5 forks source link

Adapting to bigdataviewer-core 10.4.1 #257

Closed NicoKiaru closed 2 years ago

NicoKiaru commented 2 years ago

(see branch bdv-0.4.1 of this repo: https://github.com/bigdataviewer/bigdataviewer-playground/tree/bdv-0.4.1)

ping @tischi @tpietzsch

Issue 1 - new methods in BdvHandle

getAppearanceManager and getKeymapManager not overriden in bdv.util.ViewerPanelHandle

bdv\util\ViewerPanelHandle.java:53:8
java: bdv.util.ViewerPanelHandle is not abstract and does not override abstract method getAppearanceManager() in bdv.util.BdvHandle

Why bdv-playground need this ?

The ViewerPanelHandle is necessary to treat bigdataviewer windows of BigWarp by @bogovicj as any other BdvHandle, which is what Bdv-Playground uses internally.

Issue 2 - Change in AccumulateProjectorARGB creation

Some constructors have changed and also inner classes are private...

sc\fiji\bdvpg\bdv\projector\DefaultAccumulatorFactory.java:54:20
java: constructor AccumulateProjectorARGB in class bdv.viewer.render.AccumulateProjectorARGB cannot be applied to given types;
  required: no arguments
  found: java.util.List<bdv.viewer.render.VolatileProjector>,java.util.List<capture#1 of ? extends net.imglib2.RandomAccessible<? extends net.imglib2.type.numeric.ARGBType>>,net.imglib2.RandomAccessibleInterval<net.imglib2.type.numeric.ARGBType>,int,java.util.concurrent.ExecutorService
  reason: actual and formal argument lists differ in length

Why bdv-playgroun need this ?

Because we are playing with transparency, and layers, thus have custom projectors. Making them compatible with bdv-core 10.4.1 may be a bit of work, and the core of the transparency handling is in a different repo.

NicoKiaru commented 2 years ago

Associated repositories:

Extra question : is bigvolumeviewer updated for bdv-core 10.4.1 ?

tpietzsch commented 2 years ago

Issue 2 - Change in AccumulateProjectorARGB creation

If I understand correctly, you need DefaultAccumulatorFactory, because you want to have it serializable, and the AccumulateProjectorARGB.factory is an anonymous class. I made a branch playground in bigdataviewer-core where this is no longer an anonymous class, so you should be able to just use (and serialize) it without making your own. I did that here https://github.com/bigdataviewer/bigdataviewer-playground/commit/f7f3f6b17ac09bb1af2c9ca59ae12e48a0e6b6a8 but didn't test it.

tpietzsch commented 2 years ago

Issue 1 - new methods in BdvHandle

To explain the rationale behind that: KeymapManager and AppearanceManager allow multiple BDV windows to share settings for keybindings and/or appearance (overlays, etc). I didn't want to make this global, because there might be legitimate reasons for different windows to have different overlay configurations etc.

The way to share the KeymapManager and AppearanceManager is through ViewerOptions (bdv-core) respectively BdvOptions (vistools). See this example The new BdvHandle methods exist, so that you can get the mangers from existing windows (in order to share them).

In https://github.com/bigdataviewer/bigdataviewer-core/commit/e29a9253ce0de30d9bcb76d6a623c0f8d5265a45 I added methods to get them from ViewerFrame. Eventually BigWarp should add corresponding methods to its BigWarpViewerFrame (@bogovicj), then you can just pass them on in your ViewerPanelHandle.

For the time being, you can also just implement the new BdvHandle methods to return null or throw an exception, because these methods are only relevant to be called by the user for manager sharing. They are not used internally.

tpietzsch commented 2 years ago

Extra question : is bigvolumeviewer updated for bdv-core 10.4.1 ?

not yet, but I'll do it soon.

NicoKiaru commented 2 years ago

Thanks a lot @tpietzsch , I'll test these modifications, it doesn't look too complicated!

NicoKiaru commented 2 years ago

It all looks good for this repo! I removed the deprecated API without any issue.

NicoKiaru commented 2 years ago

Adaptation mostly done, I just need a new BigWarp release to update the pom. @bogovicj, when do you plan to make it ? Thanks!

bogovicj commented 2 years ago

@NicoKiaru - pretty soon (hopefully next week?) There are just some last fixes / features that I would like to get in this version :)

NicoKiaru commented 2 years ago

BigWarp release is done. So everything looks good on the bigdataviewer-playground side