From 06b45e9a216aaa06f37922d108ed7472d91043eb Mon Sep 17 00:00:00 2001
From: schlda00 <kai.schleicher@unibas.ch>
Date: Wed, 16 Apr 2025 10:18:03 +0200
Subject: [PATCH] Adapt to new function

---
 2d_spots_in_fibers.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/2d_spots_in_fibers.py b/2d_spots_in_fibers.py
index f6ec4ba..0cca227 100644
--- a/2d_spots_in_fibers.py
+++ b/2d_spots_in_fibers.py
@@ -486,15 +486,15 @@ for index, channel in enumerate(processing_channels):
     dapi_positive_spots_binary = ImageCalculator.run(spots_binary_imp, dapi_binary, "Multiply create")
     dapi_negative_spots_binary = ImageCalculator.run(spots_binary_imp, dapi_positive_spots_binary, "Subtract create")
 
-    n_spots_per_fiber = measure_intensity_sum(fibers_label_imp, spots_binary_imp)
-    n_dapi_positive_spots_per_fiber = measure_intensity_sum(fibers_label_imp, dapi_positive_spots_binary)
-    n_dapi_negative_spots_per_fiber = measure_intensity_sum(fibers_label_imp, dapi_negative_spots_binary)
+    fiber_label_IDs, n_spots_per_fiber = measure_intensity_sum(fibers_label_imp, spots_binary_imp)
+    _, n_dapi_positive_spots_per_fiber = measure_intensity_sum(fibers_label_imp, dapi_positive_spots_binary)
+    _, n_dapi_negative_spots_per_fiber = measure_intensity_sum(fibers_label_imp, dapi_negative_spots_binary)
 
     # TODO: the column fiber label ID needs to be added only one time. Maybe check before if column exists.
-    add_results_to_resultstable(results_table, "fiber label ID", n_spots_per_fiber[0])
-    add_results_to_resultstable(results_table, "n spots channel " + str(channel), n_spots_per_fiber[1])
-    add_results_to_resultstable(results_table, "n spots dapi positive channel " + str(channel), n_dapi_positive_spots_per_fiber[1])
-    add_results_to_resultstable(results_table, "n spots dapi negative channel " + str(channel), n_dapi_negative_spots_per_fiber[1])
+    add_results_to_resultstable(results_table, "fiber label ID", fiber_label_IDs)
+    add_results_to_resultstable(results_table, "n spots channel " + str(channel), n_spots_per_fiber)
+    add_results_to_resultstable(results_table, "n spots dapi positive channel " + str(channel), n_dapi_positive_spots_per_fiber)
+    add_results_to_resultstable(results_table, "n spots dapi negative channel " + str(channel), n_dapi_negative_spots_per_fiber)
     close_images([spots_channel, spots_label_imp, spots_binary_imp, spots_binary_imp, dapi_binary, dapi_positive_spots_binary, dapi_negative_spots_binary])
 
 results_table.show("Spots")
-- 
GitLab