Parameters of US Device such as spacing, resolution, crop area and meta data related to the device should be serializable and deserializable.
Saving and loading a device configuration seems to work fine. The values are correctly saved to the xml configuration file and loaded again within the "Edit Probes" settings. Several problems remain:
- The change of the parameters (e.g. cropping) does not have an effect on the actual cropping of the image. The cropping values are also not applied to the spin boxes in the Custom Controls widget.
- When changing the probe parameters, applying them and closing the application, the parameters of the restored device after startup are set back to default. Shouldn't those be persistent as well?
To the first mentioned point:
In fact, the changing of the cropping when configurating the USVideoDevice does not change the cropping parameters of the image. I left this point open due to a software architectural question: Till now the cropping of the ultrasound image was controlled by the mitkUSImageVideoSource and there was no possibility to configure a probe specific cropping. However, I think it makes sense to have the possibility to configure a probe specific cropping and not an "image specific" cropping. Or what do you think? Should the cropping be controlled by the mitkUSImageVideoSource or by the mitkUSProbe ?
Therefore, i did not create the connection between updating changes of the probe specific cropping and the cropping of the mitkUSImageVideoSource. What would be the best way to do this? Should we store the cropping in 2 different classes or only in 1 class?
To your 2nd point:
I cannot understand what is not working. Which persistence do you mean (the QSettings-persistence or the XML-persistence)? Concerning the XML-persistence: the values are stored only, when clicking on the "Save"-button. The "Apply Changes"-button does not affect the xml-persistence. Should this behaviour be changed, as well?
I just discussed this issue with Alfred and we came to the following conclusion:
You are right, currently the cropping parameters in the custom control widget are assigned to the image source not matter what probe is activated. As you wrote it would make sense to assign the cropping parameters to the probes. The probe is selected just below the spin boxes of cropping parameters, so it should be straight-forward to react on a change in the combo box. In our opinion the following things need to be changed:
- The cropping parameters should be obtained from the individual probes and consequently the USImageVideoSource should be updated if a probe changes.
- The QSettings device persistence should be updated to also store this information, so that it is consistent to the XML-persistence.
- On the UI side, the spin boxes in the custom control widget need to be updated if a new probe is selected. This should be straight-forward because the ComboBox for selecting a probe is just below the spin boxes of the custom control widget. Other way round, if the spin boxes of the custom control widget are changed, the cropping information of the probe settings should be updated.
I was referring to the QSettings persistence, the implementation of the XML persistence is as expected for me.