ChatGPT vs me: write the code to get neighbour labels in a labelled Nd image. My solution Chat bot explanation can very well be used to write an explanation on top of the function, but it should not have said 2d as it is written for Nd but that's ok.