locpix.visualise.vis_img.label_2_4_colours#

label_2_4_colours(labels: ndarray)[source]#

This takes in an array of labels e.g. [5,0,2,2,17,1,…] and returns a list where each label is now in range 0-3 such that no 2 integers next to each other are the same. This can be used for to plot so no 2 colours next to each other are the same

Parameters:
  • labels (np.ndarray) – Array of ints

  • label (each representing a unique) –

Returns:

Array of ints each representing a unique label (between 0 and 3) no 2 of same label should be next to each other