baby.preprocessing.SegmentationFlattening¶
- class baby.preprocessing.SegmentationFlattening(filename=None)¶
Bases:
object
Methods
__call__
(filled_stack, info)Call self as a function.
addGroup
(name[, lower, upper, budonly, focus])Add a new cell group to this flattener
addTarget
(name, group, prop[, nerode, ...])Add a new prediction target to this flattener
format_focus_assignment
getGroupTargets
getTargetDef
load
names
save
- __init__(filename=None)¶
Methods
__init__
([filename])addGroup
(name[, lower, upper, budonly, focus])Add a new cell group to this flattener
addTarget
(name, group, prop[, nerode, ...])Add a new prediction target to this flattener
format_focus_assignment
(areas, focusNums, ...)getGroupTargets
(group[, propfilter])getTargetDef
(name)load
(filename)names
()save
(filename)- addGroup(name, lower=1, upper=inf, budonly=False, focus=None)¶
Add a new cell group to this flattener
- Parameters
name – a unique name to identify this group
lower – the lower size threshold (in pixels) of cells to include in this group
upper – the upper size threshold (in pixels) of cells to include in this group
budonly – whether to limit this group to cells annotated as buds
focus – a float specifying the focal plane that this group should correspond to. Cells with a focus annotation will be allocated to the group with the closest focal match.
- addTarget(name, group, prop, nerode=0, ndilate=0, focusStacks=[])¶
Add a new prediction target to this flattener
- Parameters
name – a unique name to identify this target
group – the name identifying the cell group from which this target should be generated
prop –
the type of mask that should be generated for this target. Valid values are currently: - ‘filled’: True for all edge and interior pixels in the specified
group, False otherwise;
’edge’: True for all edge pixels of cells in the specified group, False otherwise;
’overlap’: True for all pixels corresponding to at least two cells in the specified group, False otherwise;
’interior’: True for all pixels
’filledsum’: The integer number of cells present at each pixel;
’budneck’: For all cells in this group, if a mother has been annotated, then set to True those pixels where the daughter overlaps with a dilated version of its mother
nerode – the number of erosions that should be applied for generation of this target.
ndilate – the number of dilations that should be applied for generation of this target.
focusStacks – a list of floats specifying focal planes. If non-empty, this is shorthand for creating a new group for each of the specified focal planes (copying the properties of the specified cell group) and creating a corresponding target.