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

napari-workflow-builder

build reproducible napari-centered bioimage analysis workflows in python using numpy, scipy, scikit-image, tifffile, pandas, matplotlib, and napari. use when the task involves interactive image inspection, preprocessing, thresholding, labeling, overlays, visualization, script generation, or converting exploratory napari work into reusable code. prefer this skill for common microscopy workflows that should remain readable, reproducible, and easy to adapt.

personAuthor: TashanworldhubOpenAPI

Napari Workflow Builder

Overview

Create reproducible napari workflows for common microscopy tasks and convert exploratory analysis into runnable Python scripts and notebooks.

Default stack

Prefer:

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

Only add heavier dependencies when the task clearly benefits from them.

Core workflow

1. Start from an explicit problem statement

Translate the request into a concrete workflow goal such as:

  • denoise image
  • segment nuclei
  • create labels
  • measure connected components
  • overlay masks on raw data
  • compare channels

State the intended output before writing code.

2. Build the pipeline in small named steps

Prefer readable steps over monolithic one-liners:

  1. load
  2. inspect
  3. preprocess
  4. segment or transform
  5. postprocess
  6. visualize
  7. save outputs

Use descriptive variable names and brief comments.

3. Keep napari interactive but reproducible

When using napari:

  • create layers with meaningful names
  • keep raw and processed data in separate layers
  • use labels layers for segmentation masks
  • include a non-interactive script path so the workflow can run headlessly when needed

4. Make assumptions explicit

For microscopy tasks, explicitly state:

  • whether the workflow is 2D, 3D, or time-lapse
  • whether channels are treated independently or jointly
  • whether thresholds are global or adaptive
  • whether measurements apply to raw intensity, processed intensity, or labels

Preferred algorithm choices

Default to stable, common tools from scikit-image.

Examples:

  • denoising: gaussian, median, non-local means when justified
  • background correction: rolling-ball style approximations, morphological opening, or subtraction approaches
  • segmentation: threshold + morphology + connected components for simple cases
  • watershed for touching objects when markers are available
  • registration only when explicitly needed

Do not introduce deep learning unless the user asks or a classical method is clearly inadequate.

Deliverables

When the user asks for a complete workflow, produce all of these unless they opt out:

  • runnable Python script
  • notebook version
  • saved intermediate/output filenames
  • napari layer creation code
  • concise explanation of each step

Output structure

Prefer a response structure like:

  1. task summary
  2. assumptions
  3. pipeline steps
  4. code
  5. expected saved outputs
  6. troubleshooting notes

Troubleshooting guidance

When the first-pass result is poor, suggest targeted adjustments such as:

  • smoothing sigma
  • thresholding method
  • minimum object size
  • hole filling
  • border object removal
  • per-channel normalization

Avoid vague advice like “tune parameters” without naming the likely parameters.

Resources

  • references/workflow-patterns.md: reusable workflow skeletons
  • references/notebook-outline.md: notebook structure
  • scripts/napari_workflow_demo.py: small reproducible example