Skip to content

Add Plant Imager v3 support to REST API - #108

Merged
jlegrand62 merged 3 commits into
devfrom
hotfix/pi3-metadata
Jul 29, 2026
Merged

jlegrand62 merged 3 commits into
devfrom
hotfix/pi3-metadata

Conversation

@jlegrand62

Copy link
Copy Markdown
Member
  • Detect ScanPath in scan_md and compute a workspace range (x, y, z) using the scan center and pipeline bounding box (fallback z = -750).
  • Populate scan_info["workspace"] with offsets around the computed center coordinates.
  • Preserve existing fallback to scan_md['workspace'] or image metadata when ScanPath is missing.
  • Extend metadata handling to support Plant Imager v3 API: read object data from scan_md['Metadata']['object'], map growth_environment to the environment key, and ensure plant_id is stored under plant.
  • Keep existing Plant Imager v2 handling ('object' field) for backward compatibility.
  • Added comprehensive inline comments and a FIXME note for future position parameter handling.

- Detect Plant Imager v2 API when `'object'` exists and is non‑empty, extracting `species`, `environment`, and `plant_id`.
- Add fallback for Plant Imager v3 API by reading `scan_md.get('Metadata', {'object': {}})['object']`.
- Map v3 `growth_environment` field to the `environment` metadata key.
- Ensure `plant` metadata is populated from `plant_id` for both API versions.
- Updated inline comments to clarify version‑specific handling.
- Detect `ScanPath` in `scan_md` and compute workspace `x`, `y`, `z` ranges using `center_x`, `center_y` and pipeline bounding box (fallback to `-750` for `z`).
- Construct `scan_info["workspace"]` as a dict with ±150 offsets around the center coordinates.
- Preserve original fallback to `scan_md['workspace']` or image metadata when `ScanPath` is absent.
- Add detailed comments explaining how the workspace is used for centering the plant and a FIXME note for future `position` parameter.
@jlegrand62 jlegrand62 self-assigned this Jul 29, 2026
@jlegrand62
jlegrand62 merged commit eb810c3 into dev Jul 29, 2026
1 check passed
@jlegrand62
jlegrand62 deleted the hotfix/pi3-metadata branch July 29, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants