I am trying to find the hull of a few objects in an image stack. They are microscope images of cells. I'm using ConvexHull from scipy to do so. The image stack is of dimensions 46 x 512 x 512. I have converted it to a binary array.
I tried
imhull = ConvexHull(imbinary)
but got this error message:
ValueError: Buffer has wrong number of dimensions (expected 2, got 3)
Therefore, I decided to iterate through each of the 46 images in the stack and see if I could combine the output after.
imhull = []
from scipy.spatial import ConvexHull
for i in np.nditer(imbinary):
imhull[i] = ConvexHull(imbinary[i])
However, this gave the error message:
QhullError: QH6214 qhull input error: not enough points(512) to construct initial simplex (need 513)
While executing: | qhull i Qt Qx
Options selected for Qhull 2015.2.r 2016/01/18:
run-id 1322522047 incidence Qtriangulate Qxact-merge _zero-centrum
Q3-no-merge-vertices-dim-high
How should I troubleshoot this problem?
I'm also looking for some advice on whether this approach is suitable (ie. would combining the individual images give the correct 3d hull?) or if not, what are some alternative ways I can find the boundaries to the objects in the image?
Thank you.