Hi Mark,
Thanks for your fast answer.
Your code almost works, but not all holes will be closed. I have tried some
additional filtering, based on the following idea:
The holes are somthing like "salt and pepper noise". In our case pepper ->
black dots ;-). So a median filtering do the job.
This leads to the attempt of closing the holes only with median filtering,
without using cluster. After testing, it looks more stable and adjustable
than using cluster detection. Changing kernel size and filtering twice with
fmedian depending on the hole size is the solution.
for masks with small holes (a few voxels):
fslmaths mask -kernel box 3 -fmedian filledmask
for masks with lager holes
fslmaths mask -kernel box 5 -fmedian -fmedian filledmask
... or maybe your personal selection.
The very small increase of some parts of the mask should be negligible.
In my case the happy medium almost works
fslmaths mask -kernel box 5 -fmedian filledmask
Best regards
Joerg
P.S, Don't worry: we start our tests yesterday not in the last year.
|