Skip to content

Commit 4f26f83

Browse files
authored
Merge pull request #123 from rohangirishrao/remove-objects-method
Remove method `objects3d.get_objects_within_intensity`
2 parents 5b44665 + 7cbcc19 commit 4f26f83

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

src/imcflibs/imagej/objects3d.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -117,40 +117,6 @@ def segment_3d_image(imp, title=None, min_thresh=1, min_vol=None, max_vol=None):
117117
return seg.getImagePlus()
118118

119119

120-
def get_objects_within_intensity(obj_pop, imp, min_intensity, max_intensity):
121-
"""Filter a population for objects within the given intensity range.
122-
123-
Parameters
124-
----------
125-
obj_pop : mcib3d.geom.Objects3DPopulation
126-
A population of 3D objects.
127-
imp : ij.ImagePlus
128-
An ImagePlus on which the population is based.
129-
min_intensity : float
130-
Minimum mean intensity threshold for filtering objects.
131-
max_intensity : float
132-
Maximum mean intensity threshold for filtering objects.
133-
134-
Returns
135-
-------
136-
Objects3DPopulation
137-
New population with the objects filtered by intensity.
138-
"""
139-
objects_within_intensity = []
140-
141-
# Iterate over all objects in the population
142-
for i in range(0, obj_pop.getNbObjects()):
143-
obj = obj_pop.getObject(i)
144-
# Calculate the mean intensity of the object
145-
mean_intensity = obj.getPixMeanValue(ImageHandler.wrap(imp))
146-
# Check if the object is within the specified intensity range
147-
if mean_intensity >= min_intensity and mean_intensity < max_intensity:
148-
objects_within_intensity.append(obj)
149-
150-
# Return the new population with the filtered objects
151-
return Objects3DPopulation(objects_within_intensity)
152-
153-
154120
def maxima_finder_3d(imp, min_threshold=0, noise=100, rxy=1.5, rz=1.5):
155121
"""Find local maxima in a 3D image.
156122

0 commit comments

Comments
 (0)