porespy
                                
                                
                                
                                    porespy copied to clipboard
                            
                            
                            
                        Improve speed and API of local thickness
It's time to renovate the local thickness and porosimetry functions. The changes I have in mind are backwards incompatible so this is probably more like "add to the wish list for V3".
- [ ] I could be imagining this, but I feel like at some point the 
edtfunction changed from defaulting to all cores, to just 1 core. Imagination or not, we should setparallel=porespy.setting.ncores. - [ ] We could alternatively not use 
edtand instead just use the_insert_spheres_at_points_parallelfunction, which I recently added to thetoolsmodule`. We'll have to do a good speed comparison. I guess we'll probably end up offering a 'mode' argument. - [ ] Speaking of 
modewe should also offer theskeletonbased approach which is how it's done inimagej. Take the skeleton and just insert spheres at each point the skeleton, taking the radius from the underlying distance transform values. Or this could be its own function, likelocal_thickness_sk. - [ ] On the above note, maybe we could offer a variety of functions, 
local_thickness_dtwhich uses distance transforms, andlocal_thickness_conv,local_thickness_morph, andlocal_thickness_sph. And thenlocal_thicknessis a general function which dispatches to the correct one depending on mode. - [ ] There is also the question of the memory footprint as noted in #840
 
Additional thoughts:
porosimetryshould be moved to thesimulationsmodule, since that's what it is.- So the logic that is currently in 
porosimetryshould be moved into thelocal_thicknessfunction. porosimetrycan call thelocal_thicknessfunction then trim the blobs that invaded too early to apply the access limitations function. Theporosimetryfunction could also acceptmodewhich would get passed on tolocal_thickness.- The 
sizesshould be integers between 1 and dt.max(), instead of having float values. This would make it quite a bit easier to generate histograms.