hi Rajath,
iso2mesh has multiple options to mesh a binary volume with the background included.
first, you can simply run v2m/vol2mesh with the cgalmesh and set background to 1 and inclusions to 2, by
[node,elem]=v2m(uint8((binimg==255)+1), [], 10,100,'cgamesh');
this will give you both background and inclusions, and label them accordingly (1 for background, 2 for inclusions).
the downside of the cgalmesh path is that the bounding box will not be perfectly flat.
if you want to have a clean bounding box, what you can do is to
1. extract your particle surfaces via [noobj, fcobj]=v2s(binimg==255, ...)
2. create a bounding box mesh, just slightly smaller than the original volume, by calling [nobox,fcbox]=meshabox(...)
3. reorient both surfaces before boolean: [noobj,fcobj]=surfreorient(noobj,fcobj); [nobox,fcbox]=surfreorient(...)
4. call surfboolean to get a combined mesh: [no,fc]=surfboolean(nobox, fcbox, 'first', noobj, fcobj);
5. call surf2mesh to create the final tetrahedral mesh.
it takes more steps, but the overall mesh quality will be much better. see some pervious examples from this link
https://groups.google.com/g/iso2mesh-users/search?q=surfboolean%20meshasphere
https://groups.google.com/g/iso2mesh-users/search?q=surfboolean%20meshacylinder
Qianqian
Thank you very much,Rajath
--
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/ee1932e0-52b7-49f1-bc1f-182cd0a4e1ffn%40googlegroups.com.
Hi Rajath,
Perhaps I misunderstood. I thought when you referred your 0-valued region as “polymer”, the union of the zero-valued polymer and the non-zero-valued particle would make the entire volume, which has a boundary of the bounding box.
Are you saying your polymer may not be the complement space of your particles? Then what is polymer’s boundary?
By the way, the link to your CT reconstruction is broken and I can not open it.
Qianqian
To view this discussion on the web visit https://groups.google.com/d/msgid/iso2mesh-users/b49b986d-81f6-4478-a9ff-8bcb21d3baf3n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iso2mesh-users/MN2PR06MB540705DECC8F3E2B1B00D1A9E4030%40MN2PR06MB5407.namprd06.prod.outlook.com.
> I am left with a 0 grey value for polymer, 1 (or 255) for the particles and also 0 for the non-material or background region (that is everything outside the yellow boundary).
Hi Rajath,
If you want to create meshes for both polymer and particles, you will have to separate them from the background. That means, you should assign polymer and particles with different non-zero labels. For example: 0- background, 1-polymer and 2-particles. Is this possible?
Once you do so, you can then call v2m(uint8(myvolume),[],…,’cgalmesh’) to mesh this multi-labeled volume.
Qianqian
To view this discussion on the web visit https://groups.google.com/d/msgid/iso2mesh-users/CAB3EwGz1tFoPxfstd6wzDQ3iEsP1oM%3DRrxa_SbhjrQxLt3y1YA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iso2mesh-users/MN2PR06MB54079CF09038CFB03551CE4FE4030%40MN2PR06MB5407.namprd06.prod.outlook.com.
Dr. Fang,
That's what I thought too. I don't know of a relatively fast way of assigning a material boundary for just the particle and polymer regions. It can be done manually by selecting polygonal regions based on the cross-section images. Thanks for your suggestions and I will work on this.
hi Rajath,
not entirely sure I understood the question - if you have previously segmented the particle and polymer regions separately, then calling v2s/v2m separately, or merge the segmentation then call v2m, will be able to produce separate labels for the two materials.
or, are you trying to use iso2mesh as a segmentation tool?
On a separate note, is there a way to label different boundaries or surfaces once it is meshed? I think that is important when the mesh is exported to, say, COMSOL and boundary conditions are required to be assigned. Specifically, using iso2mesh functionality, can I identify the following regions?
yes, please run the built-in sample script iso2mesh/sample/demo_directplc_ex1.m
then try plotting the generated surfaces via
plotmesh(node,face,'x>0');
unique(face(:,end))
unique(elem(:,end))
see screenshot in the attachment:
the left panel shows the input surface to surf2mesh - each piece of the surface is labeled with unique number. The middle panel shows the output surface mesh (node,face), and each surface also contains a unique label that matches its origin in the input
surface; the right panel shows the output tetrahedral mesh, which contains volumetric labels that matches the regions input.
you can separate the output surface triangles by pre-label its input surface, as shown by the first and 2nd panels. You can also separate the output region surfaces using the labels of the volumetric mesh (node,elem) by calling volface(), for example,
surf1=volface(elem(elem(:,5)==0),:);
surf2=volface(elem(elem(:,5)==1),:);
surfboth=volface(elem(elem(:,5)>=0),:);
extracts the exterior surfaces of the tetrahedral mesh region labeled as 0, 1 or either.
let me know if this answers your question.
Qianqian
To view this discussion on the web visit https://groups.google.com/d/msgid/iso2mesh-users/CAB3EwGxut7AnB-B7pn9JQ%3DNDuDne_HNwuupJaMeVTo1pU1Dt8A%40mail.gmail.com.