itasc.cellpose.shape¶
Layout-free input canonicalisation for the standalone tool.
The standalone Cellpose tool supports neither stitching-as-a-mode nor true 3D
segmentation, so it never needs the 4-way 2D/2D+t/3D/3D+t layout: it segments
every plane individually. The only place axis identity matters is tracking,
which links the z axis by spatial overlap (stitch) and the t axis by
motion (laptrack). By convention the shorter of the two leading axes is z
(few z-slices, many timepoints is the common case) and the longer is t.
to_canonical_tzyx() applies that convention so the rest of the pipeline can
keep working in canonical (T, Z, Y, X) without the user declaring a layout.
Functions
|
Human-readable summary of how an input shape is interpreted. |
|
Coerce any 2-D..4-D input to canonical |
- itasc.cellpose.shape.to_canonical_tzyx(arr)[source]¶
Coerce any 2-D..4-D input to canonical
(T, Z, Y, X)without a layout.2-D
(Y, X)→(1, 1, Y, X).3-D → one leading axis, read as time (the common 2D+t case);
Zis a singleton:(T, 1, Y, X).4-D → two leading axes; the shorter is
Zand the longer isT, so the result is reordered to(T, Z, Y, X)(a no-op when already so).