From 88e065fda0767cdadaf6fc4458d5bdcc9dcf7f5a Mon Sep 17 00:00:00 2001 From: 2wenty1ne Date: Sun, 3 Nov 2024 18:57:11 +0100 Subject: [PATCH] Much faster np approach --- main.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/main.py b/main.py index f6a3c09..a25a535 100644 --- a/main.py +++ b/main.py @@ -43,12 +43,8 @@ plt.show() plt.clf() # Alle Helligkeitswerte der Lunge seperieren -lungBrightness = [] lungsArray1D = lungsArray.flatten() - -for (ind, elem) in enumerate(lungsArray1D): - if elem > 0: - lungBrightness.append(thoraxArray1D[ind]) +lungBrightness = thoraxArray1D[lungsArray1D > 0] # Histogram aller Helligkeitswerte in der Lunge plt.hist(lungBrightness, bins=100)