Comments (4)
Hi Aurelien
Thanks for your comments! I'll try to answer your questions:
(0) Scipy is a super set of numpy, so all array ops using scipy really just call numpy. Scipy has the very important ndimage module, which we use extensively. Our plan is to remove the code within the local thickness function, and have it call porosimetry behind the scenes. This way we only have to maintain one version of the code. Local thickness is just a porosimetry simulations with access limitations turned off. RE the sizes thing, we do this to reduce the number of points we perform the simulation on to save time. You are able to override this by sending in sizes
yourself...but be prepared to wait!
Regarding Q1 and Q2, they sound like bugs, so I'll need more time to investigate. I'll get back to you soon.
from porespy.
Thanks. I know about the scipy/numpy connectivity and I also use ndimage quite a bit, but it's probably the first time I see such heavy use of scipy for handling arrays this way (I generally see both imports and use of numpy for matrices). But this is just a lack of experience on my side... so don't worry about this part...
On the size idea, I understand better why you went for this option, now. The thing is that I'm currently running a script to measure porosity at the resolution limit, i.e. 1-3 pixels roughly. I know, it's really not optimal to run a distance map calcuation, but our voxels are (14 nm)^3 so this is actually quite good in terms of imaging... So in this specific and probably odd context, I need precision on the size distribution.
So all in all, maybe adding a simple keyword specifying how precise you want the calculation to be (and computing time you can afford) would fit both your everyday needs and my specific one.
from porespy.
I just did a quick check with the following:
import scipy.ndimage as spim
import porespy as ps
im = ps.generators.blobs(shape=[500, 500])
lt = ps.filters.local_thickness(im=im, sizes=sp.unique(spim.distance_transform_edt(im)))
This works as you are looking for by specifying the exact sizes to use, BUT is does over 1000 loops! There are just too many sizes, so we need some way to do it by bins. The integer value of radius seems to make sense. Note that all the convolution take a structuring element of given radius, so doing diameter doesn't really work. The radius needs to be a whole number of voxels.
Anyway, can you try sending your desired sizes into the sizes argument and let us know if it works for you, and if this is a reasonable approach, as opposed to adding a flag to the function as you suggested? Using sizes
essentially gives the user infinite control.
from porespy.
Since this function works as we think it should, and @gourrier hasn't replied in a while, I'll assume the problems are all sorted and close this.
from porespy.
Related Issues (20)
- Separate out tools and utils?
- Add a `size_to_pc` function?
- Add a `pc_to_seq` function
- improve the `_insert_disks` methods by not generating spheres each time
- Export to COMSOL HOT 1
- Deprecate COMSOL IO?
- `align_image_with_openpnm` not working as intended HOT 2
- Visualization helper functions are inconsistent
- Implement "electrode tortuosity"
- SNOW network extraction HOT 4
- How to get grain size distribution through the image generated from PoreSpy HOT 1
- `porosity` function should optionally fill blind pores
- The porosity difference between PNM and Porespy HOT 2
- `setup_rich_logger` interferes with global logging config HOT 1
- Memory leak in `diffusive_size_factor_dns`
- List of examples we should make to populate the FAQ section
- Add mode to `sierpinski_foam2` to handle how cropping is done
- Improve speed and API of local thickness HOT 1
- `visualize.sem` should return a normalized image between 0 and 1
- Error importing module: No module named 'matplotlib._docstring' HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from porespy.