Diffusion MITK 99c7cd50740b

Add Segmentation.labelSetPreset command-line argument


Add Segmentation.labelSetPreset command-line argument

When specified, it will override the default label set preset preference.

Also unified the typing of "label set".

Event Timeline

floca raised a concern with this commit.Mar 31 2022, 2:58 PM
floca added a subscriber: floca.
floca added inline comments.

I think that is problematic. The plugin should uses the preference and not the variable directly. Currently, you would neet to go always via cl arguments.

I would set the preference in the application plugin if the cl argument is used.

This commit now has outstanding concerns.Mar 31 2022, 2:58 PM
kislinsk added inline comments.

Initially I had trouble to understand your issue since the command-line argument is only used if set for the current application session and otherwise the preference is used, but if I understood you correctly now, you mean that *when* the command-line argument is set, that during that session the default preset cannot be changed with an immediate effect.

This is intentional, though. A technical reason is that if the command-line argument would set the preference itself, the code for this would be necessary out of context right in the general blue berry code for loading preferences at application start, rather than in QmitkSegmentationPreferencePage, since any code called here is too late for the initial OnPreferencesChanged() call to the QmitkSegmentationView to get the preferences. This would also create a soft-dependency in a general component about specific preferences it should not know anything about.

Also, allowing a double-override by command-line option and then again by resetting the preferences is confusing as the command-line option is suddenly ineffective even though specified for the current session. A command-line argument in general should also affect only the session it is specified for and do not change something persistent for future sessions when not specified anymore.

However, to improve the UX and to reduce potential confusion for the user, I added a hint to the segmentation preferences as soon as the preset is overridden by a command-line argument and put the widgets into read-only mode if this is the case.

Thank you for your detailed answer. I meant something different ;) , but you have implicitly answered it. I wasn't aware that the OnPreferenceChanged is always called on view initialisation.

All concerns with this commit have now been addressed.Apr 1 2022, 8:46 AM