Skip to content
Snippets Groups Projects
Commit 0bf83759 authored by Laurent Guerard's avatar Laurent Guerard
Browse files

Add method for measuring mean intensity in all fibers

parent c4deda24
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment