I have a numpy array of shape (260,311, 260) of points. It represents 8 electrodes (value 1) in an empty space (surrounded by zeroes). How can I detect these blobs and individualize them one by one? (I'm expecting 8 arrays of 260,311,260 with only one electrode each)
I've tried to extract the 1 values with np.nonzero but I'm stuck right after. I have also tried skimage.feature.blob_log but it doesn't seem to work on numpy arrays; and Kmeans clustering, but I would like to do it with a variable number of electrodes.
This is the 3d plot of np.array(np.nonzero(electrodes_data))
fig = plt.figure(figsize=(6, 6))
ax = fig.add_subplot(111, projection='3d')
ax.scatter(all_coordinates[0], all_coordinates[1], all_coordinates[2],
linewidths=1, alpha=.7,
edgecolor='k',`your text`
s = 200,
c=all_coordinates[0])
ax.view_init(elev=0, azim=0)
plt.show()

It's weird that there isn't a simple function to individualize blobs?!