bigdataviewer / bigdataviewer-core

ImgLib2-based viewer for registered SPIM stacks and more
BSD 2-Clause "Simplified" License
33 stars 35 forks source link

add flag to skip renderer's bounding box intersection #110

Closed bogovicj closed 3 years ago

bogovicj commented 3 years ago

a default implementation preserves the current behavior

bogovicj commented 3 years ago

See https://github.com/bigdataviewer/bigdataviewer-vistools/pull/47 for an example

bogovicj commented 3 years ago

Other, specialized implementations can override the method I added as appropriate (i.e. WarpedSource) but for Source implementations in bdv-core and bdv-vistools it's less clear to me:

axtimwalde commented 3 years ago

Which Sources are in question?

axtimwalde commented 3 years ago

In vistools, generally: Interval sources default true non-Interval sources final flag, default false

bogovicj commented 3 years ago

Ready to go. Most sources default to true - i.e. do the bounding box check. The exceptions are:

The default behavior for these exceptions is to skip the bounding box check, but new constructors enable the programmer to set the flag manually.

NicoKiaru commented 3 years ago

What do you think of adding getters / setters if we want to modify the behaviour after the Source is created ? Also just curiosity : will it behave the same way between Volatile and non-Volatile sources ?

axtimwalde commented 3 years ago

This can be done at a later time because it is not in the way of the current behavior. This PR fixes false behavior, namely not rendering infinite sources or sources for which bounding box calculation is costly and therefore not accurate.

axtimwalde commented 3 years ago

will it behave the same way between Volatile and non-Volatile sources ?

Yes. This flag is tested by code in an external class VisibilityUtils that checks if the bounding boxes of the transformed source and the screen intersect, i.e. independent of the kind of source. I find it important to understand that this check is also an approximation but it has only false positives if the bounding box of the source is correct. The case that the source has infinite support (e.g. functions such as this https://github.com/saalfeldlab/imglib2-sandbox/blob/master/src/main/java/net/imglib2/sandbox/JuliaSet.java) was not covered.