Skip to content

refactor(core): remove last bits of data reflection

Description

Data reflection based on the camp library was definitely removed from Sight. It consisted in removing the files used to declare data reflection and all files that used camp.

Most usages of data reflection was removed in previous merge requests, like serialisation. However, some last services still used data reflection and were modified accordingly:

module::ui::qt::model::SModelSeriesList

This service displays reconstructions in a tree widget. It used data reflection to display any model series attribute. However practically, it was only used to display the organ names, structures types and volumes. Those three possibilities were hard-coded instead.

module::ui::qt::series::SViewer

SViewer shows a preview of data. Normally, it takes input data, but a similar mechanism was in place to allow data extraction like in activities. This was a bit over-designed and practically only used to extract images from image series. The image preview activity was thus modified to extract the image with the new SGetImage service.

module::data::SCopy

The most annoying service was SCopy. Like SExtractObj, it was capable of using a path camp to copy sub-objects. It was used abusively in SightViewer, probably to avoid deferred objects. This was bad since model series and images are present multiple times in memory.

Nevertheless, this could not be changed easily. Two new services needed to be written.

  • module::data::SGetVector: very similar to SGetSeries, it allows to extract elements of a sight::data::Vector.
  • module::ui::qt::series::SSelectDialog: the intent of this service is to pop-up a dialog to let the user pick a series. Indeed in SightViewer, we may load several series, but only the first one is displayed. So for instance, if we read a CT-scan with 3 different blood times, we can only display the first one. This service also resolves the problem of the type of output. It allows to output the result to different objects according to their type: image or model. With the constraint of time for the incoming release, this service is proposed in the state of a draft. It does not prompt the dialog yet, instead, it takes the first element. This allows at least to keep the same level of functionality in SightViewer. It will be finalized in Sight 22.0

Closes #853 (closed)

How to test it?

  • Best would be to test all applications!
Edited by Flavien BRIDAULT

Merge request reports