From 0bf837592e26e9c58ceacc0d4c50565a07f81966 Mon Sep 17 00:00:00 2001
From: Laurent Guerard <laurent.guerard@unibas.ch>
Date: Tue, 29 Apr 2025 14:52:58 +0200
Subject: [PATCH] Add method for measuring mean intensity in all fibers

---
 2c_fibertyping.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/2c_fibertyping.py b/2c_fibertyping.py
index d57919d..8b68e71 100644
--- a/2c_fibertyping.py
+++ b/2c_fibertyping.py
@@ -114,20 +114,21 @@ def measure_mean_of_rois(imp, channel, rm):
         The channel on which to measure. starts at 1.
     rm : ij.plugin.frame.RoiManager
         A reference of the IJ-RoiManager.
-    min_intensity : int
-        The selection criterion (here: intensity threshold).
 
     Returns
     -------
-    list
-        A selection of ROIs which passed the selection criterion (are above the threshold).
+    list of float
+        A list of mean intensity values for each ROI in the specified channel.
     """
     imp.setC(channel)
     all_rois = rm.getRoisAsArray()
+    mean_intensities = []
     for i, roi in enumerate(all_rois):
         imp.setRoi(roi)
         stats = imp.getStatistics()
+        mean_intensities.append(stats.mean)
 
+    return mean_intensities
 
 
 
-- 
GitLab