silx icon indicating copy to clipboard operation
silx copied to clipboard

Add density filter to the default Plot2D, ImageView

Open vallsv opened this issue 2 years ago • 1 comments

As far as i can see the density filter is only used by the exemple imageview.py

It would be convenient to expose it by default.

vallsv avatar Jan 23 '23 14:01 vallsv

It is available in the ImageView class (that's why it is available in the imageview.py example):

https://github.com/silx-kit/silx/blob/395cb8fb2fa2755d7e5f0c678849317706d0395f/src/silx/gui/plot/ImageView.py#L482

This AggregationModeAction only works with a specific image item ImageDataAggregated.

It works with the ImageView because the ImageView.setImage method creates the right item type.

I see it complicated to use the same in a more "generic" context like Plot2D. It would mean things like providing a density tool button that is useless most of the time (i.e., unless the right type of image item is used), or adding some detection mechanism which changes the active image item when there is some aggregation filter set-up... which can cause trouble further down as the item is changed in the back of the caller... So I'm -1 to add it in Plot2D.

However, as it is, the AggregationModeAction action is available internally in ImageView.py. This can be made available in silx.gui.plot.actions and documentation.

t20100 avatar May 22 '23 11:05 t20100