Hi, I have some issue understanding your code.
I saw you use the scipy.morphology transform_distance_edt to calculate the nearest distance
but where do you calculate the second nearest one ? since the weights will depending on the second nearest and the first nearest distance, if I understand it correctly.
In the code, the second nearest one is directly taken from the distance matrix dim 1 by calling

Could anyone help me out with this? Thanks in advance
Hi, I have some issue understanding your code.
I saw you use the scipy.morphology transform_distance_edt to calculate the nearest distance
but where do you calculate the second nearest one ? since the weights will depending on the second nearest and the first nearest distance, if I understand it correctly.
In the code, the second nearest one is directly taken from the distance matrix dim 1 by calling

Could anyone help me out with this? Thanks in advance