Algorithm 5.
Synthetic Brainbow (colorization of a grayscale volume with size constraint)
| Define S the scalar volume of original data; |
| Define ID the ID volume generated by Algorithm 3; |
| Define B a Boolean volume whose voxels represent if they are in a component with size over a threshold; |
| For each cell in ID |
| M = the measure of features in S; |
| N = a sample from a 4D noise function; |
| If M > N and !B |
| The cell’s ID is replaced by the maximum ID within its neighborhood; |