OpenwaterHealth / OpenwaterHealth/openlifu-python

Focal pattern coordinate system behavior

Open
#89 1 comment 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

In the matlab software, the focal pattern's "get points" function could just give everything in transducer coordinates, because the entire scene is in fact put into transducer coordinates. Here in openlifu python we don't have a "scene" that we have forced into transducer coordinates, so the behavior is now a bit surprising and the way to use FocalPattern.get_targets on a point is to transform the point to transducer coordinates, give it to FocalPattern.get_targets, and then apply the inverse transform to the output. The usage should be made more natural or at least documented.

There is a related bug also: the dims of a Point are not processed at all by FocalPattern.get_targets, so besides the center point the other targets end up with the default dims of 'xyz'.

And finally, the name of the function could be improved here. Maybe we should differentiate between a "target" and the "points of a target". A "target" in openlifu is the anatomical location you want to treat. A target can be made of multiple points arranged in a pattern. We could call it FocalPattern.get_target_points

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 by inspecting FocalPattern.get_targets and the Point representation, focusing on coordinate transforms and how dims are propagated to generated points. Compare the current behavior with the MATLAB description and decide whether the API should change or be documented; done means natural coordinate usage, correct dims on all points, and a clarified function name if adopted.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.