processing#

Intermediate processing stages (DLC, mesomap, lab pipelines).

Each processor is a small subclass of ProcessorRunner that defines run(inputs, **params) -> list[Path]. Calling the runner wraps that work in a hashing + manifest-writing harness so every processed file lands with a <tool_name>.process.json sidecar recording inputs, parameters, tool version, and upstream provenance.

class mesofield.processing.ProcessorRunner[source]#

Bases: object

Wrap a file-to-file transformation in a ProcessingManifest contract.

Subclasses must set tool_name and tool_version, and override run(). Calling the instance executes the work and writes the sidecar.

manifest_placement: ClassVar[str] = 'output_dir'#

Where the manifest sidecar lands. "output_dir" writes <tool_name>.process.json in the directory of the first output; subclasses can override manifest_path() for custom placement.

run(inputs, **params)[source]#

Do the actual work. Return the list of files written.

Parameters:
Return type:

list[Path]

declare_outputs(outputs, params, session_root)[source]#

Turn run() outputs into ProducerEntry instances.

Default: one entry per output, with data_type=tool_name and bids_type/file_type inferred from the path. Override for richer declarations (e.g. multiple roles, sidecars).

Parameters:
Return type:

list[ProducerEntry]

Submodules#