OpenwaterHealth / OpenwaterHealth/openlifu-python

Add array_transform to SolutionInfo to preserve compute-time transducer pose

Open Beginner friendly
#491 0 comments 0 reactions 0 assignees View on GitHub

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:

  1. 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.
  2. 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
    None for legacy round-trips).
  • __post_init__ accepts a dict transparently so Session.from_dict
    decoding solutions entries 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.