How to extract a pore network from a rock CT image #688
Replies: 7 comments 6 replies
-
I dug it for a while too. To me, the doc wasn't too clear for this, but it is as simple as the following: import porespy as ps
import numpy as np
import matplotlib.pyplot as plt
# create a random porous structure
stack = np.random.randn(500, 500, 500)
stack[stack>0.5] = 1
stack[stack != 1] = 0
# extract the PN
# if I understand well the doc, it floods a voxel until it touches the wall
local_thickness = ps.filters.local_thickness(stack, sizes=10) # pls see below y-axis
data = ps.metrics.pore_size_distribution(local_thickness, bins=100, log=False)
# plot it
voxel_size = 1 # unit: um
plt.bar(data.R*voxel_size, data.pdf, width=data.bin_widths) # pore size distribution
plt.plot(data.R*voxel_size, 1 - data.cdf, 'red') # accumulative
plt.xlabel('invasion size [um]')
plt.ylabel('pore size smaller than stated volume') # check this link: https://porespy.org/examples/filters/reference/porosimetry.html |
Beta Was this translation helpful? Give feedback.
-
Well, I'm afraid that what I posted is not what you search as I'm in the same case as yours. I just found another solution: import porespy as ps
import openpnm as op
import numpy as np
import matplotlib.pyplot as plt
# create a random porous structure
stack = np.random.randn(500, 500, 500)
stack[stack>0.5] = 1
stack[stack != 1] = 0
# compute pore network
snow_output = ps.networks.snow2(stack, voxel_size=1)
try:
pore_net, geo = op.io.PoreSpy.import_data(snow_output.network)
except AttributeError:
pore_net, geo = op.io.from_porespy(snow_output.network)
voxel_size = 1 # unit: um
values, base = np.histogram(geo['pore.volume']*(4/3*np.pi*voxel_size**3), bins=100)
cumulative = np.cumsum(values)
fig, ax1 = plt.subplots()
ax1.bar(base[:-1], values, width=base[2]-base[1])
ax1.set_xlabel('pore volume [um^3]')
ax1.set_ylabel('counted')
ax2 = ax1.twinx()
ax2.plot(base[:-1], cumulative/cumulative.max()*100, 'red')
ax2.set_ylabel('accumulative volume fraction')
fig.show() Note that if you use the |
Beta Was this translation helpful? Give feedback.
-
I am very sorry to give you a reply so late. Thank you very much for your reply to the problem, which benefit me a lot. The pore network has been successfully extracted.
…------------------ 原始邮件 ------------------
发件人: "PMEAL/porespy" ***@***.***>;
发送时间: 2022年5月10日(星期二) 晚上11:01
***@***.***>;
***@***.******@***.***>;
主题: Re: [PMEAL/porespy] How to extract a pore network from a rock CT image (Discussion #688)
Well, I'm afraid that what I posted is not what you search as I'm in the same case like yours. I just found another solution:
import porespy as ps import openpnm as op import numpy as np import matplotlib.pyplot as plt # create a random porous structure stack = np.random.randn(500, 500, 500) stack[stack>0.5] = 1 stack[stack != 1] = 0 # compute pore network snow_output = ps.networks.snow2(stack, voxel_size=1) try: pore_net, geo = op.io.PoreSpy.import_data(snow_output.network) except AttributeError: pore_net, geo = op.io.from_porespy(snow_output.network) voxel_size = 1 # unit: um values, base = np.histogram(geo['pore.volume']*(4/3*np.pi*voxel_size**3), bins=100) cumulative = np.cumsum(values) fig, ax1 = plt.subplots() ax1.bar(base[:-1], values, width=base[2]-base[1]) ax1.set_xlabel('pore volume [um^3]') ax1.set_ylabel('counted') ax2 = ax1.twinx() ax2.plot(base[:-1], cumulative/cumulative.max()*100, 'red') ax2.set_ylabel('accumulative volume fraction') fig.show()
Note that if you use the geo.keys() method in the dictionary geo above, you can find all the information you need including: throat.diameter, pore.volume, pore.equivalent_diameter, etc. I will invite you to search the properties that you want to do the stat, accessing the dictionary by doing geo['some key word here']. Hope it helps!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hello
If you want to extract the pore network information, you can use the method of snow2 operation, and there are other examples on the official website to learn in many aspects, you are also welcome to join the nine five two seven six three four eight seven group to learn and exchange.
…------------------ 原始邮件 ------------------
发件人: "PMEAL/porespy" ***@***.***>;
发送时间: 2023年2月18日(星期六) 晚上8:04
***@***.***>;
***@***.******@***.***>;
主题: Re: [PMEAL/porespy] How to extract a pore network from a rock CT image (Discussion #688)
Can we discuss it, I want to learn from you
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hello, how can I make my CT results (such as .mesh or .stl files) to the 3D numpy array? Thank you! |
Beta Was this translation helpful? Give feedback.
-
Hello, how can I make my CT results (such as .mesh or .stl files) to the 3D numpy array? Thank you! |
Beta Was this translation helpful? Give feedback.
-
Thank you very much. Your tutorials help a lot! Thank you! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I would like to ask how to extract holes and throat data from the CT image of the rock and import them into openpnm to generate a network model.
Thank you,
mingyuetianya
Beta Was this translation helpful? Give feedback.
All reactions