Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default location meaningful for dataset #394

Open
martinschorb opened this issue Aug 2, 2021 · 11 comments
Open

default location meaningful for dataset #394

martinschorb opened this issue Aug 2, 2021 · 11 comments
Labels
bug Something isn't working

Comments

@martinschorb
Copy link
Contributor

Hi,

the default "location" that MoBIE shows upon launch should make sense in context of the active dataset.
So, when a dataset is loaded, the default location should be optionally specified in the dataset.json or if no value is present there fall back to the center of the current image.

@constantinpape
Copy link
Contributor

This is fully specified by the view with name default. So you can set whatever default location you like with that view.

@martinschorb
Copy link
Contributor Author

Where does that arbitrary value come from if no default location is specified in the view?
In my view, either that default location should be mandatory in a view or if it is not provided, the value shown in the viewer should automatically be set to something useful.

@constantinpape
Copy link
Contributor

Where does that arbitrary value come from if no default location is specified in the view?

There is some BDV internal logic to compute it. If you are not happy with the result you need to set it in the default view via the viewerTransform.

In my view, either that default location should be mandatory in a view

No, we don't want the viewerTransform to be mandatory, there are many cases where we don't want it to be specified in a view.

or if it is not provided, the value shown in the viewer should automatically be set to something useful.

In most cases the default view computed by bdv is very reasonable. But it's a heuristic, so it can only do so much. So, like I said, if it's not sufficient you can over-write it with the viewerTransform.

@martinschorb
Copy link
Contributor Author

Note that I am not referring to "position", this is about the "location" UI element that in my case shows

{"position":[120.5,115.3,201.5]}

as default value.
This makes no sense for the current dataset/view.

I could not find "location" anywhere in either the dataset schema or the support functions.
(except for "tableDataLocation" which is something different)

@constantinpape constantinpape reopened this Aug 2, 2021
@constantinpape
Copy link
Contributor

Note that I am not referring to "position", this is about the "location" UI element that in my case shows

Ah ok, sorry I forgot that even existed. Yes, that is completely unrelated to the default view. I don't know where the default values for this come from; we don't have anything for it right now in the json. I agree that these values should either be something sensible or maybe we also don't need a default for that.

@tischi where are the defaults for the "location" UI element coming from right now?

@tischi
Copy link
Contributor

tischi commented Aug 3, 2021

where are the defaults for the "location" UI element coming from right now?

I think the default values still point to the "right eye" of the platy 🤣
I have an emotionally very hard time changing this as this is such a classic..... 😫

@constantinpape
Copy link
Contributor

This should def. be updated, and I would classify the current behaviour as a bug.
I see three possible options

  1. use the default position computed by BDV
  2. just leave this empty by default
  3. add an (optional) field to dataset.json to specify this.

@constantinpape constantinpape added the bug Something isn't working label Aug 12, 2021
@martinschorb
Copy link
Contributor Author

martinschorb commented Aug 27, 2021

I would vote for 3.
Additionally, if the JSON field does not exist, the input GUI field should be hidden.
If the JSON field exists but is empty -> 2

@constantinpape
Copy link
Contributor

@tischi should we add defaultPosition to the dataset.json and use it to populate the location menu?
And leave it blank if defaultPosition is not given?

@constantinpape
Copy link
Contributor

I would vote for 3. Additionally, if the JSON field does not exist, the input GUI field should be hidden. If the JSON field exists but is empty -> 2

We should still implement this. I will add defaultPosition to the dataset.json now and push it onto a platybrowser branch. cc @tischi.

@constantinpape
Copy link
Contributor

@tischi I called the field defaultLocation now to be more accurate with the viewer.
I have added it for the platybrowser here: mobie/platybrowser-project#89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants