bigdataviewer/bigdataviewer-playground

What to do with zero value?

Closed this issue · 6 comments

Hi,

BDV treats data[..]=0 as "Zero-Value" and substitutes it with the background (black), no matter what contrast limits or LUT is chosen for that source. This is perfectly fine if 0 is the lowest possible value of data (as for an unsigned type). However, when dealing with data that contains negative values (signed float or int data types), this leads to a range of black "holes" in the data (where the data value is 0).

I could think of these approaches to overcome that issue but have no idea which could be a feasible strategy given how BDV works under the hood.

  • Change the mapping of data values to viewer pixels such that data 0 is mapped just as any other data value (contrast limits, gamma-mapping etc...). This would shift the decision on what is to be considered "Zero-Value" to the minimum value in the chosen LUT.
  • change the data value that is treated as "Zero-Value" to the lower contrast limit instead of data 0 during mapping and then apply the LUT accordingly.
  • check for data 0 values when mapping and on-the fly change them to random +/- 1 to avoid displaying holes

Changing the BDV background to the mapped hypothetical value of data 0 which can be done as a workaround obviously only works for displaying a single source. Therefore, the modified mapping needs to happen for each source individually.

I've played quite a lot with so-called 'alpha source' which is basically a mask applied over any source. This can probably be an option to overcome this. Do you have a simple reproducible way to show the issue ? I can try that approach

I just realized that when changing the contrast minimum to negative, BDV's background indeed adjusts from black to grey. This only worked with one single source though...
Here's a data source:
https://oc.embl.de/index.php/s/Bw2N7Osk7uUvMzs

I just realized that when changing the contrast minimum to negative, BDV's background indeed adjusts from black to grey.

Using the BDV brightness adjustments or the ones in MoBIE?

Using the BDV brightness adjustments or the ones in MoBIE?

I managed to get that in BDV only. But in a Fiji that has MoBIE installed.

But in a Fiji that has MoBIE installed.

That shouldn't make a difference.

I'm closing the issue, please reopen if you think something should be done in this repo.