Closed jamesyan-git closed 1 year ago
@jni This does not work for because of an strange error regarding label dimensionality. Strange because it says it expects a 2d or 3d layer but it has certainly been passed a 2d layer.
Tried this in ipython with a numpy array and did not error. We checked the attributes of the data and it all seems to be what skeletonize
requires, so I'm a bit lost. Would love your insights!
import numpy as np
from skimage.morphology import skeletonize
img = np.zeros(shape=(100, 100), dtype=np.uint8)
img[0:10, 0:10] = 1
skeletonize(img, method='zhang')
That was super tricky! 😅 Sorry for the misleading error message — good chance I wrote it at some point! 😂
As a minor comment, I would like this function to be in the skan package itself, not in a new napari_skan package.
Thank you! 😊 🙏
Thank you very much for the help @jni! It works now!
@jamesyan-git so cool! 😊 Should we merge this one as-is and do the skeleton analysis in the next step? Or do you want to wait until you add the shapes layer?
@jamesyan-git :wave:
Hi @jni, sorry I missed that. I've added a docstring, I think we can merge now.
I wanted to add some instructions on the widget for the user, but it seems non trivial if we want to continue auto-generating it.
Not auto-generating it would introduce dependencies though (magicgui
for decorator at least), but this is necessary even for something trivial like changing the button text. I'm happy to go this route if you are, can do in separate PR if you approve.
I was thinking of just adding an example for usage, but I'm not sure if that alone is sufficient for a new user.
Let me know what you think and I'll follow up.
LOL New networkx just dropped and broke everything! 😂🤦
This PR adds a napari plugin with a basic widget for skeletonizing a labels layer.