bigdataviewer / bigdataviewer-core

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

Source Info Tool Bar and Location Card #167

Open trautmane opened 11 months ago

trautmane commented 11 months ago

Hi @tpietzsch and @axtimwalde ,

This is the current draft of the Source Info Tool Bar and Location Card UI additions I started working on in Brno. There is more to be done but I wanted to get feedback from you before I continued development.

Screenshot 2023-10-26 at 12 00 48 PM

Some key design questions I have are:

  1. Should I try to add some type of "smart-formatting" logic that considers the window size and the visible global coordinate range to determine what precision to display (e.g. the %n.mf format strings) in the toolbar and/or the editable location text fields? If so, what do you recommend?
  2. Does this division/combination of read-only toolbar with editable location card make sense? Anything else you'd like to see formatted/arranged differently?
  3. Is it possible to have a mix of 3D and 2D sources? If so, I need to address that. The "global" ViewerOptions.is2D implies to me you only do 2D or 3D for all sources.

Of course, I'm also happy to address any code suggestions you might have. My hope is to iterate and improve things on this branch based upon your feedback.

Thanks!

In case it helps, I've been using this test case to review the UI changes.

tpietzsch commented 10 months ago

Thanks a lot @trautmane, this looks great already!

Some key design questions I have are:

  1. Should I try to add some type of "smart-formatting" logic that considers the window size and the visible global coordinate range to determine what precision to display (e.g. the %n.mf format strings) in the toolbar and/or the editable location text fields? If so, what do you recommend?

I think this would be nice, but I would post-pone it. This can be done later, in the next step after this PR is merged.

Probably, it would involve finding the min/max of the union of all sources transformed into the world coordinate system. One can of zoom out further, such that this "filled world" only fills a few screen pixels, and in that situation, I would adapt the min/max to reflect that.

  1. Is it possible to have a mix of 3D and 2D sources? If so, I need to address that. The "global" ViewerOptions.is2D implies to me you only do 2D or 3D for all sources.

It is fine to assume, that everything is either 3D or 2D.

But... this made me think, what about other axis?

Programmatically, Sources are always 3D. "2D sources" are 3D sources with a Z size of 1. And ViewerOptions.is2D only sets up navigation actions such that one cannot move away from the Z=0 plane.

You can add "normal" 3D sources to a Viewer which is2D. You only see the Z=0 slice then, with no way to move to other slices with the UI (you can of course move to other slices by programmatically setting the viewer transform). Maybe it would be nice to be able to do this using the location card sliders? This would be already halfway to having a more "ImageJ-like" viewer behavior.

What about time? It would be cool to have a time field and slider in the location card, and also to support setting the timepoint by pasting in 4D coordinates.

Also, there have been several requests for adding a standard way to support sliders for higher dimensions of >4D sources. The location card could be a good place to add this. This change goes deeper, of course. Probably it involves modifying the Source interface to set higher dimension coordinates, and querying the number of dimensions, and extents in the higher dimensions. (@axtimwalde, maybe you have opinions/ideas there?)

What do you think?

  1. Does this division/combination of read-only toolbar with editable location card make sense? Anything else you'd like to see formatted/arranged differently?

I have not looked at the code much yet, but I will do this ASAP. I have run the GridViewerTest and played with the UI.

Of course, I'm also happy to address any code suggestions you might have. My hope is to iterate and improve things on this branch based upon your feedback.

That sounds good. Please let me know your thoughts about the points above!