bigdataviewer / bigdataviewer-playground

BSD 2-Clause "Simplified" License
19 stars 5 forks source link

What to do with zero value? #250

Closed martinschorb closed 2 years ago

martinschorb commented 2 years ago

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.

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.

NicoKiaru commented 2 years ago

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

martinschorb commented 2 years ago

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

tischi commented 2 years ago

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?

martinschorb commented 2 years ago

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.

tischi commented 2 years ago

But in a Fiji that has MoBIE installed.

That shouldn't make a difference.

NicoKiaru commented 2 years ago

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