scenerygraphics / sciview

sciview is a tool for visualization and interaction with ND image and mesh data
BSD 2-Clause "Simplified" License
64 stars 17 forks source link

Exception when testing multiscale N5s #517

Closed kephale closed 1 month ago

kephale commented 1 year ago

I'm puttering around with multiscale N5s for the Open Organelle demo and got this exception. Looks like an overflow. @skalarproduktraum @moreApi might be interested.

java.lang.IllegalArgumentException: capacity < 0: (-2021733784 < 0)
    at java.base/java.nio.Buffer.createCapacityException(Buffer.java:256)
    at java.base/java.nio.Buffer.<init>(Buffer.java:220)
    at java.base/java.nio.ByteBuffer.<init>(ByteBuffer.java:281)
    at java.base/java.nio.ByteBuffer.<init>(ByteBuffer.java:289)
    at java.base/java.nio.MappedByteBuffer.<init>(MappedByteBuffer.java:90)
    at java.base/java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:114)
    at java.base/java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:317)
    at graphics.scenery.volumes.SceneryStackManager.uploadToTextureU8(SceneryStackManager.kt:263)
    at graphics.scenery.volumes.SceneryStackManager.upload(SceneryStackManager.kt:176)
    at graphics.scenery.volumes.VolumeManager.updateBlocks(VolumeManager.kt:489)
    at graphics.scenery.volumes.VolumeManager$createRenderable$1.preDraw(VolumeManager.kt:619)
    at graphics.scenery.backends.vulkan.VulkanRenderer$render$1.invokeSuspend(VulkanRenderer.kt:1603)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)
    at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
    at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
    at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
    at graphics.scenery.backends.vulkan.VulkanRenderer.render(VulkanRenderer.kt:1526)
    at graphics.scenery.SceneryBase.sceneryMain$suspendImpl(SceneryBase.kt:206)
    at graphics.scenery.SceneryBase$sceneryMain$1.invokeSuspend(SceneryBase.kt)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)
    at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
    at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
    at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
    at graphics.scenery.SceneryBase.main(SceneryBase.kt:485)
    at sc.iview.DefaultSciViewService.lambda$makeSciView$0(DefaultSciViewService.java:114)
    at org.scijava.thread.DefaultThreadService.lambda$wrap$1(DefaultThreadService.java:233)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
kephale commented 1 year ago

Branch here: https://github.com/scenerygraphics/sciview/tree/openorganelle-scenery-0.9.0 use https://github.com/scenerygraphics/sciview/blob/38fd97ce3a8b801b77c3e6bb80acf581d336a878/src/main/java/sc/iview/commands/demo/advanced/OpenOrganelleDemo.java for testing

kephale commented 1 year ago

Ok, it is going through the SimpleVolume path...

kephale commented 1 year ago

This is from the spimSources in the SourceAndConverters that are being created in the demo. [In the IntelliJ debugger]

Method threw 'java.lang.NegativeArraySizeException' exception. Cannot evaluate mpicbg.spim.data.sequence.DefaultVoxelDimensions.toString()
kephale commented 1 year ago

Aha https://github.com/bigdataviewer/bigvolumeviewer-core/blob/9f6a7d66dc4d92a7d9e011a680fdc5facd4706a0/src/main/java/bvv/core/blocks/TileAccess.java#L135 @tpietzsch I made it to here!

kephale commented 11 months ago

This might be closeable. I've tested multiscale N5s recently, and there are issues but https://github.com/scenerygraphics/sciview/issues/530 should guarantee that this issues is closed.

kephale commented 1 month ago

Anything from this should be addressed in https://github.com/scenerygraphics/sciview/pull/548