blik icon indicating copy to clipboard operation
blik copied to clipboard

colouring points by data attribute

Open McHaillet opened this issue 11 months ago • 4 comments

I think it could be a useful feature to give the points layer a color gradient depending on a data attribute. For example, my template matching package writes out the correlation score (LCCmax) and it would be very useful to colour the points by this data attribute. Or in 3D viewing it could be useful to colour points by the z-coordinate.

From the Napari docs, it seems something like that is possible. Do you think this would be dificult to implement?

McHaillet avatar Mar 19 '24 16:03 McHaillet

This doesn't need anything custom, you can do it already with pure napari, as explained in that link. For example, you can do:

points_layer.face_color = 'LCCmax'  # assuming `LCCmax` is the column name
points_layer.face_colormap = 'viridis'

Or were you looking for some widget alternative?

brisvag avatar Mar 25 '24 13:03 brisvag

Or were you looking for some widget alternative?

Yes, I meant a widget! Is that in the scope of Blik?

Once I have some more time, I could also try to make a PR for it

McHaillet avatar Mar 29 '24 14:03 McHaillet

I'm not sure this is in the scope for blik, but if you'd like to take a crack at a PR we can see if it's small/self-contained enough that it's a useful addition :)

In principle, it's a very general (and useful) tool for the whole napari ecosystem though, so maybe it would be good to have in napari core, maybe as part of the layer controls.

brisvag avatar Mar 29 '24 14:03 brisvag

+1 on napari core for this, would be great if blik then loaded properties in and user automatically had the option to colour by them :)

alisterburt avatar Mar 29 '24 15:03 alisterburt