Closed bogovicj closed 3 years ago
See https://github.com/bigdataviewer/bigdataviewer-vistools/pull/47 for an example
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:
Source
s should have an immutable flag set in the constructor?Source
s (if any) need a set method for this flag?Which Source
s are in question?
AbstractSpimSource
default trueRealRandomAccessibleSource
final flag, default falseTransformedBoxPlaceHolderSource
default trueTransformedSource
defined by sourceIn vistools, generally:
Interval
sources default true
non-Interval
sources final flag, default false
Ready to go. Most sources default to true
- i.e. do the bounding box check. The exceptions are:
RealRandomAccessibleSource
RealRandomIntervalAccessibleSource
(vistools)RandomAccessibleSource
(vistools)RandomAccessibleSource4D
(vistools)TransformedSource
behavior is defined by the source it wrapsThe default behavior for these exceptions is to skip the bounding box check, but new constructors enable the programmer to set the flag manually.
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 ?
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.
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.
a default implementation preserves the current behavior