cellmap_flow.portable.calls =========================== .. py:module:: cellmap_flow.portable.calls .. autoapi-nested-parse:: What the browser calls: the functions ``web/src/backend/routes/rank.ts`` runs through chunkmirage's ``Engine.call("cellmap_flow.portable.calls:", args, arrays)`` (``chunkmirage.calls`` says the shape: ``fn(args, arrays)``, ``args`` the JSON arguments, ``arrays`` the bytes sent beside them, in order; a JSON value, bytes, or a pair of JSON and arrays back). Each decodes its arrays, calls the maths in ``rank.py``, ``carry.py`` or ``activation.py`` and encodes the answer; the maths is not here. The workers take turns, so what a call needs from the one before (the rank's tallies) travels in its JSON. Functions --------- .. autoapisummary:: cellmap_flow.portable.calls.rank_tally cellmap_flow.portable.calls.rank_score cellmap_flow.portable.calls.windowed cellmap_flow.portable.calls.norm_tries cellmap_flow.portable.calls.best_try cellmap_flow.portable.calls.needed_postprocess cellmap_flow.portable.calls.output_activation cellmap_flow.portable.calls.rank_row cellmap_flow.portable.calls.carry_paint Module Contents --------------- .. py:function:: rank_tally(args, arrays) One painted chunk added to a model's tallies (``rank.tally``). ``args``: ``tallies`` (the ones so far, as this answered them; null for fresh ones), ``shape`` (z, y, x), ``channels``, ``labels_dtype`` and ``affinity``; ``arrays``: the chunk's labels (z, y, x), then its target, mask and the model's logits (each C, z, y, x float32, the logits NaN where not read). Answers the tallies. .. py:function:: rank_score(args, arrays) The score of ``tallies`` (``rank.rank_score``) for ``channels``, an ``affinity`` model's or not; null when nothing was counted. .. py:function:: windowed(args, arrays) ``rank.windowed``: ``norm`` with its MinMaxNormalizer set to the raw's window [``lo``, ``hi``], or null. .. py:function:: norm_tries(args, arrays) ``rank.norm_tries``: the input normalizations a model is scored through, from ``own`` (its declaration, ``own_from``) and ``session``. .. py:function:: best_try(args, arrays) ``rank.best_try``: the index of the best of ``scores``, or null. .. py:function:: needed_postprocess(args, arrays) ``rank.needed_postprocess``: the postprocessing a model of ``output_class`` needs instead of ``postprocess`` to show a good prediction, with a ThresholdPostprocessor at ``threshold`` (a probability) when that is given, or null. .. py:function:: output_activation(args, arrays) ``activation.output_activation``: the output activation of a served model's graph, ``nodes`` (each ``{"op", "inputs", "outputs"}``, a clip's ``min`` and ``max`` where read) read back from its value ``output``, as ``{"output_class", "op"}``; null when the graph does not say. .. py:function:: rank_row(args, arrays) ``rank.score_row``: the ranking's row from ``base`` (the score read through ``norm``, which came from ``norm_from``), ``stretched`` (the score read through ``norm`` stretched to ``raw``, or null), ``raw`` (the raw's window, or null) and ``others`` (what the other normalizations tried matched); null when ``base`` is null. .. py:function:: carry_paint(args, arrays) The old volume's paint carried onto the new grid (``carry.carry``). ``args``: ``old`` and ``new`` (each a ``Grid``'s fields), ``old_dtype``, ``new_dtype`` and ``indices``, the old painted chunks'; ``arrays``: those chunks' labels, whole, in that order. Answers the counts with ``indices``, the new chunks' in the order of the arrays beside them, each a whole chunk to write where it is not 0.