Back to skills
extension
Category: Productivity & OfficeNo API key required

bioimage-batch-pipeline

turn a single-image bioimage workflow into a reproducible batch pipeline for folders of microscopy images. use when the task involves processing many tiff, ome-tiff, png, jpeg, czi, nd2, or lif files with consistent outputs such as masks, labels, csv tables, qc plots, scripts, notebooks, and run logs. prefer this skill when chatgpt should create robust file iteration, output naming, and error-reporting logic around a napari/python analysis workflow.

personAuthor: TashanworldhubOpenAPI

Bioimage Batch Pipeline

Overview

Convert an exploratory microscopy workflow into a robust batch pipeline that can process folders of images and save consistent outputs.

Default stack

Prefer:

  • numpy
  • scipy
  • scikit-image
  • tifffile
  • pandas
  • matplotlib
  • napari

Batch design rules

  • Treat one image as the reference case first.
  • Separate pipeline logic from file iteration logic.
  • Save per-file outputs in a predictable directory structure.
  • Log failures without stopping the entire run unless the user asks for fail-fast behavior.

Recommended directory layout

input/
output/
  masks/
  labels/
  tables/
  qc/
  notebooks/
  logs/

Workflow

  1. detect input files and group by format
  2. inspect one or a few representative files
  3. apply the single-image pipeline as a function
  4. save outputs with consistent names
  5. aggregate summary tables across files
  6. write a run log and failure log

Naming rules

Prefer suffix-based outputs such as:

  • {stem}_labels.tif
  • {stem}_mask.tif
  • {stem}_measurements.csv
  • {stem}_qc.png
  • {stem}_analysis.ipynb

Robustness rules

  • Skip hidden files and obvious non-image files.
  • Use pathlib rather than ad hoc string concatenation.
  • Catch per-file exceptions and record them.
  • Record package versions when practical.
  • Do not overwrite outputs unless the user explicitly requests it.

Deliverables

By default, create:

  • runnable batch Python script
  • notebook template for representative-file debugging
  • per-file outputs
  • aggregate CSV summary
  • run log

Resources

  • references/batch-patterns.md: file iteration and logging patterns
  • scripts/batch_driver.py: minimal batch driver example