Bad head mask reconstruction and error messages when adjusting erode or fill hole factor

Hi brainstorm expert,

When I generate head surface from some infants T1w images, some of them had bad distorted head mask. I tried to adjust the erode and fill hole factor, but I got this error messages:

It doesn't always happen depending on the number I put in for erode factor, or fill hole factor, or a combination of erode and fill hole factors. Below is the screen shot of one of the combination I tried. Please advise if the numbers I entered make no sense therefore causing the error message, or how to fix it. Thank you!

p.s. When I looked at the contrast and the image of the MRI it looks good across slices when I quickly glance through.

Best, Yuhan

I have never encountered this error, and I'm not sure I understand where it comes from from the error message. I would need to reproduce the error on my computer to be able to fix it.

Could you please share an example MRI file (via private message), together with the parameters you used to reproduce this error?

Thanks

Thank you for the example file.
I could add some tests to fix the bug that you reported: https://github.com/brainstorm-tools/brainstorm3/commit/184e8cb656692cd6a743d6bd370901939bd600a4

However, this is not going to fix your problem. What you tried to do is to increase the amount of scrubbing during the computation of the head surface, while there was already too much volume removed.

The main problem resides in the last of the parameters. The estimation of the background threshold is almost among the highest values in your MRI. Explore the volume by moving the cursor and check the values at the top-right corner of the MRI viewer.
This MRI was already pre-processed: the background was already removed, and set to 0. In this case, the MRI histogram evaluation fails, and you need to redefine manually the background thresghold to 1, as described in the FreeSurfer tutorial:
https://neuroimage.usc.edu/brainstorm/Tutorials/LabelFreeSurfer#The_head_surface_looks_bad

image

image

Hi Francois!

Yes adjusting the threshold works for most of those cases. Thank you!

Best, Yuhan