bioimageflow_core¶
The worker-safe core package. Installed in all environments (main process and workers). It declares NumPy for shared-memory array helpers and avoids orchestrator-only dependencies such as pandas and pydantic.
Types¶
BioImageFlow worker-safe type system.
- class bioimageflow_core.types.Semantic[source]¶
-
What the pixel values represent.
- BINARY = 'binary'¶
- LABEL = 'label'¶
- INTENSITY = 'intensity'¶
- PROBABILITY = 'probability'¶
- DISPLACEMENT = 'displacement'¶
- FEATURE = 'feature'¶
- __new__(value)¶
- bioimageflow_core.types.SCALAR_IMAGE_SEMANTICS = frozenset({Semantic.BINARY, Semantic.INTENSITY, Semantic.LABEL, Semantic.PROBABILITY})¶
Semantic values for scalar raster images.
Use this group for tools that consume displayable scalar images without requiring a specific pixel meaning, such as visualization and montage tools. It intentionally excludes vector fields and feature images.
- class bioimageflow_core.types.Layout[source]¶
-
Axis ordering of the image data.
- PLANAR = 'YX'¶
- PLANAR_CHANNEL = 'CYX'¶
- PLANAR_TIME = 'TYX'¶
- PLANAR_TIME_CHANNEL = 'TCYX'¶
- VOLUMETRIC = 'ZYX'¶
- VOLUMETRIC_CHANNEL = 'CZYX'¶
- VOLUMETRIC_TIME = 'TZYX'¶
- VOLUMETRIC_TIME_CHANNEL = 'TCZYX'¶
- __new__(value)¶
- class bioimageflow_core.types.ImageSpec[source]¶
Bases:
objectDefines type constraints. Empty sets mean ‘any’ (wildcard).
Bases:
objectA reference to data in shared memory. Picklable.
Returns Annotated[SharedArray, ImageSpec(…), optional GUIMeta].
- class bioimageflow_core.types.Connectable[source]¶
Bases:
EnumWhether a tool input field can be bound to an upstream dataframe column.
NEVER: No input pin, no toggle — the field can never be wired.NOT_BY_DEFAULT: Pin hidden by default; a GUI checkbox reveals it.BY_DEFAULT: Pin visible by default; a GUI checkbox can hide it.
- NEVER = 'never'¶
- NOT_BY_DEFAULT = 'not_by_default'¶
- BY_DEFAULT = 'by_default'¶
- class bioimageflow_core.types.PathPicker[source]¶
Bases:
EnumWhich filesystem values a GUI path picker should offer.
- FILE = 'file'¶
- FOLDER = 'folder'¶
- BOTH = 'both'¶
- class bioimageflow_core.types.GUIMeta[source]¶
Bases:
objectDeclarative GUI hints for a tool
Inputs/Outputsfield.Attach to an
InputsorOutputsannotation viaAnnotatedto control how a GUI renders the field (label, tooltip, widget range, pin visibility, tab grouping, …).- Parameters:
display_name (str | None) – Human-readable label shown next to the field in the GUI. If
None, frontends should fall back to the field name (optionally prettified).description (str | None) – Longer help text (tooltip / inline help) explaining what the field means and how it is used.
connectable (Connectable) – Controls whether and how an
Inputsfield can be bound to an upstream column. Ignored forOutputsfields. Defaults toConnectable.NOT_BY_DEFAULT.min (float | None) – Minimum allowed value (numeric fields only).
max (float | None) – Maximum allowed value (numeric fields only).
step (float | None) – Step increment for spinbox / slider widgets (numeric fields only).
group (str | None) – Logical group name for organising fields into tabs or sections (e.g.
"general","advanced","gpu").Nonemeans the field belongs to the default / unnamed group.path_picker (PathPicker | None) – Picker actions offered for path-typed inputs.
Nonelets the GUI infer a backward-compatible default from the field type. This is a rendering hint only and does not validate the filesystem value.
-
connectable:
Connectable= 'not_by_default'¶
-
path_picker:
Optional[PathPicker] = None¶
- __init__(display_name=None, description=None, connectable=Connectable.NOT_BY_DEFAULT, min=None, max=None, step=None, group=None, path_picker=None)¶
- Parameters:
display_name (str | None)
description (str | None)
connectable (Connectable)
min (float | None)
max (float | None)
step (float | None)
group (str | None)
path_picker (PathPicker | None)
- Return type:
None
Environment¶
Environment and resource specifications.
- class bioimageflow_core.environment.EnvironmentSpec[source]¶
Bases:
objectDefines a reusable Wetlands environment specification.
Tool Base Classes¶
Worker-safe tool base classes.
- class bioimageflow_core.tool.Category[source]¶
-
High-level functional category for a tool.
- CONVERSION = 'conversion'¶
- IMAGE_PROCESSING = 'image_processing'¶
- SEGMENTATION = 'segmentation'¶
- REGISTRATION = 'registration'¶
- SPECTRAL_ANALYSIS = 'spectral_analysis'¶
- TRACKING = 'tracking'¶
- MEASUREMENT = 'measurement'¶
- SPOT_DETECTION = 'spot_detection'¶
- DECONVOLUTION = 'deconvolution'¶
- RESTORATION = 'restoration'¶
- COLOCALIZATION = 'colocalization'¶
- STITCHING = 'stitching'¶
- CLASSIFICATION = 'classification'¶
- UTILITIES = 'utilities'¶
- __new__(value)¶
- class bioimageflow_core.tool.Template[source]¶
Bases:
objectExplicit marker for ProcessingTool output path templates.
- __init__()¶
- class bioimageflow_core.tool.IOModel[source]¶
Bases:
objectLightweight declarative base for tool Inputs/Outputs.
- class bioimageflow_core.tool.BaseTool[source]¶
Bases:
objectCommon base for all tools. Provides identity and Inputs. __call__ is NOT defined here — each subclass defines its own.
Arguments¶
Arguments namespace, execution context, and index lineage helpers.
- class bioimageflow_core.arguments.ExecutionContext[source]¶
Bases:
objectPer-execution filesystem context for ProcessingTool runtime scratch.
- class bioimageflow_core.arguments.Arguments[source]¶
Bases:
objectLightweight namespace for passing resolved values to tool methods. Supports attribute access with helpful error messages on typos.
I/O¶
I/O dispatch helpers with pluggable file readers and NumPy shared-memory views.
Shared Memory¶
Shared memory helpers that expose NumPy array views.
Create a shared memory segment, copy data into it, and yield a SharedArray. Closes the local handle on exit but does NOT unlink (data persists).
Attach to an existing shared memory segment. Yields a zero-copy numpy array. Closes handle on exit.
- Return type:
- Parameters:
ref (SharedArray)