OpenwaterHealth / OpenwaterHealth/openlifu-python
Add array_transform to SolutionInfo to preserve compute-time transducer pose
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 27
- Forks
- 21
- Avg merge
- 1d 20m
- Merged PRs (30d)
- 6
Description
Add an optional array_transform: ArrayTransform | None field to
openlifu.db.session.SolutionInfo capturing the transducer array-to-volume
transform matrix that was used when the corresponding Solution was
computed.
Motivation
Downstream (SlicerOpenLIFU) currently renders a solution's PNP / intensity
volumes by parenting them under the transducer's transform node, then snapping
the transducer to whichever virtual-fit or transducer-tracking result is
currently approved. This means:
- If the currently-approved VF / TT changes between compute time and display
time, the PNP moves to the new pose rather than staying where it was
computed. - For a pre-solution (computed off a VF result), the VF approval may later
be revoked; there is then no way to display the solution at its original
pose because no transform survives.
The fix is to persist the exact matrix used at compute time on the
SolutionInfo provenance record. Consumers snap the transducer to that
matrix on display, so the PNP is invariant under later approval churn.
Details
- New field
SolutionInfo.array_transform: ArrayTransform | None(default
Nonefor legacy round-trips). __post_init__accepts a dict transparently soSession.from_dict
decodingsolutionsentries produces the correct type.- Round-trip tests added in
tests/test_database.py.
Downstream
Tracked in SlicerOpenLIFU#622: "Pre-Solution PNP overlay renders at wrong
position when navigating to Sonication Planner". That issue's fix consumes
this new field.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with openlifu.db.session.SolutionInfo and inspect how Session.from_dict decodes solutions entries. Update tests/test_database.py for the optional array_transform field, including dict decoding and legacy None behavior; done means the value survives database round trips.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- database
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100