Fragmentation F is defined as one minus the combined area of the receptive field fragments divided by the area of their convex hull.
F = receptiveFieldFragmentation(M,THOLD,SHOW)
M is a pixel map containing the receptive field (fragments), THOLD a threshold intensity above which a pixel is counted as part of the receptive field.
Use optional Boolean argument SHOW to visualize the result as an image where blue is the background, teal the convex hull, and yellow the receptive field (default: false).
receptiveFieldFragmentation without any arguments shows a demo.
[~,BW,CH] = receptiveFieldFragmentation(__) returns the thresholded M (BW) and convex hull (CH) bit-maps.
Duijnhouwer (2020). receptiveFieldFragmentation(M,thold,show) (https://www.mathworks.com/matlabcentral/fileexchange/67552-receptivefieldfragmentation-m-thold-show), MATLAB Central File Exchange. Retrieved .
removed a line that displayed debugging info on the command line