Skip to content

Proper way to make a volatile source for lazy loading and bdv display ? #8

@NicoKiaru

Description

@NicoKiaru

Hello,

Excited to see this project going forward! I've already played quite a bit with it and it's really nice.

I have a question because for a better integration of Warpy and ABBA into QuPath I need to use BigDataViewer (support of transformed images, BigWarp), and BDV works better with data implementing the Source interface. Together with VolatileSource, this brings async loading to BDV and it's really life-changing for responsiveness.

However, for VolatileSource to work, there's this line which is called:

https://github.com/bigdataviewer/bigdataviewer-core/blob/f5226a680e61fcbccc329b1e92bb7d75edb320b7/src/main/java/bdv/util/VolatileSource.java#L71

This wrapping requires that the RAI implements cell-based access:

https://github.com/bigdataviewer/bigdataviewer-core/blob/f5226a680e61fcbccc329b1e92bb7d75edb320b7/src/main/java/bdv/util/volatiles/VolatileViews.java#L118

So it's not an issue, you could say, because you're already providing a LazyCellImg, so that should work. Unfortunately, the Source interface requires a 3D RAI, which is an XYZ hyperslice for a certain c and t of the 5D LazyCellImg provided in this repo. And hyperslicing the LazyCellImg causes it to lose its cell-based structure (in the sense that WrapAsVolatile throws an IllegalArgumentException).

So I wonder if you have any idea how this could be fixed?

Sorry it's long; I hope it's clear. In brief, here's my ideal solution (and I don't know if it's doable):


Is it possible to add a method that creates a LazyCellImg, but for a specific c and t index, and thus return a LazyCell 3D image? Something like

public Img<T> createForLevelCT(int level, int c, int t)


This method needs to preserve the cell-based structure while providing the 3D RAI that BDV expects. Maybe that's not easily doable, I don't know, but I'd love to have your input on this. Also pinging @tpietzsch in case he has time to chime in!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions