Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions openhcs/processing/backends/cellprofiler/intensity.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def active_artifact_bindings(
ShapeMeasurementBackendStrategy,
)
from openhcs.processing.backends.cellprofiler.label_geometry import (
_numpy124_aquicksort_indices,
_numpy124_ordered_label_maximum_indices,
)
from openhcs.interop.cellprofiler.settings_binder import coerce_cellprofiler_enum
from openhcs.processing.backends.lib_registry.unified_registry import ProcessingContract
Expand Down Expand Up @@ -1119,9 +1119,15 @@ def maximum_intensity_positions_batch(
+ x_indices
)
flat_images = image_batch.reshape((image_batch.shape[0], -1))
requested_indexes = np.arange(labels.object_count, dtype=np.int64)
positions: list[tuple[np.ndarray, ...]] = []
for flat_image in flat_images:
order = _numpy124_aquicksort_indices(flat_image[source_positions])
order = _numpy124_ordered_label_maximum_indices(
flat_image[source_positions],
foreground_index.object_indexes,
requested_indexes,
labels.object_count - 1,
)
maximum_positions = np.zeros(labels.object_count, dtype=np.int64)
maximum_positions[foreground_index.object_indexes[order]] = (
source_positions[order]
Expand Down
Loading