Batch settings bundles¶
This page replaces the old “Batch profiles” workflow.
Batch settings are now serialized in the unified senoquant.settings bundle
format, shared across tabs and exports.
Current behavior¶
- The Batch tab UI no longer provides Load/Save profile buttons.
- Settings are saved/loaded through the Settings tab.
- Batch runs automatically write a
senoquant_settings.jsonfile into the batch output root.
Bundle envelope¶
All persisted settings use a top-level envelope:
{
"schema": "senoquant.settings",
"version": 1,
"batch_job": {},
"tab_settings": {},
"feature_settings": {},
"segmentation_runs": []
}
For batch settings, batch_job is the key payload and other sections may be
empty.
Canonical JSON Schema for this envelope is stored at
src/senoquant/utils/settings_bundle.schema.json.
batch_job payload schema¶
batch_job maps directly to BatchJobConfig in
src/senoquant/tabs/batch/config.py.
{
"input_path": "/path/to/images",
"output_path": "/path/to/output",
"extensions": [".tif", ".ome.tif", ".zarr"],
"include_subfolders": false,
"process_all_scenes": false,
"overwrite": false,
"channel_map": [
{"name": "DAPI", "index": 0},
{"name": "FITC", "index": 1}
],
"nuclear": {
"enabled": true,
"model": "default_2d",
"channel": "DAPI",
"settings": {}
},
"cytoplasmic": {
"enabled": false,
"model": "cpsam",
"channel": "FITC",
"nuclear_channel": "DAPI",
"settings": {}
},
"spots": {
"enabled": false,
"detector": "ufish",
"channels": ["FITC"],
"settings": {},
"min_size": 0,
"max_size": 0
},
"quantification": {
"enabled": true,
"format": "xlsx",
"features": []
}
}
spots.min_size and spots.max_size are legacy field names kept for
compatibility, but are interpreted as diameter thresholds in pixels when
filtering labels (2D effective area, 3D effective volume).
Where persistence happens¶
Settings tab save/load¶
- Save builds a bundle with:
tab_settingssection for segmentation/spots tab state.batch_jobsection from current Batch tab config.- Load applies:
- Segmentation and spots UI state from
tab_settings. - Batch tab state from
batch_jobwhen present.
Batch run output¶
BatchBackend.process_folder() writes output_root/senoquant_settings.json
before per-file processing begins. This captures the effective run config with
outputs.
Programmatic API¶
BatchJobConfig.save() and BatchJobConfig.load() still exist for scripted
use and compatibility; they read/write the same bundle envelope.
Legacy compatibility¶
parse_settings_bundle() accepts both:
- Legacy plain batch payloads (without the envelope), wrapped into
batch_job. - Legacy envelope payloads that stored settings under
feature; these are mapped totab_settingswhenfeature.kind == "tab_settings", otherwise tofeature_settings.
This preserves backward compatibility for older JSON files.
Developer checklist for batch config changes¶
When adding fields to batch configuration:
- Update
BatchJobConfigdataclasses insrc/senoquant/tabs/batch/config.py. - Update serialization in
to_dict()/from_dict(). - Update fallback derivation in
src/senoquant/tabs/batch/backend.py::_derive_batch_job_payload. - Update settings-tab integration expectations if needed.
- Add/adjust tests:
tests/senoquant/tabs/batch/test_config.pytests/senoquant/tabs/batch/test_batch_backend.pytests/senoquant/tabs/settings/test_frontend.py