ome / omero-figure

An OMERO.web app for creating Figures from images in OMERO
http://figure.openmicroscopy.org
GNU Affero General Public License v3.0
15 stars 30 forks source link

min max range issue #159

Closed dwaithe closed 7 years ago

dwaithe commented 8 years ago

Hi,

I am working with some of my users whom are using Figure. We are importing '.dv' files into figure and then doing maximum projection. We have found that by adjusting the min/max brightness settings in the OMERO.web client these settings are imported to Figure. This is good as it means we can have the same range in each image when we import each to Figure. We have found that by shift-clicking all the images within Figure, we can globally tune the min/max settings, but we have noticed a bug. When we move the max bar, the range we set in OMERO.web is lost and it defaults to the max image intensity level. This results in a loss of synchronisation between the grouped images and chaotic min/max control if the images have different max levels. We can work around this by just controlling all brightness settings in OMERO.web and then importing, but it is partly the power of OMERO.web to do this within this software package. Can you advise about this and potentially fix the issue. It would be best if in Figure it did not default to the max intensity of the image but retained the preset imported from OMERO.web.

Best, Dominic

will-moore commented 8 years ago

Hi Dominic, I'm not quite sure I understand your request. If you select several images in OMERO.figure, then adjust the min/max setting for a channel then all the selected images will have the same min/max setting for that channel. This is the same as many other attributes, E.g. Z-index, zoom etc. The slider handles start at the average min/max for all selected images. What is the behaviour that you would like to see? Do you simply want the min value of selected images to be unchanged if the max value is adjusted? (and vice-versa: max value unchanged if min value is adjusted)? Or are you looking for increment buttons like in the T-index, where you can increment the T-index of all images by 1, without making them all the same T-index?

dwaithe commented 8 years ago

Hi Dominic, I'm not quite sure I understand your request. If you select several images in OMERO.figure, then adjust the min/max setting for a channel then all the selected images will have the same min/max setting for that channel.

What you state above is what we want, but what we have noticed is that if you move the slider around, as you optimise, the max possible value for the slider changes, based on the calculated max of the image not the user-defined value it inherited from OMERO web (e.g. 4085). This is a bit annoying. Previously I have seen a complete loss of synchronisation also...but as I return to it now, I cannot repeat that error.

Therefore I think it would be better for us if the max limit of the slider is stuck as the original, if user-defined and inherited from OMERO web. Sorry I haven't been able to reproduce the main bug which is a loss of synchronisation between the sliders.

will-moore commented 8 years ago

The max possible value for the channel slider is never "user-defined". It is defined as the max intensity of any pixel in the image OR the current max setting of the slider, whichever is the largest. In OMERO.figure, when you select multiple images, the position of the max slider handle is an AVERAGE of all the selected images, but the max of the range is the MAX of all the selected images.

Maybe a specific example will help. If you go to http://figure.openmicroscopy.org/demo/#file/1 and select the 2 images in the Merged column at the top, 1 at a time, you'll see that the Red (3rd) channel has a max range of 5892 for the top image and 10656 for the bottom image. If you set the slider for both images to the max value (one image at a time) and then select both images, you'll see that you can still slide it further to the right...

screen shot 2016-08-09 at 11 57 19

Now, if you slide the handle to the max again, both images will get a max value of 10656. Now select just the first image. The max of the range is 10656 (because this is the current value) but the max pixel intensity is 5892. So, when you reduce the value with the slider, the max value of the range is also reduced each time, until you get back down below 5892. This is probably the "loss of synchronisation" you're talking about? (We actually have the same behaviour in the web client if you type in a large value into the input box.)

If so, then the question is how to fix it? Since the right panel is effectively re-rendered on each change, we don't have a nice way of saving the current max value of the slider. We just have to recalculate it each time. Let me know if I'm describing the issue correctly and if you have any ideas on how to fix?

dwaithe commented 8 years ago

Hi Will,

You have found the problem I referred to. I think it is more apparent if you have a high degree of variation in your images, which can happen if there is a bright artefact or something, but you certainly understand the issue. Obviously, in bioimaging publications it is important to have the same min/max settings so depending on your images there could be a bit of a tricky situation if it is at all ambiguous.

When I have said user-defined, I mean when the image inherits the value the user inputs as the maximum in OMERO.web. For example in OMERO.web I can type in 4095 when the max pixel value is say 2000. When you import this image into OMERO.figure it still says 4095 but as soon as you move the slider handle, it moves down to the image max. To fix the issue you could maybe introduce a static 'slider maximum' which you type in and a checkbox which activates or deactivates it. This would also allow users to make dimmer a channel which can be useful sometimes. Just a suggestion.

will-moore commented 8 years ago

I think it would be too confusing for the user to see and edit both a value for the slider position AND a value for the max range of the slider. Storing a static 'slider maximum' is therefore tricky because you need a way to reduce it if it gets too high (E.g. you set the max slider position to 4095). It's a tricky problem of "cache invalidation".

We are already planning to add the same functionality that webclient has: being able to type a value in to set the slider position. This would allow you to set it outside the range of the slider and has already been requested https://trello.com/c/AozomHkL/125-sliders-allow-typing-in-values. However, that doesn't get around the issue that both webclient and figure have of dynamically updating the slider when you reduce the max slider position.

I know that this "loss of synchronisation" can be a little confusing (and would love to know the ideal solution), but it doesn't affect the actual min/max settings which are critical for image publications.

Allowing users to type in the slider values would allow you to make the channel dimmer without adding more controls to the UI. Do you think that this would address some of your concerns?

dwaithe commented 8 years ago

Yes, it would. Thanks for going through this with me. Best, Dominic

will-moore commented 7 years ago

NB: Figure 3.0.0 is now out, and you can enter values for channel slider min/max settings. https://www.youtube.com/watch?v=XF-ADVS7RNk