Modified Omar's code to find connected compnents in DotSpatial rasters