Skip to content

Commit 6cbfb7b

Browse files
authored
Merge pull request #86 from pinton-lab/develop
v1.1.0
2 parents 8550f13 + 74984b1 commit 6cbfb7b

15 files changed

Lines changed: 32 additions & 25 deletions

.bumpversion.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tool.bumpversion]
2-
current_version = "1.0.20"
2+
current_version = "1.1.0"
33
parse = """(?x)
44
(?P<major>0|[1-9]\\d*)\\.
55
(?P<minor>0|[1-9]\\d*)\\.

examples/linear_transducer/linear_transducer_abdominal_wall.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,22 @@ def main() -> None: # noqa: PLR0915
149149
)
150150

151151
# define scatterer
152-
scatterer = presets.ScattererDomain(
152+
153+
rng = np.random.default_rng(seed=42)
154+
155+
csr = 0.05
156+
ratio_scatterer_to_total_grid = 0.38
157+
158+
scatterer, _ = fullwave.utils.generate_scatterer(
153159
grid=grid,
154-
num_scatterer=18,
155-
ncycles=2,
160+
# ratio_scatterer_to_total_grid=0.38,
161+
ratio_scatterer_to_total_grid=ratio_scatterer_to_total_grid,
162+
scatter_value_std=csr / 2,
163+
rng=rng,
156164
)
157165

158-
# scatterer will be applied to density directly, instead of registering as a domain
159-
csr = 0.035
160-
background.density -= scatterer.density * csr
161-
abdominal_wall.density -= scatterer.density * csr
166+
background.density *= scatterer
167+
abdominal_wall.density *= scatterer
162168

163169
# register the domains to MediumBuilder
164170
mb = MediumBuilder(
@@ -170,7 +176,7 @@ def main() -> None: # noqa: PLR0915
170176
# mb.register_domain(simple_domain_2)
171177

172178
# we can plot to see the current registered domains
173-
mb.plot_current_map(export_path=work_dir / "medium.png")
179+
mb.plot_current_map(export_path=work_dir / "medium.svg")
174180

175181
# generate medium for simulation
176182
medium = mb.run()
@@ -200,17 +206,18 @@ def main() -> None: # noqa: PLR0915
200206
)
201207
propagation_map = np.nan_to_num(propagation_map, 0, posinf=p_max, neginf=-p_max)
202208

203-
p_max_plot = np.abs(propagation_map).max().item() / 2
209+
p_max_plot = np.abs(propagation_map).max().item() / 8
204210

205-
time_step = propagation_map.shape[0] // 3 * 2
211+
time_step = propagation_map.shape[0] // 50 * 37
206212
plot_utils.plot_wave_propagation_snapshot(
207213
propagation_map=propagation_map[time_step],
208214
c_map=medium.sound_speed,
209215
rho_map=medium.density,
210-
export_name=work_dir / "wave_propagation_snapshot_1.png",
216+
export_name=work_dir / "wave_propagation_snapshot_1.svg",
211217
vmin=-p_max_plot,
212218
vmax=p_max_plot,
213219
turn_off_axes=True,
220+
figsize=(6, 6),
214221
)
215222

216223
plot_utils.plot_wave_propagation_with_map(

fullwave/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
__version__ = version("fullwave")
6161
except PackageNotFoundError:
6262
# Update via bump-my-version, not manually
63-
__version__ = "1.0.20"
63+
__version__ = "1.1.0"
6464

6565
VERSION = __version__ # for convenience
6666
logger.info("Fullwave version: %s", __version__)

fullwave/medium.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ def __init__(
777777
/ "solver"
778778
/ "bins"
779779
/ "database"
780-
/ "relaxation_params_database_num_relax=2_20251027_1437.mat",
780+
/ "relaxation_params_database_num_relax=2_20260113_0957.mat",
781781
n_relaxation_mechanisms: int = 2,
782782
attenuation_builder: str = "lookup",
783783
use_isotropic_relaxation: bool = True,

fullwave/medium_builder/domain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def __init__(
4040
/ "solver"
4141
/ "bins"
4242
/ "database"
43-
/ "relaxation_params_database_num_relax=2_20251027_1437.mat",
43+
/ "relaxation_params_database_num_relax=2_20260113_0957.mat",
4444
n_relaxation_mechanisms: int = 2,
4545
) -> None:
4646
"""Initialize the Domain class.

fullwave/medium_builder/medium_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __init__(
3232
/ "solver"
3333
/ "bins"
3434
/ "database"
35-
/ "relaxation_params_database_num_relax=2_20251027_1437.mat",
35+
/ "relaxation_params_database_num_relax=2_20260113_0957.mat",
3636
n_relaxation_mechanisms: int = 2,
3737
attenuation_builder: str = "lookup",
3838
) -> None:

fullwave/medium_builder/presets/domain_abdominal_wall.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def __init__(
174174
/ "solver"
175175
/ "bins"
176176
/ "database"
177-
/ "relaxation_params_database_num_relax=2_20251027_1437.mat",
177+
/ "relaxation_params_database_num_relax=2_20260113_0957.mat",
178178
n_relaxation_mechanisms: int = 2,
179179
transducer_surface: NDArray[np.float64] | None = None,
180180
) -> None:
@@ -222,7 +222,7 @@ def __init__(
222222
Defaults to
223223
Path(__file__).parent.parent / "solver" / "bins"
224224
/ "database"
225-
/ "relaxation_params_database_num_relax=2_20251027_1437.mat",
225+
/ "relaxation_params_database_num_relax=2_20260113_0957.mat",
226226
n_relaxation_mechanisms: int, optional
227227
The number of relaxation mechanisms.
228228
Defaults to 4.

fullwave/medium_builder/presets/domain_background.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __init__(
2424
/ "solver"
2525
/ "bins"
2626
/ "database"
27-
/ "relaxation_params_database_num_relax=2_20251027_1437.mat",
27+
/ "relaxation_params_database_num_relax=2_20260113_0957.mat",
2828
n_relaxation_mechanisms: int = 2,
2929
) -> None:
3030
"""Initialize a Background instance.

fullwave/medium_builder/presets/domain_scatterer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(
2626
/ "solver"
2727
/ "bins"
2828
/ "database"
29-
/ "relaxation_params_database_num_relax=2_20251027_1437.mat",
29+
/ "relaxation_params_database_num_relax=2_20260113_0957.mat",
3030
n_relaxation_mechanisms: int = 2,
3131
seed: int | None = None,
3232
) -> None:

fullwave/medium_builder/presets/domain_simple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(
2525
/ "bins"
2626
/ "database"
2727
/ "database"
28-
/ "relaxation_params_database_num_relax=2_20251027_1437.mat",
28+
/ "relaxation_params_database_num_relax=2_20260113_0957.mat",
2929
n_relaxation_mechanisms: int = 2,
3030
) -> None:
3131
"""Initialize a SimpleDomain.

0 commit comments

Comments
 (0)