marcomusy / vedo

A python module for scientific analysis of 3D data based on VTK and Numpy
https://vedo.embl.es
MIT License
2.05k stars 266 forks source link

2D images become non-pickable after changing cmap #1187

Open sudmat opened 2 months ago

sudmat commented 2 months ago

Hi, I found a strange thing when running the spline_draw example.

Below is the officially provided code (vedo\examples\advanced\spline_draw.py) which works fine. image

But when I changed the pic cmap to binary_r, I could no longer select the points on the image because the event.actor became None. image

I am not sure if this is a feature or bug, but it seems not making sense if the pickability depends on the cmap. Any information would be appreciated!

marcomusy commented 2 months ago

This is quite strange ! I don't understand why that happens.. one possible way around is to create a quad mesh from the image, and that works:

pic.cmap("binary_r")
pic = pic.tomesh()
sudmat commented 1 month ago

This is quite strange ! I don't understand why that happens.. one possible way around is to create a quad mesh from the image, and that works:

pic.cmap("binary_r")
pic = pic.tomesh()

Thank you and I'll try!