I was able to run your code, and noticed a number of issues
First, your domain is relatively large 512 x 512 x 158 but 99% of the volume is empty. your non-zero voxel is only a few voxels. this is not the best way to mesh such tissue from multiple perspectives. First, it is very inefficient. the meshing tools had to analyze all the voxels to create mesh, but most of them do not contain boundary information. Secondly, the relative resolution to your non-zero region is very poor, because the non-zero voxels is only about 5x4x3 voxels in size, the discretization error (voxel-like stair-case boundaries) is dominant. You should at least cut out most of the empty space to make the meshing process fast. If possible, increase the resolution for the non-zero label region.
to find out where are your non-zero voxels, you can run (see left
panel of the attached image)
[no,fc]=binsurface(small_organ);
plotmesh(no, fc)
also, if you crop your domain to only the non-zero voxel regions,
you can get the mesh less than a second (see right panel of the
attached image)
[no,fc]=v2s(small_organ(90:102, 265:280, 100:105), 0.5,opt);
plotmesh(no,fc)
but again, your resolution is super coarse so the shape you saw
was mostly dominant by voxelation, not really an accurate surface.
Secondly, your v2s parameter setting is problematic. For v2s, the
isovalue input is meant to be between your discrete values. if you
have 0 and 1 values, the better isovalue to use is 0.5. yet you
used 1.

--
You received this message because you are subscribed to the Google Groups "iso2mesh-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iso2mesh-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iso2mesh-users/132218b8-13ff-41e3-bf1e-01b5e4a8913fn%40googlegroups.com.

increase your opt.distbound value will create a smoother surface. distbound is the distance deviates from the true voxelated boundary. the smaller the value, the more voxel-like the output mesh will be.
you can also increase opt.radbound, but because your domain is so
small, large radbound will give a very sparse mesh.
To view this discussion on the web visit https://groups.google.com/d/msgid/iso2mesh-users/06415cbd-95a5-4fb1-bcde-4fd5e8bb389en%40googlegroups.com.