AOT-biomaps 2.9.376__py3-none-any.whl → 2.9.378__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- AOT_biomaps/AOT_Acoustic/StructuredWave.py +2 -1
- AOT_biomaps/AOT_Acoustic/_mainAcoustic.py +42 -24
- AOT_biomaps/__init__.py +3 -1
- {aot_biomaps-2.9.376.dist-info → aot_biomaps-2.9.378.dist-info}/METADATA +1 -1
- {aot_biomaps-2.9.376.dist-info → aot_biomaps-2.9.378.dist-info}/RECORD +7 -7
- {aot_biomaps-2.9.376.dist-info → aot_biomaps-2.9.378.dist-info}/WHEEL +0 -0
- {aot_biomaps-2.9.376.dist-info → aot_biomaps-2.9.378.dist-info}/top_level.txt +0 -0
|
@@ -109,7 +109,8 @@ class StructuredWave(AcousticField):
|
|
|
109
109
|
try:
|
|
110
110
|
super().__init__(**kwargs)
|
|
111
111
|
self.waveType = WaveType.StructuredWave
|
|
112
|
-
self.
|
|
112
|
+
if self.params['Nt'] is None:
|
|
113
|
+
self.kgrid.setTime(int(self.kgrid.Nt*1.5),self.kgrid.dt) # Extend the time grid to allow for delays
|
|
113
114
|
if space_0 is not None and space_1 is not None and move_head_0_2tail is not None and move_tail_1_2head is not None and angle_deg is not None:
|
|
114
115
|
self.pattern = self.PatternParams(space_0, space_1, move_head_0_2tail, move_tail_1_2head, self.params['num_elements'] // 4)
|
|
115
116
|
self.angle = angle_deg
|
|
@@ -123,7 +123,6 @@ class AcousticField(ABC):
|
|
|
123
123
|
else:
|
|
124
124
|
Nt = self.params['Nt']
|
|
125
125
|
self.kgrid.setTime(Nt,1/float(params.acoustic['f_AQ']))
|
|
126
|
-
print(f" NT kgrid : {self.kgrid.Nt} ")
|
|
127
126
|
self.params['f_AQ'] = int(float(params.acoustic['f_AQ']))
|
|
128
127
|
|
|
129
128
|
self._generate_burst_signal()
|
|
@@ -146,7 +145,7 @@ class AcousticField(ABC):
|
|
|
146
145
|
self.medium = None
|
|
147
146
|
|
|
148
147
|
self.waveType = None
|
|
149
|
-
self.field = None
|
|
148
|
+
self.field = None
|
|
150
149
|
|
|
151
150
|
def __str__(self):
|
|
152
151
|
"""
|
|
@@ -514,7 +513,7 @@ class AcousticField(ABC):
|
|
|
514
513
|
dx = self.params['dx']
|
|
515
514
|
air_margin = 20
|
|
516
515
|
if dx >= self.params['element_width']:
|
|
517
|
-
dx = self.params['element_width']
|
|
516
|
+
dx = self.params['element_width']/2
|
|
518
517
|
if self.params['width_phantom'] is not None:
|
|
519
518
|
pva_nx = int(np.round((self.params['width_phantom'])/dx))
|
|
520
519
|
Nx = pva_nx + 2 * air_margin
|
|
@@ -531,29 +530,46 @@ class AcousticField(ABC):
|
|
|
531
530
|
else:
|
|
532
531
|
Nx = int(round((self.params['Xrange'][1] - self.params['Xrange'][0]) / self.params['dx']))
|
|
533
532
|
if self.params['height_phantom'] is not None:
|
|
534
|
-
Nz = int(np.round((self.params['height_phantom'])/self.params['
|
|
533
|
+
Nz = int(np.round((self.params['height_phantom'])/self.params['dx']))
|
|
535
534
|
else:
|
|
536
|
-
Nz = int(round((self.params['Zrange'][1] - self.params['Zrange'][0]) / self.params['
|
|
537
|
-
|
|
535
|
+
Nz = int(round((self.params['Zrange'][1] - self.params['Zrange'][0]) / self.params['dx']))
|
|
536
|
+
|
|
537
|
+
Nx_final = int(round((self.params['Xrange'][1] - self.params['Xrange'][0]) / self.params['dx']))
|
|
538
|
+
Nz_final = int(round((self.params['Zrange'][1] - self.params['Zrange'][0]) / self.params['dx']))
|
|
538
539
|
# --- 2. Time and space factors ---
|
|
539
540
|
factorT = int(np.ceil(self.params['f_AQ'] / self.params['f_saving']))
|
|
540
|
-
factorX = int(np.ceil(
|
|
541
|
-
factorZ =
|
|
541
|
+
factorX = int(np.ceil(self.params['dx'] / dx))
|
|
542
|
+
factorZ = factorX
|
|
542
543
|
|
|
543
544
|
# --- 3. Grid and source initialization ---
|
|
544
545
|
kgrid = kWaveGrid([Nx, Nz], [dx, dx])
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
546
|
+
|
|
547
|
+
# --- CORRECTIF : Définition du Medium avec hétérogénéité ---
|
|
548
|
+
# Initialisation en float32 (essentiel pour GPU)
|
|
549
|
+
c_map = np.full((Nx, Nz), 343.0, dtype=np.float32) # Air par défaut
|
|
550
|
+
rho_map = np.full((Nx, Nz), 1.2, dtype=np.float32)
|
|
551
|
+
|
|
552
|
+
# Insertion du bloc de PVA
|
|
553
|
+
x_start = air_margin
|
|
554
|
+
x_end = air_margin + pva_nx
|
|
555
|
+
c_map[x_start:x_end, :] = self.params['c0']
|
|
556
|
+
rho_map[x_start:x_end, :] = self.params.get('density', 1000.0)
|
|
557
|
+
|
|
558
|
+
medium = kWaveMedium(sound_speed=c_map, density=rho_map)
|
|
559
|
+
|
|
560
|
+
# --- CORRECTIF : Recalcul du pas de temps (CFL) ---
|
|
561
|
+
# k-Wave a besoin d'un dt basé sur la vitesse MAXIMALE (1540 m/s)
|
|
562
|
+
c_mean = np.mean(c_map[:, 0]) # mean speed at z=0
|
|
563
|
+
c_max = np.max(c_map)
|
|
564
|
+
cfl = 0.3 # Valeur de sécurité
|
|
565
|
+
dt = cfl * dx / c_max
|
|
566
|
+
kgrid.setTime(self.kgrid.Nt, dt)
|
|
553
567
|
|
|
554
568
|
|
|
555
569
|
source = kSource()
|
|
556
570
|
source.p_mask = np.zeros((Nx, Nz))
|
|
571
|
+
# Appel à la méthode spécialisée
|
|
572
|
+
self._SetUpSource(self,source, Nx, dt, dx, c_mean,factorT) # factorT=1 pour simplifier
|
|
557
573
|
|
|
558
574
|
# --- 4. Sensor setup ---
|
|
559
575
|
sensor = kSensor()
|
|
@@ -565,11 +581,14 @@ class AcousticField(ABC):
|
|
|
565
581
|
# --- 7. Simulation options ---
|
|
566
582
|
simulation_options = SimulationOptions(
|
|
567
583
|
pml_inside=False, # PML ajoutée autour de la grille Air+PVA
|
|
568
|
-
pml_size=[
|
|
584
|
+
pml_size=[1, pml_size],
|
|
569
585
|
use_sg=False,
|
|
570
586
|
save_to_disk=True,
|
|
571
587
|
input_filename=os.path.join(gettempdir(), "KwaveIN.h5"),
|
|
572
|
-
output_filename=os.path.join(gettempdir(), "KwaveOUT.h5")
|
|
588
|
+
output_filename=os.path.join(gettempdir(), "KwaveOUT.h5"),
|
|
589
|
+
smooth_c0 = True,
|
|
590
|
+
smooth_rho0 = True,
|
|
591
|
+
smooth_p0 = True
|
|
573
592
|
)
|
|
574
593
|
|
|
575
594
|
execution_options = SimulationExecutionOptions(
|
|
@@ -578,9 +597,6 @@ class AcousticField(ABC):
|
|
|
578
597
|
show_sim_log=show_log
|
|
579
598
|
)
|
|
580
599
|
|
|
581
|
-
# --- 7. Call specialized function to set up source.p_mask and source.p ---
|
|
582
|
-
self._SetUpSource(source, Nx, dx, factorT)
|
|
583
|
-
|
|
584
600
|
# --- 8. Run simulation ---
|
|
585
601
|
sensor_data = kspaceFirstOrder2D(
|
|
586
602
|
kgrid=kgrid,
|
|
@@ -593,16 +609,18 @@ class AcousticField(ABC):
|
|
|
593
609
|
|
|
594
610
|
# --- 9. Post-process results ---
|
|
595
611
|
data = sensor_data['p'].reshape(kgrid.Nt, Nz, Nx)
|
|
596
|
-
|
|
597
612
|
if factorT != 1 or factorX != 1 or factorZ != 1:
|
|
598
|
-
|
|
613
|
+
data = reshape_field(data, [factorT, factorX, factorZ])
|
|
614
|
+
xStart = (Nx//2)//factorX - (Nx_final//2)
|
|
615
|
+
return data[:, :Nz_final, xStart:xStart+Nx_final]
|
|
599
616
|
else:
|
|
600
|
-
return data
|
|
617
|
+
return data[:, :Nz_final, xStart:xStart+Nx_final]
|
|
601
618
|
|
|
602
619
|
except Exception as e:
|
|
603
620
|
print(f"Error generating 2D acoustic field: {e}")
|
|
604
621
|
return None
|
|
605
622
|
|
|
623
|
+
|
|
606
624
|
def _generate_acoustic_field_KWAVE_3D(self, isGPU=True, show_log=True):
|
|
607
625
|
"""
|
|
608
626
|
Generate a 3D acoustic field using k-Wave.
|
AOT_biomaps/__init__.py
CHANGED
|
@@ -85,7 +85,7 @@ from .AOT_Recon.AOT_PotentialFunctions.RelativeDifferences import *
|
|
|
85
85
|
from .Config import config
|
|
86
86
|
from .Settings import *
|
|
87
87
|
|
|
88
|
-
__version__ = '2.9.
|
|
88
|
+
__version__ = '2.9.378'
|
|
89
89
|
__process__ = config.get_process()
|
|
90
90
|
|
|
91
91
|
def initialize(process=None):
|
|
@@ -237,6 +237,8 @@ def initialize(process=None):
|
|
|
237
237
|
|
|
238
238
|
|
|
239
239
|
|
|
240
|
+
|
|
241
|
+
|
|
240
242
|
|
|
241
243
|
|
|
242
244
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
AOT_biomaps/Config.py,sha256=ghEOP1n8aO1pR-su13wMeAZAxZRfry5hH67NbtZ8SqI,3614
|
|
2
2
|
AOT_biomaps/Settings.py,sha256=v8fPhnvvcfBJP29m1RLOTEr3jndGLGwbUiORXmsj2Bo,2853
|
|
3
|
-
AOT_biomaps/__init__.py,sha256=
|
|
3
|
+
AOT_biomaps/__init__.py,sha256=S_KfEFZ_eCoqy0gfMeQgnrb9rnTBdwdU8Q_avyhpNLI,4418
|
|
4
4
|
AOT_biomaps/AOT_Acoustic/AcousticEnums.py,sha256=s5kXa6jKzbS4btwbubrVcynLOr0yg5tth5vL_FGfbMk,1802
|
|
5
5
|
AOT_biomaps/AOT_Acoustic/AcousticTools.py,sha256=7kuWIIGyzZPQrzRI0zVvdwNUp7qKUE67yCYOMzSb0Ug,8283
|
|
6
6
|
AOT_biomaps/AOT_Acoustic/FocusedWave.py,sha256=3kGKKDx_3Msy5COYqIwzROPORGWvNjw8UsDanBfkMXE,11037
|
|
7
7
|
AOT_biomaps/AOT_Acoustic/IrregularWave.py,sha256=yZhtxkR6zlciRcEpdTR0BAhvgQl40XHKFaF8f4VXarE,3035
|
|
8
8
|
AOT_biomaps/AOT_Acoustic/PlaneWave.py,sha256=xza-rj5AUWDecLkGDxRcULrwZVWeBvGnEP2d51TyR04,1447
|
|
9
|
-
AOT_biomaps/AOT_Acoustic/StructuredWave.py,sha256=
|
|
9
|
+
AOT_biomaps/AOT_Acoustic/StructuredWave.py,sha256=CpmvyHmwVvYuGhC1bL6VDQERC70gDQNgIdKNZI22Zpw,18978
|
|
10
10
|
AOT_biomaps/AOT_Acoustic/__init__.py,sha256=t9M2rRqa_L9pk7W2FeELTkHEMuP4DBr4gBRldMqsQbg,491
|
|
11
|
-
AOT_biomaps/AOT_Acoustic/_mainAcoustic.py,sha256=
|
|
11
|
+
AOT_biomaps/AOT_Acoustic/_mainAcoustic.py,sha256=tGsCSJXrGs25M0IWf6qRKniQ1KAgU3fAHi-n48prDFw,47696
|
|
12
12
|
AOT_biomaps/AOT_Experiment/ExperimentTools.py,sha256=aFvJw6J_jfFVTDFnG7J3a61SHEgORdZKZS0UI82VMaY,2637
|
|
13
13
|
AOT_biomaps/AOT_Experiment/Focus.py,sha256=B2nBawmv-NG2AWJx9zgQ8GlN6aFB9FwTSqX-M-phKXg,3193
|
|
14
14
|
AOT_biomaps/AOT_Experiment/Tomography.py,sha256=9mJDwV9WVphoX8drL7MgN3WhS6fjYwS6HWQD3x1CrVs,37625
|
|
@@ -42,7 +42,7 @@ AOT_biomaps/AOT_Recon/AOT_PotentialFunctions/__init__.py,sha256=RwrJdLOFbAFBFnRx
|
|
|
42
42
|
AOT_biomaps/AOT_Recon/AOT_SparseSMatrix/SparseSMatrix_CSR.py,sha256=RACc2P5oxmp0uPLAGnNj9mEtAxa_OlepNgCawKij3jI,12062
|
|
43
43
|
AOT_biomaps/AOT_Recon/AOT_SparseSMatrix/SparseSMatrix_SELL.py,sha256=ti3dZQsb_Uu62C7Bn65Z-yf-R5NKCFsmnBT5GlLd_HY,15138
|
|
44
44
|
AOT_biomaps/AOT_Recon/AOT_SparseSMatrix/__init__.py,sha256=8nou-hqjQjuCTLhoL5qv4EM_lMPFviAZAZKSPhi84jE,67
|
|
45
|
-
aot_biomaps-2.9.
|
|
46
|
-
aot_biomaps-2.9.
|
|
47
|
-
aot_biomaps-2.9.
|
|
48
|
-
aot_biomaps-2.9.
|
|
45
|
+
aot_biomaps-2.9.378.dist-info/METADATA,sha256=y50KhGuRlcPegJxI1-vSusy6byZECPWGUDpsACtCNDI,700
|
|
46
|
+
aot_biomaps-2.9.378.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
47
|
+
aot_biomaps-2.9.378.dist-info/top_level.txt,sha256=6STF-lT4kaAnBHJYCripmN5mZABoHjMuY689JdiDphk,12
|
|
48
|
+
aot_biomaps-2.9.378.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|