PMEAL / porespy

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

blobs porosity is off for porosity different than 0.5 #961

Closed amirDahari1 closed 4 months ago

amirDahari1 commented 4 months ago

Hi!

When generating larger and larger images with generators.blobs, the porosity (when far away from 0.5) does not converge to the value given.

import porespy as ps

l = 1000
blob1 = ps.generators.blobs([l,l], porosity=0.1, blobiness=l/50)
print(f'blob1 {l}x{l} mean = {blob1.mean()}')
l = 10000
blob2 = ps.generators.blobs([l,l], porosity=0.1, blobiness=l/50)
print(f'blob2 {l}x{l} mean = {blob2.mean()}')
blob1 1000x1000 mean = 0.101451
blob2 10000x10000 mean = 0.10158081

porespy version 2.4.1 python version 3.11.9 Mac OS

Thanks in advance, I think the issue is that after the gaussian filter in making the blobs image, the distribution is not normal.. It might be a bit slower but maybe have a all_to_uniform function that does not assume normality to change the distribution to uniform.