AOT-biomaps 2.9.333__py3-none-any.whl → 2.9.339__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.

Potentially problematic release.


This version of AOT-biomaps might be problematic. Click here for more details.

@@ -18,27 +18,6 @@ class Tomography(Experiment):
18
18
  self.patterns = None
19
19
  self.theta = []
20
20
  self.decimations = []
21
-
22
-
23
- for i in range(len(self.AcousticFields)):
24
- profile = hex_to_binary_profile(self.AcousticFields[i].getName_field()[6:-4], self.params.acoustic['num_elements'])
25
- angle = self.AcousticFields[i].angle
26
- self.theta.append(angle)
27
-
28
- if set(self.AcousticFields[i].getName_field()[6:-4].lower().replace(" ", "")) == {'f'}:
29
- fs_key = 0.0 # fs_key est en mm^-1 (0.0 mm^-1)
30
- else:
31
- ft_prof = np.fft.fft(profile)
32
- idx_max = np.argmax(np.abs(ft_prof[1:len(profile)//2])) + 1
33
- freqs = np.fft.fftfreq(len(profile), d=self.params.general['dx'])
34
-
35
- # freqs est en m^-1 car delta_x est en mètres.
36
- fs_m_inv = abs(freqs[idx_max])
37
-
38
- fs_key = fs_m_inv # Fréquence spatiale en mm^-1
39
-
40
- # fs = n * dfx => n = fs / dfx with dfx = 1/(N*delta_x)
41
- self.decimations.append(int(fs_key / (1/(len(profile)*self.params.general['dx']))))
42
21
 
43
22
  # PUBLIC METHODS
44
23
  def check(self):
@@ -85,6 +64,25 @@ class Tomography(Experiment):
85
64
  """
86
65
  if self.TypeAcoustic.value == WaveType.StructuredWave.value:
87
66
  self.AcousticFields = self._generateAcousticFields_STRUCT_CPU(fieldDataPath, show_log, nameBlock)
67
+ for i in range(len(self.AcousticFields)):
68
+ profile = hex_to_binary_profile(self.AcousticFields[i].getName_field()[6:-4], self.params.acoustic['num_elements'])
69
+ angle = self.AcousticFields[i].angle
70
+ self.theta.append(angle)
71
+
72
+ if set(self.AcousticFields[i].getName_field()[6:-4].lower().replace(" ", "")) == {'f'}:
73
+ fs_key = 0.0 # fs_key est en mm^-1 (0.0 mm^-1)
74
+ else:
75
+ ft_prof = np.fft.fft(profile)
76
+ idx_max = np.argmax(np.abs(ft_prof[1:len(profile)//2])) + 1
77
+ freqs = np.fft.fftfreq(len(profile), d=self.params.general['dx'])
78
+
79
+ # freqs est en m^-1 car delta_x est en mètres.
80
+ fs_m_inv = abs(freqs[idx_max])
81
+
82
+ fs_key = fs_m_inv # Fréquence spatiale en mm^-1
83
+
84
+ # fs = n * dfx => n = fs / dfx with dfx = 1/(N*delta_x)
85
+ self.decimations.append(int(fs_key / (1/(len(profile)*self.params.general['dx']))))
88
86
  else:
89
87
  raise ValueError("Unsupported wave type.")
90
88
 
@@ -314,14 +312,13 @@ class Tomography(Experiment):
314
312
  raise ValueError("Generated patterns failed validation.")
315
313
  else:
316
314
  raise ValueError("Either N (>=2) or both decimations and angles must be provided for pattern generation.")
317
-
318
-
315
+
319
316
  def saveAOsignals_matlab(self, filePath):
320
317
  ActiveList = []
321
318
  DelayLaw = []
322
319
  c = self.params.acoustic['c0']
323
320
  NbElemts = self.params.acoustic['num_elements']
324
- pitch = self.params.acoustic['width']
321
+ pitch = self.params.acoustic['element_width']
325
322
 
326
323
  for i in range(len(self.AcousticFields)):
327
324
  profile = hex_to_binary_profile(self.AcousticFields[i].getName_field()[6:-4], NbElemts)
@@ -679,6 +676,7 @@ class Tomography(Experiment):
679
676
  AcousticField.save_field(fieldDataPath)
680
677
  listAcousticFields.append(AcousticField)
681
678
  progress_bar.set_postfix_str("")
679
+
682
680
  return listAcousticFields
683
681
 
684
682
  def load_experimentalAO(self, pathAO, withTumor = True, h5name='AOsignal'):
@@ -24,12 +24,12 @@ class AnalyticRecon(Recon):
24
24
  AOsignal = self.experiment.AOsignal_withTumor
25
25
  else:
26
26
  AOsignal = self.experiment.AOsignal_withoutTumor
27
- delta_x = self.params.acoustic['dx'] # en m
28
- n_piezos = self.params.acoustic['num_elements']
27
+ delta_x = self.experiment.params.general['dx'] # en m
28
+ n_piezos = self.experiment.params.acoustic['num_elements']
29
29
  demodulated_data = {}
30
30
  structured_buffer = {}
31
31
 
32
- for i in tqdm(range(len(self.experiment.AcousticFields)), desc="Demodulating AO signals"):
32
+ for i in trange(len(self.experiment.AcousticFields), desc="Demodulating AO signals"):
33
33
  label = self.experiment.AcousticFields[i].getName_field()
34
34
 
35
35
  parts = label.split("_")
@@ -98,11 +98,10 @@ class AnalyticRecon(Recon):
98
98
 
99
99
  real = s0 - s_pi
100
100
  imag = s_pi_2 - s_3pi_2
101
-
102
-
101
+
103
102
  demodulated_data[(fs, theta)] = (real - 1j * imag) / (2/np.pi)
104
- self.AOsignal_demoldulated = demodulated_data
105
-
103
+
104
+ return demodulated_data
106
105
 
107
106
  def run(self, processType = ProcessType.PYTHON, withTumor= True):
108
107
  """
@@ -128,6 +127,7 @@ class AnalyticRecon(Recon):
128
127
  analyticType: The type of analytic reconstruction to perform (default is iFOURIER).
129
128
  """
130
129
  if withTumor:
130
+ self.AOsignal_demoldulated = self.parse_and_demodulate(withTumor=True)
131
131
  if self.analyticType == AnalyticType.iFOURIER:
132
132
  self.reconPhantom = self._iFourierRecon(self.experiment.AOsignal_withTumor)
133
133
  elif self.analyticType == AnalyticType.iRADON:
@@ -135,6 +135,7 @@ class AnalyticRecon(Recon):
135
135
  else:
136
136
  raise ValueError(f"Unknown analytic type: {self.analyticType}")
137
137
  else:
138
+ self.AOsignal_demoldulated = self.parse_and_demodulate(withTumor=False)
138
139
  if self.analyticType == AnalyticType.iFOURIER:
139
140
  self.reconLaser = self._iFourierRecon(self.experiment.AOsignal_withoutTumor)
140
141
  elif self.analyticType == AnalyticType.iRADON:
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.333'
88
+ __version__ = '2.9.339'
89
89
  __process__ = config.get_process()
90
90
 
91
91
  def initialize(process=None):
@@ -190,6 +190,12 @@ def initialize(process=None):
190
190
 
191
191
 
192
192
 
193
+
194
+
195
+
196
+
197
+
198
+
193
199
 
194
200
 
195
201
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AOT_biomaps
3
- Version: 2.9.333
3
+ Version: 2.9.339
4
4
  Summary: Acousto-Optic Tomography
5
5
  Home-page: https://github.com/LucasDuclos/AcoustoOpticTomography
6
6
  Author: Lucas Duclos
@@ -1,6 +1,6 @@
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=KTexXkgmJ_3hKllZPzxJIRkrNj2plmep-xD4ANfDxao,4328
3
+ AOT_biomaps/__init__.py,sha256=r0H6FXsW0n-ethz4CgAmwp24IOM9OaxvBLKxLkZ0We0,4340
4
4
  AOT_biomaps/AOT_Acoustic/AcousticEnums.py,sha256=s5kXa6jKzbS4btwbubrVcynLOr0yg5tth5vL_FGfbMk,1802
5
5
  AOT_biomaps/AOT_Acoustic/AcousticTools.py,sha256=h2sCtGVcDtyLtEF1q7sLZmuWivWmesVGUBPnW-ndQqc,7535
6
6
  AOT_biomaps/AOT_Acoustic/FocusedWave.py,sha256=3kGKKDx_3Msy5COYqIwzROPORGWvNjw8UsDanBfkMXE,11037
@@ -11,7 +11,7 @@ AOT_biomaps/AOT_Acoustic/__init__.py,sha256=t9M2rRqa_L9pk7W2FeELTkHEMuP4DBr4gBRl
11
11
  AOT_biomaps/AOT_Acoustic/_mainAcoustic.py,sha256=RdmhRF1i0KAlpsP7_wnZ7F4J27br3eUc4XR91Qq7C64,44158
12
12
  AOT_biomaps/AOT_Experiment/ExperimentTools.py,sha256=EyTIwgxTK-FqJYlhdjgirfWCSL1kTp-IOS0tTgiAVNA,3153
13
13
  AOT_biomaps/AOT_Experiment/Focus.py,sha256=B2nBawmv-NG2AWJx9zgQ8GlN6aFB9FwTSqX-M-phKXg,3193
14
- AOT_biomaps/AOT_Experiment/Tomography.py,sha256=87tdUjYJbrNU2S3FT7pCsnB4jFEYZQFqD4o_FBKekkc,36689
14
+ AOT_biomaps/AOT_Experiment/Tomography.py,sha256=3JlslI9GNZy-u0uYgf0u9qyaVAQki6cYTHhcGK33aFg,36747
15
15
  AOT_biomaps/AOT_Experiment/__init__.py,sha256=H9zMLeBLA6uhbaHohAa-2u5mDDxqJi8oE5c6tShdQp8,308
16
16
  AOT_biomaps/AOT_Experiment/_mainExperiment.py,sha256=zSfuNrsz7nhiKrGIdK6CAXjlI2T6qYC5-JXHFgPNzhc,24674
17
17
  AOT_biomaps/AOT_Optic/Absorber.py,sha256=jEodzRy7gkEH-wbazVasRQiri0dU16BfapmR-qnTSvM,867
@@ -21,7 +21,7 @@ AOT_biomaps/AOT_Optic/__init__.py,sha256=HSUVhfz0NzwHHZZ9KP9Xyfu33IgP_rYJX86J-gE
21
21
  AOT_biomaps/AOT_Optic/_mainOptic.py,sha256=Wk63CcgWbU-ygMfjNK80islaUbGGJpTXgZY3_C2KQNY,8179
22
22
  AOT_biomaps/AOT_Recon/AOT_biomaps_kernels.cubin,sha256=JWy-bdtBTZdnNlDbJGZKwXyF-2u1wICtmlOC_YxEL6o,82528
23
23
  AOT_biomaps/AOT_Recon/AlgebraicRecon.py,sha256=CGBXZyYEZ3TOTFOKSt-h7NGuFbuI9PNr3YTWTbSLxDo,46832
24
- AOT_biomaps/AOT_Recon/AnalyticRecon.py,sha256=9MNztNRZuF8zM1WfJh1GaTC8b7UDb_iuh0T0LGwycUY,10905
24
+ AOT_biomaps/AOT_Recon/AnalyticRecon.py,sha256=NKO7nE2Roq3E9HzMf_eJobm7rNQK1xzaQ0W9zXic9CY,11067
25
25
  AOT_biomaps/AOT_Recon/BayesianRecon.py,sha256=RnnPa-tTcvirwiNPnCRZnSM4NWeEEltYET-piBbp34g,12671
26
26
  AOT_biomaps/AOT_Recon/DeepLearningRecon.py,sha256=RfVcEsi4GeGqJn0_SPxwQPQx6IQjin79WKh2UarMRLI,1383
27
27
  AOT_biomaps/AOT_Recon/PrimalDualRecon.py,sha256=JbFhxiyUoSTnlJgHbOWIfUUwhwfZoi39RJMnfkagegY,16504
@@ -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.333.dist-info/METADATA,sha256=bnzNzvd1PZh5qMbP_pSbFR59oQ8YUrW4fYQmhKhY0Uo,700
46
- aot_biomaps-2.9.333.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
47
- aot_biomaps-2.9.333.dist-info/top_level.txt,sha256=6STF-lT4kaAnBHJYCripmN5mZABoHjMuY689JdiDphk,12
48
- aot_biomaps-2.9.333.dist-info/RECORD,,
45
+ aot_biomaps-2.9.339.dist-info/METADATA,sha256=3XoTP8HukgXdJdBPQC66FjZ5q-SvOn5LhVETzFDXvfY,700
46
+ aot_biomaps-2.9.339.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
47
+ aot_biomaps-2.9.339.dist-info/top_level.txt,sha256=6STF-lT4kaAnBHJYCripmN5mZABoHjMuY689JdiDphk,12
48
+ aot_biomaps-2.9.339.dist-info/RECORD,,