Skip to content
Snippets Groups Projects
Commit 0aa2cff7 authored by Tamino Huxohl's avatar Tamino Huxohl
Browse files

add axis label to eval perfusion and compute correlation coeffiecient

parent b816d3ac
No related branches found
No related tags found
No related merge requests found
......@@ -165,6 +165,7 @@ def plot_corellation(
if __name__ == "__main__":
import argparse
from scipy.stats import pearsonr
parser = argparse.ArgumentParser(
description="Create visualizations to compare the perfusion of different polar maps",
......@@ -208,7 +209,6 @@ if __name__ == "__main__":
perfusion_dlac = perfusion_dlac[keys_segments].values
perfusion_noac = perfusion_noac[keys_segments].values
print(f"APE:")
fig, axs = plt.subplots(1, 2, figsize=(10, 4.5))
for i, (perfusion, title) in enumerate(
[(perfusion_dlac, "DLAC"), (perfusion_noac, "No AC")]
......@@ -216,6 +216,9 @@ if __name__ == "__main__":
if args.plot == "bland_altman":
bland_altman(perfusion, perfusion_ctac, ax=axs[i])
axs[i].set_title(title)
axs[i].set_xlabel("Mean Perfusion Score")
if i == 0:
axs[i].set_ylabel("Difference in Perfusion Score")
else:
v_min = min(
perfusion_ctac.min(), perfusion_dlac.min(), perfusion_noac.min()
......@@ -232,7 +235,10 @@ if __name__ == "__main__":
axs[i].set_ylabel("CTAC")
_ape = absolute_percent_error(perfusion, perfusion_ctac)
print(f" - {title:>6}: {_ape.mean():.5f}±{_ape.std():.5f}")
r, p_value = pearsonr(perfusion.flatten(), perfusion_ctac.flatten())
print(f"{title:>6}")
print(f" - APE: {_ape.mean():.5f}±{_ape.std():.5f}")
print(f" - Correlation: R={r:.5f}, (p={p_value:.5f})")
same_limits(axs)
plt.tight_layout()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment