#66: Stop execution if Pearson correlation is negative
This commit is contained in:
@@ -43,8 +43,12 @@ class Distance(Enum)
|
||||
def getEndUserName(self):
|
||||
return self.name.replace('_', '').title()
|
||||
|
||||
def getPearsonCorrelation(firstImage, secondImage):
|
||||
return abs(scipy.stats.pearsonr(firstImage.flatten(), secondImage.flatten()).statistic - 1)
|
||||
def getPearsonCorrelationDistance(firstImage, secondImage):
|
||||
pearsonCorrelation = scipy.stats.pearsonr(firstImage.flatten(), secondImage.flatten()).statistic
|
||||
if pearsonCorrelation < 0:
|
||||
print('Negative Pearson correlation, investigate further!')
|
||||
exit(1)
|
||||
return abs(pearsonCorrelation - 1)
|
||||
|
||||
# Source: https://stackoverflow.com/a/43346070
|
||||
def getGaussianKernel(size, sigma):
|
||||
|
||||
Reference in New Issue
Block a user