

Hello,
I am trying to use iso2mesh to develop a 3d mesh of a segmented and labelled MRI of the spinal cord that I have. The MRI data is in the format of .nii.gz. I'm pretty new at using iso2mesh and haven't found anything related to spinal cord segmentation in this group and hoping to get some guidance on how to go on about achieving my goal. Below is the display of the MRI with spinal cord segmented and labelled.
hi Mohammed,
have you tried calling v2m for your data? if you dwnload the latest version of iso2mesh from github, you can load your data using loadnifti.m, and then get a mesh using v2m, something like
data=loadnifti('myfile.nii.gz');
[node,elem]=v2m(uint8(data),[],20,300,'cgalmesh');
plotmesh(node,elem);
Qianqian
Any help is appreciated. Thank you!
--
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/d5c16cbb-4286-4802-8e64-ee6323d71fe1%40googlegroups.com.

hi Mohammed
to use the cgalsurf option, you must give a non-empty level input (i.e. the 2nd input) in v2m, and preferably a single value. it won't work if the level is [].
just a side note - iso2mesh is not a segmentation tool, you are supposed to segment your data first before calling v2m to create meshes.
Qianqian
To view this discussion on the web visit https://groups.google.com/d/msgid/iso2mesh-users/CAC8_q%3DTHVHH8bG7oPhQD4hT2JdqD_XmmiktSTSfHvSqWxCn9dw%40mail.gmail.com.
Hello Qianqian,
I did my segmentation with a library called SCT (spinal cord toolbox). But the segmentation isn't done on the original MRI, instead the segmentation and its labels are stored separately and overlayed on each when displaying.
How would I go on about extracting the segmented parts of my mesh with this setup? Or would I need the segmentation done on the original MRI.
if you call v2m using the 'cgalmesh' option, the output element labels are supposed to match the voxel labels in the input.
checkout this sample code
https://github.com/fangq/iso2mesh/blob/master/sample/demo_label_sizing.m#L28
in this case, the input domain has 4 labels, to extract the elements of the first label, you simply use the last column of the el matrix to select. for example
plotmesh(no(:,1:3),el(el(:,end)==1,:));
gives you the region of the first label, and so on.
Qianqian