fix(ui): fiducials distance should be visible only on their specific slice
Description
Currently, the ruler manages the way to add distance on 3D images (on different slices and always visible). However in a 2D+T images context it doesn't work correctly.
If we change the slice, the added fiducials from previous slices are still displayed.
Steps to reproduce
Imagine that we add some distance fiducials using the ruler on a slice of 2D+T images. If we change the slice, the fiducials from previous slices will still be displayed.
It's use the sight::module::viz::scene3d_qt::adaptor::fiducials::ruler
, so you can reproduce this bug on apps that use this service.
Functional specifications
When the user changes the slice, the added distances should be set as not visible and then become visible again when returning to the specific slice.
Technical specifications
In the ruler.cpp:
- Adapt the update_image_distance_field method and make it create a fiducial with an index slice referenced. We can stock this in
sight::data::fiducials_series::referenced_image::referenced_frame_number
. - Fix the restrict_to_current_slice method to make it functional.
When you want to configure your ruler for 2D+T images, you add in the XML:
<connect>
<signal>${imageSeries}/sliceIndexModified</signal>
<slot>ruler_fiducial_adp/restrict_to_current_slice</slot>
</connect>
Like this, we can restrict the distance to be added and visible only on the current slice, specifically in a 2D+T images context.
Test plan
Manual testing on different apps where we use 3D and 2D+T images.