Skip to main content

Pipeline Library (TransformsV2)

The pipeline library is the on-disk catalog of saved PipelineDescriptor JSON files. It is separate from Triage Session command sequences and from workspace-embedded pipeline provenance.

Storage location

Under the application config directory (StateManager::configDir()):

{config_dir}/pipelines/transforms_v2/*.json

On Linux this is typically ~/.config/WhiskerToolbox/pipelines/transforms_v2/.

Core API (Qt-free)

Headers live in src/TransformsV2/io/:

Function Purpose
defaultUserPipelineDirectory(config_dir) Resolve the library path
ensureUserPipelineDirectory(config_dir) Create the directory tree
sanitizePipelineFilename(name) Filesystem-safe stem from a display name
listPipelineFiles(directory) List *.json entries with display names
loadPipelineDescriptorFromFile(path) Parse descriptor JSON
savePipelineDescriptorToFile(path, descriptor) Write descriptor JSON
deletePipelineFile(path) Remove a library file
savePipelineToFile(path, descriptor) Same write path via PipelineLoader
loadPipelineDescriptorFromJsonFile(path) Parse-only load (no TransformPipeline build)

To execute a saved file, use loadPipelineFromFile (builds a TransformPipeline).

JSON format

Files use the PipelineDescriptor schema documented in PipelineLoader.hpp: metadata, optional pre_reductions, steps, optional range_reduction.

Pipeline library dialog

PipelineLibraryDialog provides:

  • Browse saved pipelines with JSON preview
  • Load (closes dialog and applies to TransformsV2 widget)
  • Save to Library, Delete, Import…, Export…, Open Folder

The TransformsV2 JSON panel adds Library… and Save to Library shortcuts that use the same directory.

Tensor column configuration

ColumnConfigDialog adds Load from Library…, which opens the same PipelineLibraryDialog. The library directory is resolved from StateManager::configDir() when the Data Inspector is registered and forwarded through TensorDesigner.

Widget integration

TransformsV2Properties_Widget:

  • currentPipelineDescriptor() merges UI steps with metadata / pre_reductions / range_reduction from the JSON panel.
  • Load/Save use AppFileDialog with IDs transformv2_pipeline_open and transformv2_pipeline_save, defaulting to the user library directory.
  • TransformsV2WidgetModule::registerTypes receives StateManager::configDir() and ensures pipelines/transforms_v2/ exists at widget construction.

Tests