Closed GostInShell closed 3 years ago
Hi @GostInShell, the cython code doesn't provide the index as of now, however, you can use GeodesicAlgorithmExact::best_source
method to obtain the index.
If you want to obtain the values from the cython code, first change compute_gdist_impl
method here:
https://github.com/the-virtual-brain/tvb-gdist/blob/943c0e019e921b8d8181e076fc009d50b54738b1/geodesic_library/geodesic_utils.h#L5
https://github.com/the-virtual-brain/tvb-gdist/blob/943c0e019e921b8d8181e076fc009d50b54738b1/geodesic_library/geodesic_utils.h#L33-L35
Then, update the compute_gdist
method here:
https://github.com/the-virtual-brain/tvb-gdist/blob/943c0e019e921b8d8181e076fc009d50b54738b1/gdist.pyx#L119
Make sure to update the method signature as well: https://github.com/the-virtual-brain/tvb-gdist/blob/943c0e019e921b8d8181e076fc009d50b54738b1/gdist.pyx#L82-L83
Hi, @ayan-b! Thank U so much for the detailed reply! Feeling condifent to implement this by following your instructions!
If I get this right, when more than one
source_indices
are given, the functioncompute_gdist()
will return the distance of atarget
to the closest source. Can the functioncompute_gdist()
also return the index of the closestsource
? Are there any interfaces in the orignal C++ code?