mastodon-sc/mastodon

Load/Save BDV settings with Mastodon Load/Save

stefanhahmann opened this issue · 13 comments

User Story

As a Mastodon user, I would like that any potential BigDataViewer (BDV) settings that I have made, are saved, when I save the Mastodon project. These settings could e.g. brightness and color settings.

Currently, the loading/saving of these settings is separated from the loading/saving procedure of a Mastodon project, cf.:

grafik

The likelyhood that a Mastodon users forgets about loading/saving the BDV settings extra to loading/saving the project is quite high and the current procedure also includes an additional step, that is not really required.

Acceptance criteria

  1. When the Mastodon project is saved the BDV settings are saved as well.
  2. When the Mastodon project is loaded, existing BDV settings are loaded as well.

Tasks

  • [ ]

Additional information:

Settings made in Mastodon Big Data Viewer:
grafik

Settings after saving the Mastodon project and re-opening it (while not extra saving/loading BDV settings)
grafik

@tinevez can you please comment on this issue if it makes sense from your perspective? the issue came up while testing some things inside Mastodon with colleagues from MPI CBG

I think that would make a lot of sense.
There is code for loading/saving these settings in bdv-core:
https://github.com/bigdataviewer/bigdataviewer-core/blob/e29a9253ce0de30d9bcb76d6a623c0f8d5265a45/src/main/java/bdv/BigDataViewer.java#L751-L762
https://github.com/bigdataviewer/bigdataviewer-core/blob/e29a9253ce0de30d9bcb76d6a623c0f8d5265a45/src/main/java/bdv/BigDataViewer.java#L669-L679

The brightness/colors part is in SetupAssignments.fromXml() / toXml()
https://github.com/bigdataviewer/bigdataviewer-core/blob/d6edacb661291ef5d6b78df1cd9a1b8045553052/src/main/java/bdv/tools/brightness/SetupAssignments.java#L239-L327

(However, note that the Settings serialization is on the list of planned changes, because this is one of the last bits standing in the way of removing the deprecated old BDV ViewerState.)

Wait, normally the user settings are saved in a *.settings.xml file along with the data. And when the BDV image is loaded, Mastodon should load and apply the settings along. If it is not the case, then it is a bug.

Actually this works. The settings.xml file is correctly reloaded when a BDV window is opened.

Hm, with the following workflow, I cannot get it work. Also with this workflow, no settings.xml is generated. I used this dataset for the purpose of demonstration: http://data.celltrackingchallenge.net/challenge-datasets/Fluo-N3DH-CE.zip

Since the workflow is quite long, I have recorded it. You can watch the recording here: https://cloudstore.zih.tu-dresden.de/index.php/s/3kAMJbmz5TySXKd

Please do not that at 1:54 of the video I make some BDV settings that are not remembered after I have saved the project, closed it, and reopened it, cf. 2:30 of the video.

Is it a user error that with this workflow no settings.xml is created?

ah ok. It works with the beta-26
I will see what does not work with dev branch

Heu wait. You have to manually save the *.settings.xml file. It is done in the File menu when a BDV view is active: Save Bdv Settings

Screenshot 2023-03-24 at 13 20 15

ah ok. It works with the beta-26 I will see what does not work with dev branch

the video was actually recorded with the official Fiji and the beta-26 release of mastodon that was loaded from the update site.

Heu wait. You have to manually save the *.settings.xml file. It is done in the File menu when a BDV view is active: Save Bdv Settings

Screenshot 2023-03-24 at 13 20 15

Ah, I see. So, this is the trick.

@tinevez

Would it make sense from your perspective to integrate the saving/loading BDV settings step into the saving/loading of Mastodon?
It would be 1 saving step instead of 2 and thus less likely that users can forget.

I think this is a good idea for Mastodon. People will forget about saving the settings when they close Mastodon, this would give persistance.

I think this is a good idea for Mastodon. People will forget about saving the settings when they close Mastodon, this would give persistance.

Okay, I changed the description of the issue.

The load part is normally done.