cellmap_flow.portable.label_it_calls
What the browser calls for Label it: the functions
web/src/backend/routes/view-labels.ts (and the rank’s
web/src/backend/routes/rank.ts, for the placement and the probability)
runs through Inference.python("cellmap_flow.portable.label_it_calls:<name>",
args, arrays), in the shape chunkmirage.calls says: fn(args, arrays),
args the JSON arguments, arrays the bytes sent beside them; a JSON
value, or a pair of JSON and arrays, back. Each decodes its arrays, calls
label_it and encodes the answer; the maths is not here.
A refusal the server answers 400 (a ValueError there) comes back as
{"error": message}, for the route to answer as the server does; any
other exception rejects the call, the route’s 500. A ModuleNotFoundError
is never caught: it is how chunkmirage’s worker learns to load scipy, before
it calls again.
Functions
|
The seed's options ( |
|
What a seed reads of the model, and where. |
|
The size in nm (z, y, x) of what the viewer's panel shows |
|
Which served voxel lies under each voxel of the box ( |
|
A seed's objects, or the mutex watershed's input. |
|
|
Module Contents
- cellmap_flow.portable.label_it_calls.seed_options(args, arrays)
The seed’s options (
label_it.seed_options) fromargs, the request’s body:{"options": ...}, or the refusal.
- cellmap_flow.portable.label_it_calls.seed_plan(args, arrays)
What a seed reads of the model, and where.
args: the model’schannel_names, the request’sselect_channel(null when it gives none), and the box asplacetakes it. Answerschannels([start, stop], or null for every one),offsets(an affinity model’s, bylabel_it.affinity_offsets, else null) andplacement(place’s answer); or the refusal of the selected channel.
- cellmap_flow.portable.label_it_calls.field_of_view(args, arrays)
The size in nm (z, y, x) of what the viewer’s panel shows (
label_it.field_of_view_nm):argsviewer_px(the page’s viewer frame, width and height),state(the viewer’s state, its JSON),pixel_nm,depth_axis,display_dimensions,voxel_size(the volume’s) anddepth_nm(null: one voxel). Answers{"size_nm"}, or the refusal.
- cellmap_flow.portable.label_it_calls.place(args, arrays)
Which served voxel lies under each voxel of the box (
_placed):argslo,hi,volumeandlevel.
- cellmap_flow.portable.label_it_calls.seed(args, arrays)
A seed’s objects, or the mutex watershed’s input.
arrays: the served regionseed_plan’s placement says to read (C, z, y, x float32, itsshapeinargs).argsalso: theindicesof that placement,methodand the options (seed_options’), the model’soutput_class(null: read off the values), and the plan’schannelsandoffsets.components:
{"count"}and the objects, (z, y, x) uint32 over the box. mutex_watershed:{"shape"}andlabel_it.affinities, float32, which the browser’s mutex watershed takes from there. A refusal (a channel the model does not have) is{"error"}.
- cellmap_flow.portable.label_it_calls.probability(args, arrays)
label_it.probabilityof a block (arrays: C, z, y, x float32, itsshapeinargs) by the model’soutput_class(null: read off the values), every channel: the same shape, float32.