@decorator_util.jit()<EOL>def border_pixels_from_mask(mask):
edge_pixels = edge_pixels_from_mask(mask)<EOL>masked_grid_index_to_pixel = masked_grid_1d_index_to_2d_pixel_index_from_mask(mask)<EOL>border_pixel_total = total_border_pixels_from_mask_and_edge_pixels(mask, edge_pixels, masked_grid_index_to_pixel)<EOL>border_pixels = np.zeros(border_pixel_total)<EOL>border_pixel_index = <NUM_LIT:0><EOL>for edge_pixel_index in range(edge_pixels.shape[<NUM_LIT:0>]):<EOL><INDENT>if check_if_border_pixel(mask, edge_pixels[edge_pixel_index], masked_grid_index_to_pixel):<EOL><INDENT>border_pixels[border_pixel_index] = edge_pixels[edge_pixel_index]<EOL>border_pixel_index += <NUM_LIT:1><EOL><DEDENT><DEDENT>return border_pixels<EOL>
Compute a 1D array listing all borders pixel indexes in the masks. A borders pixel is a pixel which:

     1) is not fully surrounding by False masks values.
     2) Can reach the edge of the array without hitting a masked pixel in one of four directions (upwards, downwards,
     left, right).

     The borders pixels are thus pixels which are on the exterior edge of the masks. For example, the inner ring of edge \
     pixels in an annular masks are edge pixels but not borders pixels.