Segmentation Demo¶
This page shows one agent-facing segmentation demo built from the recorded repository outputs under demo/workspace/outputs/demo_record_2026_04_25_gpu_final/.
The goal here is different from Quick Start. Quick Start explains the direct classical profiling path. This page shows how an agent-facing request can be resolved into three concrete segmentation skills:
cp-prepare-segmentation-inputscp-extract-segmentation-artifactscp-generate-segmentation-previews
The demo uses real recorded outputs and real result images from the repository. The trace block below is a documented trace example written from those recorded outputs. It is not presented as a verbatim saved OpenClaw session transcript.
Demo Request¶
The user-facing request for this demo is:
Prepare the segmentation inputs for configs/project_config.demo.json, run the segmentation pipeline, and generate preview PNGs for quick inspection.
Config Used¶
The agent request above names one config file:
configs/project_config.demo.json
In this project, that config is the runtime description for the skills. It tells the skills where the demo backends live, where the workspace lives, which segmentation template to use, and where outputs should be written by default.
The fields that matter most for this demo are:
Config field |
Value in the demo config |
Meaning in this demo |
|---|---|---|
|
|
location of the demo raw Cell Painting inputs |
|
|
location of the demo segmentation backend assets |
|
|
workspace root for generated intermediate files |
|
|
default output root if the user does not provide another output path |
|
|
bundled segmentation |
|
|
runtime settings used for the segmentation export step |
For this page, the important point is simple: the agent does not guess these backend paths or templates. It reads them from the project config and then routes the request to the right skills.
Archived Trace Example¶
The block below follows the same basic style as the A2 case-trace reference: user request first, then planner steps, tool calls, and observed results.
# Archived CellPainting-Claw segmentation trace example
# Recorded output root:
# - demo/workspace/outputs/demo_record_2026_04_25_gpu_final
# Config:
# - configs/project_config.demo.json
user_input:
Prepare the segmentation inputs for configs/project_config.demo.json,
run the segmentation pipeline, and generate preview PNGs for quick
inspection.
planner_step_1:
intent:
Resolve the segmentation-ready input table before any CellProfiler run.
tool_calls:
- cp-prepare-segmentation-inputs(config="configs/project_config.demo.json")
observed_result:
- load_data_for_segmentation.csv written
- field_count = 2
- wells = A01, A02
- site_count = 2
planner_step_2:
intent:
Run the segmentation pipeline on the prepared fields and collect the
main segmentation artifacts.
tool_calls:
- cp-extract-segmentation-artifacts(config="configs/project_config.demo.json")
observed_result:
- derived pipeline written: CPJUMP1_analysis_mask_export.cppipe
- measurement tables written: Image.csv, Cells.csv, Nuclei.csv
- labels directory written
- outlines directory written
- segmentation_summary.json written
- returncode = 0
planner_step_3:
intent:
Render lightweight preview images for fast visual review of the same
segmentation source fields.
tool_calls:
- cp-generate-segmentation-previews(
config="configs/project_config.demo.json",
workflow_root="demo/workspace/outputs/demo_record_2026_04_25_gpu_final/01_segmentation"
)
observed_result:
- sample_previews_png/ written
- generated_count = 2
- skipped_existing = 0
final_answer_snapshot:
Prepared segmentation inputs for 2 recorded fields, ran the mask-export
segmentation pipeline successfully, and generated 2 preview PNGs for
visual inspection.
Step 1¶
cp-prepare-segmentation-inputs¶
This skill writes the load_data_for_segmentation.csv file that CellProfiler will read in the next step.
For the recorded demo run, that table contains two fields:
Plate |
Well |
Site |
Purpose |
|---|---|---|---|
|
|
|
first recorded segmentation field |
|
|
|
second recorded segmentation field |
The full table also includes all channel filenames and illumination references needed by the segmentation backend.
Files written in this step:
load_data_for_segmentation.csvpipeline_skill_manifest.json
Step 2¶
cp-extract-segmentation-artifacts¶
This skill takes the prepared load-data table, resolves the selected segmentation .cppipe, runs the segmentation backend, and writes the main artifact set.
For the recorded demo run, the main outputs were:
CPJUMP1_analysis_mask_export.cppipecellprofiler_masks/Image.csvcellprofiler_masks/Cells.csvcellprofiler_masks/Nuclei.csvcellprofiler_masks/labels/cellprofiler_masks/outlines/segmentation_summary.json
The recorded manifest shows:
field_count = 2module_count = 37selected_via = templateexecution_mode = derive-mask-exportreturncode = 0
Recorded outline outputs from the demo run:

These panels are not synthetic examples. They are enlarged views of the real recorded outline PNGs for wells A01 and A02.
Step 3¶
cp-generate-segmentation-previews¶
This skill uses the same segmentation source fields and writes lightweight preview PNGs for quick visual review.
For the recorded demo run, the manifest shows:
generated_count = 2field_count = 2skipped_existing = 0
Files written in this step:
sample_previews_png/pipeline_skill_manifest.json
Recorded preview outputs from the demo run:

These preview PNGs are the fast visual check layer. They let the user or agent confirm that the expected fields were processed before moving on to crop export or deeper downstream work.
Skill Relationship¶
For this segmentation demo, the three skills play different roles:
Skill |
Main input |
Main result |
Role in the agent trace |
|---|---|---|---|
|
config plus field metadata |
|
prepares the run description |
|
prepared inputs plus selected |
masks, labels, outlines, and tables |
executes the segmentation branch |
|
segmentation workflow root |
preview PNGs |
gives the first visual review layer |
This is why the agent trace is useful: it makes clear that the agent is not running an opaque monolithic workflow. It is resolving the request into a sequence of smaller documented skills with concrete outputs at each step.