cellmap_flow.norm.input_normalize

Attributes

logger

Classes

SerializableInterface

InputNormalizer

ChannelSelector

Dilate

EuclideanDistance

MinMaxNormalizer

LambdaNormalizer

ZScoreNormalizer

Functions

get_input_normalizers(→ list[dict])

deserialize_list(→ list)

Deserialize a list of processors from either dict or list format.

get_normalizations(→ list[InputNormalizer])

Get normalizations from either dict or list format.

Module Contents

cellmap_flow.norm.input_normalize.logger
class cellmap_flow.norm.input_normalize.SerializableInterface
classmethod name()
process(data, **kwargs) → numpy.ndarray
to_dict()

{"name": <class name>, **constructor arguments}.

Exactly what type(self)(**params) needs to rebuild this step. The public attributes are not that: constructors parse their arguments (a neighborhood string becomes a list, “0,1” becomes [0, 1]) and add state of their own, so feeding the attributes back in raised TypeError or built a different step.

Each argument is reported with its real type: when the constructor stored it under its own name as a plain number, bool or string, that stored value is used (0.5, not the “0.5” a form sent); anything it parsed into something else keeps the argument as given.

property dtype
output_info(dtype, channels)

(dtype, channels, is_segmentation) of what this step returns.

dtype and channels describe what it is given. By default the step’s declared dtype replaces the incoming one (None keeps it), a num_channels attribute (only steps that change the count have one) replaces the channel count, and is_segmentation is the step’s own, where None means it does not say. A step whose output depends on its input in some other way overrides this.

class cellmap_flow.norm.input_normalize.InputNormalizer
class cellmap_flow.norm.input_normalize.ChannelSelector(channel=0)
channel = 0
class cellmap_flow.norm.input_normalize.Dilate(size=1)
size = 1
class cellmap_flow.norm.input_normalize.EuclideanDistance(anisotropy=50, black_border=True, parallel=5, type='edt', activation='tanh')
type = 'edt'
anisotropy
parallel = 5
activation
property dtype
class cellmap_flow.norm.input_normalize.MinMaxNormalizer(min_value=0.0, max_value=255.0, invert=False)
min_value
max_value
property dtype
class cellmap_flow.norm.input_normalize.LambdaNormalizer(expression: str)
expression
property dtype
class cellmap_flow.norm.input_normalize.ZScoreNormalizer(mean=0.0, std=1.0)
mean
std
property dtype
cellmap_flow.norm.input_normalize.get_input_normalizers() → list[dict]
cellmap_flow.norm.input_normalize.deserialize_list(elms, T: type) → list

Deserialize a list of processors from either dict or list format.

Parameters:
  • elms – Either a dict (old format) or list (new ordered format) of processor configs

  • T – The base type to deserialize (InputNormalizer or PostProcessor)

Returns:

List of instantiated processor objects in the specified order

cellmap_flow.norm.input_normalize.get_normalizations(elms) → list[InputNormalizer]

Get normalizations from either dict or list format.