Giter Site home page Giter Site logo

Comments (3)

odinsbane avatar odinsbane commented on June 3, 2024

Hello

I have wondered about using the marching cubes algorithm before. I didn't know if it would produce produce simple closed surfaces. It sounds like a good idea though!

The scaling always uses the long axis of the image.

Lx = labeling.shape[2]*spacing[2]
Ly = labeling.shape[1]*spacing[1]
Lz = labelling.shape[0]*spacing[0]

(I suspect that is how python is ordering the axis, but if not I hope it makes sense.)

Then the scale factor will be

factor = 1/max(Lx, Ly, Lz)

The offset is half the image as you have noticed.

ox = -0.5*Lx*factor
oy = -0.5*Ly*factor
oz = -0.5*Lz*factor

So you need to know the spacing and the image dimensions. I hope that helps.

Cheers

from deformingmesh3d-plugin.

tibuch avatar tibuch commented on June 3, 2024

Awesome thanks!

I think the step_size parameter in marching cubes will be crucial to generate simple meshes. With step_size = 1 the meshes are very dense and deforming them takes longs. However, if I use connection remesh the meshes get simple enough. I will experiment now with increasing step_size.

That being said, using these meshes as initialization works very well!

from deformingmesh3d-plugin.

tibuch avatar tibuch commented on June 3, 2024

Just in case, I put my script to convert a label image to meshes here: https://github.com/fmi-faim/faim-3d-organoid-seg/tree/main/ipa/convert-labeling-to-meshes

Using the step_size parameter in marching cubes works well to get coarse meshes. One just has to be careful to handle objects which are smaller than the step_size.

from deformingmesh3d-plugin.

Related Issues (9)

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.