haesleinhuepf / napari-process-points-and-surfaces

Process and analyze surfaces using vedo in napari.
BSD 3-Clause "New" or "Revised" License
21 stars 4 forks source link

Parallelize sphere-fitted curvature computation #41

Open haesleinhuepf opened 1 year ago

haesleinhuepf commented 1 year ago

It should be possible to parallelize the computation of the sphere-fitted curvature by parallelizing this for loop:

https://github.com/haesleinhuepf/napari-process-points-and-surfaces/blob/a6c9113b4860917cbf6beb2b6c535e9ecced1d25/napari_process_points_and_surfaces/_quantification.py#L239

Hints:

jo-mueller commented 1 year ago

Hi @haesleinhuepf ,

I played around with this in another context and I think joblib parallelization could do the trick. The syntax is also quick simple:

from joblib import Parallel, delayed

list_of_results = Parallel(n_jobs=-1)(delayed(function_to_parallelize)(arg for arg in list_of_arguments))

will try to put it in a PR.