Hi Dr. Fang,
I wanted to ask if you had any more insight on why I get the error with the opt specifications. Am I doing something wrong with specifying both opt sets when using cgal2surf?
Thanks!-Daniel
On Friday, July 16, 2021 at 3:21:57 PM UTC-4 Daniel Marshall wrote:
Hi Dr. Fang,
Thank you for your reply!
For the struct based opt, the input that is problematic is the linear transformation input. From the vol2surf documentation:opt(1,2,..).{A,B}: linear transformation for each surface
My interpretation is that the input should be as follows:opt(1).A=diag([1 1 5]);opt(2).A=diag([1 1 5]);opt(1).B=diag([0 0 0]);opt(2).B=diag([0 0 0]);This results in an error, is my syntax wrong?
opt.B is supposed to be a 1x3 or 3x1 vector, not a diag matrix
https://github.com/fangq/iso2mesh/blob/master/vol2surf.m#L195
I do want to create mesh eventually, I was using vol2surf in order to create a 2 region surface, which I then wanted to remesh and then mesh into a volumetric mesh.i.e. vol2surf>remeshsurf>surf2meshThe problem is my second region (which is interior to the first) disappears during the remesh operation
if the surface of your 2nd region does not intersect with the outer surface, you can directly combine them using mergemesh; if they do intersect, you can merge them use surfboolean or mergesurf. I don't see a need to use remeshsurf.
remeshsurf is a computationally expensive step to fix invalid mesh that usually can't be fixed by meshcheckrepair('meshfix'). It works by rasterizing the surfaces into a voxelated domain, then call cgalsurf to re-extract the surface. unfortunately it can only handle a single region at a time.
if yo have to do this - you can call surf2vol for each of the surface component to produce rasterized volumes over the same grid, and then adding/combing them together to form a multi-label volume, then call v2m('cgalmesh') to do the final mesh generation
(or v2s('cgalmesh')->s2m('tetgen1.5')).
Is there a way to have the output of mergesurf retain region id's? According to the documentation the output should be
% newnode: the node coordinates after merging, dimension (nn,3)
% newelem: tetrahedral element or surfaces after merging (nn,4) or (nhn,5)
but my newelem output is only (nn,3) dimensions, with no region id.
again, if the regions (surface/tet) are not overlapping, mergemesh should retain the label, if not, please send me an example
--
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/70984ca9-7b90-4fbe-b0c4-2afca0a2e1e4n%40googlegroups.com.
Hi Dr. Fang,
Thank you for the advice, I understand what I was doing wrong now! I did have one more question, I managed to get a mesh for my 2 regions with vol2mesh using:opt=struct('radbound',3,'A',diag([1 1 5]), 'B', [0 0 0]);
butopt=struct('radbound',5,'A',diag([1 1 5]), 'B', [0 0 0]);
hi Daniel,
the v2m call with 'cgalsurf' (default) method only works well for a single closed surface.
for multiple surfaces/levelsets, they have to be well separated (can be one-enclosing another, but there must be enough gap between them).
the error below simply shows that your extracted multiple-shell surfaces are self-intersecting (inner/outer surfaces are in contact)
if you know that the two surfaces are supposed to be touching each other, the best way to deal with this is to use
v2s->surface decoupling or boolean ->s2m
or
volume dilation -> v2m
see the example of the 2nd path here
https://github.com/fangq/Colin27BrainMesh/blob/master/colinsmesh_v2.m#L70-L73
where the thickenbinvol grows the inner volume by specified voxels and ensures that the outer layer is well separated with the inner mask.
I often choose the 1st path, the decoupling can be done via surfboolean('decouple').
Qianqian
To view this discussion on the web visit https://groups.google.com/d/msgid/iso2mesh-users/8790cb79-53bf-43a9-9eeb-c9bf34af9998n%40googlegroups.com.
Hi Dr. Fang,
I am back with another question which I hope will be a simple fix. I am getting the below error when using bwislands on a 3d volumetric image, but I do not receive the error when passing a 2d image.
should be fixed with this patch, give it a try
https://github.com/fangq/iso2mesh/commit/8c35d0d707f5c01b86087d4a657efd3a02f4ff39
To view this discussion on the web visit https://groups.google.com/d/msgid/iso2mesh-users/3b7f168f-4230-4cd1-bb17-d381ef1483d5n%40googlegroups.com.
I am also sometimes getting this error when trying to construct a mesh:
tetgen usually gives this error when the input has self-intersection or invalid surface input (with open-edge etc).
please double check, otherwise, upload the surface input
somewhere and I am happy to take a look
To view this discussion on the web visit https://groups.google.com/d/msgid/iso2mesh-users/a8c9fa23-8cb9-4445-9cf2-e2c9e760d4afn%40googlegroups.com.
Hi Dr. Fang,
I checked the volumes and they seem ok to the best of my knowledge. Is there an email or other channel I can send the file to you privately?
you can upload it to a file sharing site, like google drive or dropbox, and send me a direct link; if you don't have access to those, you can also try file.io:
https://file.io/
To view this discussion on the web visit https://groups.google.com/d/msgid/iso2mesh-users/ab5fe1b2-12c5-4b7e-9e8c-dcd5734db80cn%40googlegroups.com.