Skip to main content
Version: dev-latest

MetriCal Command: Plex Filter

Usage

Plex Filter - CLI Example
metrical plex filter [OPTIONS] [PLEX_OR_RESULTS_PATH]
Plex Filter - Manifest Example
command = "plex-filter"
input-plex = "input.json"
components = ["/camera/1", "/camera/2"]
glob = false
inverse = false
output-plex = "{{auto}}"

Purpose

metrical plex filter keeps only the specified components in a Plex, removing everything else. Any spatial constraints, temporal constraints, and formations that reference removed components are also removed automatically.

The filtering logic can be inverted with --inverse (to remove the specified components and keep everything else), restricted to only constraints or formations with --restrict, and broadened to support glob patterns with --glob.

Examples

Keep only two cameras

metrical plex filter -c /camera/left -c /camera/right input.json -o output.json

Remove a specific component (inverse filter)

metrical plex filter --inverse -c /lidar/top input.json -o output.json

Keep all components matching a glob pattern

metrical plex filter --glob -c '*camera*' input.json -o output.json

Remove only spatial constraints between two components, keeping the components themselves

metrical plex filter --restrict spatial-constraints -c /camera/1 input.json -o output.json

Arguments

[PLEX_OR_RESULTS_PATH]

The path to the input Plex. If omitted, MetriCal will read the Plex from stdin.

Options

Global Arguments

As with every command, all global arguments are supported (though not all may be used).

-c, --component [COMPONENT]

A component to keep in the filtered Plex. Components not listed here will be removed (unless --inverse is specified). Repeat this flag to specify multiple components. Accepts topic names or UUIDs.

-g, --glob

Treat the component identifiers provided via -c/--component as glob patterns. For example, *camera* will match both /camera/1 and /camera/2.

-i, --inverse

Invert the filter: remove all components that match the provided identifiers, and keep everything else.

-R, --restrict [RESTRICTION]

Restrict the filtering logic to only affect a specific kind of element. Possible values:

  • spatial-constraints (alias: spatial): Only affect spatial constraints that reference the specified components.
  • temporal-constraints (alias: temporal): Only affect temporal constraints that reference the specified components.
  • formations: Only affect formations that include the specified components.

-o, --output [OUTPUT]

The path to output the resulting Plex. If omitted, MetriCal will write the Plex to stdout.