Skip to content
Snippets Groups Projects
Commit 63dd5c5b authored by Alán Muñoz's avatar Alán Muñoz
Browse files

refactor( fun/dist ):change trap_apply distributor

parent cde198c5
No related branches found
No related tags found
No related merge requests found
import numpy as np
def trap_apply(cell_fun, cell_masks, trap_image, **kwargs):
def trap_apply(cell_fun, cell_masks, *args, **kwargs):
"""
Apply a cell_function to a mask, trap_image pair
:param cell_fun: function to apply to a cell (from extraction/cell.py)
:param cell_masks: (numpy 3d array) cells' segmentation mask
:param trap_image: the image for the trap in which the cell is (all
:param trap_image: (Optional) the image for the trap in which the cell is (all
channels)
:**kwargs: parameters to pass if needed for custom functions
"""
cells_iter = (*range(cell_masks.shape[2]),)
return [
cell_fun(cell_masks[..., i], trap_image, **kwargs) for i in cells_iter
]
return [cell_fun(cell_masks[..., i], *args, **kwargs) for i in cells_iter]
def reduce_z(trap_image, fun):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment