PMEAL / porespy

A set of tools for characterizing and analying 3D images of porous materials
https://porespy.org
MIT License
300 stars 98 forks source link

How to obtain number of pores in 3D? #313

Closed alexeytopolnitskiy closed 3 years ago

alexeytopolnitskiy commented 3 years ago

Hello! I have a 3D model of a porous media. How can I estimate number of pores in this cube using PoresPy? And also, is it possible to obtain pore size distribution where each pore and its diameter are included (not like porespy.metrics.pore_size_distribution does, because it depends on number of bins). I mean for all possible pores and its diameter (smth like GeoDict does). Thanks!

TomTranter commented 3 years ago

You need to do network extraction - there are a few examples https://github.com/PMEAL/porespy/blob/dev/examples/networks/snow_basic.ipynb https://github.com/PMEAL/porespy/blob/dev/examples/networks/snow_advanced.ipynb

TomTranter commented 3 years ago

You can then also do simulations using our OpenPNM software https://github.com/PMEAL/OpenPNM

jgostick commented 3 years ago

As @TomTranter says, the definition of a pore only applies if you do a pore network extraction to identify pores and throats. But pore networks have some assumptions built in. The purest estimation of the size distribution is the local thickness filter, binned as desired. It's a statistical value after all.

alexeytopolnitskiy commented 3 years ago

@jgostick @TomTranter Thank you for your replies! Now it is a bit understandable for me. If I got it right there are two ways of obtaining desired pore size distribution:

  1. Take my model, extract network with op.network.GenericNetwork(), extract geometry with op.geometry.GenericGeometry() and then, using geo["geometry"] take values of pore diameters;
  2. Or apply ps.filters.local_thickness() and analyze histogram of voxel values.

First approach gives me close to something that I need, but second returns really strange distribution. Am I getting it right or you meant something else?

jgostick commented 3 years ago

Sorry for the late reply. If you want to do network extraction to get the 'stick and ball' representation, follow these examples

If you want to get the statistical info about pores sizes, use local thickness as described here