openlifu.plan.solution_analysis.get_mask

openlifu.plan.solution_analysis.get_mask(da: DataArray, focus, distance: float, origin=array([0., 0., 0.]), aspect_ratio=[1, 1, 1], operator='<') DataArray[source]

Compute a boolean mask of the focus region in transducer space.

The focus region is an ellipsoid centered at the focus point.

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

  • distance – How far from the focus to include points in the mask. See calc_dist_from_focus for the distorted metric under which a ball of points becomes an ellispoid in euclidean space.

  • 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 distances (see get_focus_matrix for the meaning of “focus coordinates”).

  • operator – a string representation of an inequality operator that represents the desired masking operation. The default ‘<’ for example includes points strictly inside the focal ellipsoid.

Returns: the focal mask as an xarray DataArray