Clean up segmentations

Although prior information is used to restrict segmentation to the cortex there are still some misclassifications mainly at the border between gray matter and CSF. These rims can be tried to remove using morphological operations. Conditional dilations and erosions based on gray and white matter segmentations are used to create a mask to clean up the segmentations. It begins by taking the white matter, and eroding it a couple of times to get rid of any odd voxels. The algorithm continues on to do conditional dilations for several iterations, where the condition is based upon gray or white matter being present. This identified region is then used to clean up the grey and white matter partitions, and has a slight influences on the CSF partition.


cleanup
Overview of the clean up procedure to remove non-connected non-brain voxels from the segmentations. In the initial segmented image a small rim around the cortex is still present. Using conditional dilations and erosions we can create a clean up mask to remove these non-connected parts from the segmented images.