Giter Site home page Giter Site logo

Comments (2)

jgostick avatar jgostick commented on September 22, 2024

I have fixed a lot of bugs in my recent PR (#922), so caught one of the ones you mentioned: the new version will add +1 to the radius if smooth=True and leave it as is if smooth=False. However, the code you have above still still shows a bug, but I can explain why. If you reduce the r to 14, then you get 2 spheres. The reason is that to create the 'contained' edge condition I put a layer of False around the outside, but this technically makes the box 28 wide instead of 30, so spheres with r=15 do not fit. And the 3rd sphere is missing because the image is too short, only 83 instead of 90. So if you do imbox=np.ones([30, 30, 90]) and r=14 it all fits, of do imbox=np.ones([31, 31, 91]) with r=15.

Anyway, your bug report is valid, and I think I can fix it by padding the input im with False instead of inserting False along the edges of the existing image. This is probably doable, so I will add it to the PR.

from porespy.

jgostick avatar jgostick commented on September 22, 2024

I was mistaken, the code works fine. I do 'pad' the image, not overwrite the boundaries. The reason that the spheres don't fit is because a sphere with a radius of 15 voxels is actually 31 voxels wide. The following circle has a radius of 1:

[[0 1, 0],
 [1, 1, 1],
 [0, 1, 0]]

So with a radius of 1, the sphere is actually 3 voxels wide. The 'radius extends from the center of the middle pixel, to the center of the outer pixel, but the digitization requires us to draw an entire pixel.

from porespy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.