Modify Mask File

39 views
Skip to first unread message

Grace Guo

unread,
Jun 28, 2023, 4:49:31 AM6/28/23
to roast-users
Hi Roast users,

I have a question regarding post-processing segmented mask file (i.e. after classified into 6 tissue types). I just noticed that in meshByIsoMesh.m, load_untouch_nii was used, instead of load_nii. I'm not familiar with the geometric transformation, but I simply want to change the conductivity of some voxels in my scan. In that case, is it correct that I identify the voxel coordinates of my ROI by visualizing the mask file in MRIcro, and then modify the corresponding value in what is loaded by load_untouch_nii? I'm not sure if there's any geometric transformation I may mess up by doing this. I'd really appreciate your help!

Best,
Grace

Yu (Andy) Huang

unread,
Jun 30, 2023, 3:20:21 PM6/30/23
to Grace Guo, roast-users
Hi Grace,

You can change conductivity for a specific tissue using the "conductivities" option. If you meant to change the conductivity for some voxels, you need to label those voxels as a new mask, and you have to change a lot of code in roast, as the 6 tissue masks are hard coded. Yes you can identify the voxel coordinates using MRIcro, but note that the masks are in model voxel space, which may be different from the original voxel space, if the MRI is not in RAS, or you turned on resampling or zeropadding.

Hope this helps.

--
You received this message because you are subscribed to the Google Groups "roast-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to roast-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/roast-users/f9debcd2-58d4-4750-86ff-e66a53a8a2e8n%40googlegroups.com.

Grace Guo

unread,
Jul 1, 2023, 11:47:07 AM7/1/23
to roast-users
Hi Dr. Huang,

Thank you so much for your reply and this is very helpful!

Just to make sure that I understand what you said correctly. If I need to specify a new tissue type, then I'd need to create another mask and change a bunch of code. But if I simply want to change the conductivity value of a voxel to another existing type (i.e. white, gray matter, CSF, bone, skin, air), I can do so by modifying the corresponding entry in the 'allMask' variable.

Thanks!
Grace

Yu (Andy) Huang

unread,
Jul 2, 2023, 10:08:51 AM7/2/23
to Grace Guo, roast-users
But if I simply want to change the conductivity value of a voxel to another existing type (i.e. white, gray matter, CSF, bone, skin, air), I can do so by modifying the corresponding entry in the 'allMask' variable.
 
I don't think that's enough. You need to tell the solver getDP that some of the voxels in that tissue mask have a different conductivity value, so you need to edit the .pro file to pass the info to getDP, and these voxels will have to be labeled as a new mask so that the mesher will give it a different label during mesh. 

Another option is to specify inhomogenous conductivities for the same mask in getDP (so that you do not need to create a new mask). You'll need to read getDP documentation to see if this is possible.

Hope this helps.

Grace Guo

unread,
Jul 2, 2023, 11:30:59 AM7/2/23
to roast-users
Hi Dr.Huang,

Thank you for answering my questions! And I apologize for not being familiar with the details of this issue. Basically, my problem is that the SPM auto-segmentation incorrectly labels some of the voxels (e.g. mistaken bone as air). Therefore, I want to manually modify the segmented results, which I believe is similar to what segTouchUp does. Since I noticed that segTouchUp modifies allMask, I thought it was sufficient (in my case) to find the corresponding coordinates and change it from "air" to "bone" value. After that, meshing and solveGetDP can work on this modified mask. Since I'm not creating any new types of tissues, I think it's not necessary to create a new mask? Please let me know if I miss any details as I'm confused by this part. And sorry if I didn't explain my issue clearly before. 

Thank you so much for your help:) 

Best,
Grace

Yu (Andy) Huang

unread,
Jul 3, 2023, 10:55:45 AM7/3/23
to Grace Guo, roast-users
No worries. So you just wanted to correct the segmentation. You can do it in the way you described, you can also use an interactive software to manually correct the segmentation (e.g. using 3D slicer). Then you just need to import the modified masks back to roast to continue on meshing and solving.
Reply all
Reply to author
Forward
0 new messages