greetings
today I saw on a post on StackOverflow this function for calculating SNR or signal to noise ratio from an input image.
the function code :
def signaltonoise(a, axis=0, ddof=0):
a = np.asanyarray(a)
m = a.mean(axis)
sd = a.std(axis=axis, ddof=ddof)
return np.where(sd == 0, 0, m/sd)
my question is does this SNR function could work for calculating SNR in medical images.