Add Plant Imager v3 support to REST API - #108
Merged
Merged
Conversation
- 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.
ArthurLuciani2
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ScanPathinscan_mdand compute a workspace range (x,y,z) using the scan center and pipeline bounding box (fallbackz = -750).scan_info["workspace"]with offsets around the computed center coordinates.scan_md['workspace']or image metadata whenScanPathis missing.scan_md['Metadata']['object'], mapgrowth_environmentto theenvironmentkey, and ensureplant_idis stored underplant.'object'field) for backward compatibility.FIXMEnote for futurepositionparameter handling.