openlifu.sim.sim_setup.SimSetup¶
- class openlifu.sim.sim_setup.SimSetup(dims: "Annotated[Tuple[str, str, str], OpenLIFUFieldData('Dimension keys', 'Codenames of the axes in the coordinate system being used')]" = ('lat', 'ele', 'ax'), names: "Annotated[Tuple[str, str, str], OpenLIFUFieldData('Dimension names', 'Human readable names of the axes in the coordinate system being used')]" = ('Lateral', 'Elevation', 'Axial'), spacing: "Annotated[float, OpenLIFUFieldData('Spacing', 'Simulation grid spacing')]" = 1.0, units: "Annotated[str, OpenLIFUFieldData('Spatial units', 'Units used for spatial measurements')]" = 'mm', x_extent: "Annotated[Tuple[float, float], OpenLIFUFieldData('X-extent', 'Simulation grid extent along the first dimension')]" = (-30.0, 30.0), y_extent: "Annotated[Tuple[float, float], OpenLIFUFieldData('Y-extent', 'Simulation grid extend along the second dimension')]" = (-30.0, 30.0), z_extent: "Annotated[Tuple[float, float], OpenLIFUFieldData('Z-extent', 'Simulation grid extend along the third dimension')]" = (-4.0, 60.0), dt: "Annotated[float, OpenLIFUFieldData('Time step', 'Simulation time step')]" = 0.0, t_end: "Annotated[float, OpenLIFUFieldData('End time', 'Simulation end time')]" = 0.0, c0: "Annotated[float, OpenLIFUFieldData('Speed of Sound (m/s)', 'Reference speed of sound for converting distance to time')]" = 1500.0, cfl: "Annotated[float, OpenLIFUFieldData('CFL number', 'Courant-Friedrichs-Lewy number')]" = 0.5, options: "Annotated[dict[str, str], OpenLIFUFieldData('Simulation options', 'Additional simulation options')]" = <factory>)[source]¶
Bases:
DictMixin- c0: Annotated[float, OpenLIFUFieldData(name='Speed of Sound (m/s)', description='Reference speed of sound for converting distance to time')] = 1500.0¶
Reference speed of sound for converting distance to time
- cfl: Annotated[float, OpenLIFUFieldData(name='CFL number', description='Courant-Friedrichs-Lewy number')] = 0.5¶
Courant-Friedrichs-Lewy number
- dims: Annotated[Tuple[str, str, str], OpenLIFUFieldData(name='Dimension keys', description='Codenames of the axes in the coordinate system being used')] = ('lat', 'ele', 'ax')¶
Names of the axes in the coordinate system being used
- dt: Annotated[float, OpenLIFUFieldData(name='Time step', description='Simulation time step')] = 0.0¶
Simulation time step
- names: Annotated[Tuple[str, str, str], OpenLIFUFieldData(name='Dimension names', description='Human readable names of the axes in the coordinate system being used')] = ('Lateral', 'Elevation', 'Axial')¶
“Human readable names of the axes in the coordinate system being used
- options: Annotated[dict[str, str], OpenLIFUFieldData(name='Simulation options', description='Additional simulation options')]¶
Additional simulation options
- setup_sim_scene(seg_method: SegmentationMethod, volume: xa.DataArray | None = None) Tuple[xa.DataArray, Transducer, Point][source]¶
Prepare a simulation scene composed of a simulation grid
Setup a simulation scene with a simulation grid including physical properties. A segmentation is performed to detect the medium, so we can assign physical properties to each voxel, later used by the ultrasound simulation. This assume that the input volume is resampled to the geo-referenced simulation grid (lon, lat, ele).
- Parameters:
seg_method – seg.SegmentationMethod
volume – xa.DataArray Optional volume to be used for simulation grid definition (Default: None). The volume is assumed to be resampled on sim grid coordinates.
- Returns
params: The xa.DataArray simulation grid with physical properties for each voxel
- spacing: Annotated[float, OpenLIFUFieldData(name='Spacing', description='Simulation grid spacing')] = 1.0¶
Simulation grid spacing
- t_end: Annotated[float, OpenLIFUFieldData(name='End time', description='Simulation end time')] = 0.0¶
Simulation end time
- units: Annotated[str, OpenLIFUFieldData(name='Spatial units', description='Units used for spatial measurements')] = 'mm'¶
Units used for spatial measurements
- x_extent: Annotated[Tuple[float, float], OpenLIFUFieldData(name='X-extent', description='Simulation grid extent along the first dimension')] = (-30.0, 30.0)¶
Simulation grid extent along the first dimension
- y_extent: Annotated[Tuple[float, float], OpenLIFUFieldData(name='Y-extent', description='Simulation grid extend along the second dimension')] = (-30.0, 30.0)¶
Simulation grid extend along the second dimension
- z_extent: Annotated[Tuple[float, float], OpenLIFUFieldData(name='Z-extent', description='Simulation grid extend along the third dimension')] = (-4.0, 60.0)¶
Simulation grid extend along the third dimension