Nice work ! I used this function as an alternative to bwlabel. The only required modification in my code was to take into account the syntax difference : label puts 0 binary values into a connected object. As per the author's 'Important remark', zeros should be replaced by NaNs in this use case.
Hi everyone. I found out how to freeze the colorbar as well. Actually, I got my answer from the test_main.m file of this submission. You should download cbfreeze.m and cbhandle.m (by Carlos Adrian Vargas Aguilera) and freeze your colorbar with these functions. Just make sure to download cbhandle.m as well or MATLAB will give you some handle errors.