openlifu.plan.solution_analysis.calc_dist_from_focus¶
- openlifu.plan.solution_analysis.calc_dist_from_focus(da: DataArray, focus, origin=array([0., 0., 0.]), aspect_ratio=[1, 1, 1], as_dataarray=True)[source]¶
Compute a distance map from a focus point in transducer space, using a possibly distorted metric that respects the symmetry of the focus shape (e.g. it could be cigar-shaped).
- Parameters:
da – DataArray that will supply the coordnate grid (presumably transducer coordinates)
focus – A 3D point describing the focus location in the coordinates of da
origin – A 3D point describing the “effective origin” in the coordinates of da (see Transducer.get_effective_origin for the meaning of this).
aspect_ratio – x,y,z scalings on the focal coordinate system to distort the space before computing distance (see get_focus_matrix for the meaning of “focus coordinates”).
as_dataarray – Whether to return the distance map as a numpy array or an xarray DataArray
Returns the distance map as either a numpy array or an xarray DataArray.