-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Matrix singularity in cMCF computation in Step 1 #1
Comments
Heya, that's a funky error, for the example data. I just encountered this with one of our interns recently, I've not seen that before... In this case, there was actually no mesh being input into the function, and was a python environment issue (since it was working on his local machine). Did you get a proper binary mask and mesh in step 0 and the input paths are all good? The S matrix is constructed based on the mesh laplacian matrix, L. This matrix is known to be singular if the mesh has poor triangulation which affects matrix inversion. There is likely a triangle whose internal angle is very close to 0. You can check this using the measure_triangle_props function to compute statistics of the triangle. If this is indeed the case, proceed to solution 1 below i.e. remesh with a lower remesh_samples fraction. unwrap3D.Mesh.meshtools.measure_triangle_props (c.f. https://github.com/DanuserLab/u-unwrap3D/blob/master/unwrap3D/Mesh/meshtools.py) There are two solutions then:
Let me know if this then works. Felix |
Thank you so much for your help! Sadly, I still have no luck figuring out the error so far... Below is a list of things I have tried so far: Mesh generationIn step 0, I was using
After I change it to
However, even with the improved mesh, cMCF calculation by Dependency on the solver?When mapping the surface proximal surface signals in Step 0, I actually got the same error message (i.e., singular matrix error) using the example notebook. However, when I changed the solver from n_samples = 1./ .104 # total number of steps
stepsize = 0.5 # voxels
# flip the mesh vertex coordinates so that it aligns with the volume size
img_binary_surf_mesh.vertices = img_binary_surf_mesh.vertices[:,::-1].copy()
# run the active contour cMCF to get the coordinates at different depths into the cell according to the external image gradient given by the gradient of the signed distance function.
v_depth = meshtools.parametric_mesh_constant_img_flow(img_binary_surf_mesh,
external_img_gradient = H_sdf_vol_normal.transpose(1,2,3,0),
niters=int(n_samples/stepsize),
deltaL=5e-5, # delta which controls the stiffness of the mesh
step_size=stepsize,
method='implicit', # this specifies the cMCF solver.
conformalize=True, # ensure we use the cMCF Laplacian
robust_L=False,
solver='other') # <--Used to be pardiso, but now using scipy.sparse Output: 0%| | 0/19 [00:00<?, ?it/s]/home/dkobayas/LC-shadow/u-unwrap3D/unwrap3D/Mesh/meshtools.py:4033: MatrixRankWarning: Matrix is exactly singular
U = spsolver.spsolve(S,b)
100%|██████████| 19/19 [00:02<00:00, 7.83it/s] This motivated me to also use the
Robust Laplacian (
|
The problem has been resolved. A root cause turned out to be in the libigl Python Bindings ( For some reason, the |
thanks for letting us know ! - that's a pretty wild error coming from igl and numpy. I wonder if this numpy also causes robust_laplacian to fail too..... I will need to test these and perhaps change the install requirements. Cheers! |
Hi, thank you so much for sharing your great work!
I'm trying to run your example Jupyter notebook on my Linux machine with Intel chip. I didn't encounter any issues in the first notebook (
Step0_binary_cell_segmentation_surface_meshing_and_curvature_measurement.ipynb
) but got an error in the second notebook (Step1_conformalized_mean_curvature_flow_and_S_ref_creation.ipynb
). The error happens in the second cell where the conformalized mean curvature flow (cMCF) is computed:Strangely, the matrix
S
computed in this line becomes singular for some reason. I'm wondering what a potential cause for this error would be. I'm using the example data (bleb_example.tif
) as input.The text was updated successfully, but these errors were encountered: