Fit 3D spheres to binary

Dear community,

I have an image analysis/geometry problem.

In the images I am looking at there are two touching nuclei that really look like intersecting spheres. I can segment the nuclei and would like to fit the 3D binary mass to 2 spheres. I was thinking to solve the minimization problem (using MATLAB or python) where the initial conditions are given by a guess of center and radius from the binary images. Have not decided yet which function exactly to minimize.

Do you have a suggestion for the function ?
Are there alternative solutions in imageJ, knime?
Does a Hough Transform for 3D sphere exists?



An example binary mask can be found in

1 Like