AOT-biomaps 2.9.215__tar.gz → 2.9.217__tar.gz

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.

Files changed (48) hide show
  1. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Experiment/_mainExperiment.py +36 -16
  2. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/__init__.py +3 -1
  3. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps.egg-info/PKG-INFO +1 -1
  4. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/PKG-INFO +1 -1
  5. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/setup.py +3 -1
  6. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Acoustic/AcousticEnums.py +0 -0
  7. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Acoustic/AcousticTools.py +0 -0
  8. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Acoustic/FocusedWave.py +0 -0
  9. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Acoustic/IrregularWave.py +0 -0
  10. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Acoustic/PlaneWave.py +0 -0
  11. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Acoustic/StructuredWave.py +0 -0
  12. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Acoustic/__init__.py +0 -0
  13. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Acoustic/_mainAcoustic.py +0 -0
  14. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Experiment/Focus.py +0 -0
  15. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Experiment/Tomography.py +0 -0
  16. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Experiment/__init__.py +0 -0
  17. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Optic/Absorber.py +0 -0
  18. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Optic/Laser.py +0 -0
  19. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Optic/OpticEnums.py +0 -0
  20. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Optic/__init__.py +0 -0
  21. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Optic/_mainOptic.py +0 -0
  22. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Recon/AOT_Optimizers/DEPIERRO.py +0 -0
  23. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Recon/AOT_Optimizers/LS.py +0 -0
  24. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Recon/AOT_Optimizers/MAPEM.py +0 -0
  25. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Recon/AOT_Optimizers/MLEM.py +0 -0
  26. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Recon/AOT_Optimizers/PDHG.py +0 -0
  27. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Recon/AOT_Optimizers/__init__.py +0 -0
  28. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Recon/AOT_PotentialFunctions/Huber.py +0 -0
  29. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Recon/AOT_PotentialFunctions/Quadratic.py +0 -0
  30. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Recon/AOT_PotentialFunctions/RelativeDifferences.py +0 -0
  31. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Recon/AOT_PotentialFunctions/__init__.py +0 -0
  32. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Recon/AlgebraicRecon.py +0 -0
  33. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Recon/AnalyticRecon.py +0 -0
  34. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Recon/BayesianRecon.py +0 -0
  35. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Recon/DeepLearningRecon.py +0 -0
  36. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Recon/PrimalDualRecon.py +0 -0
  37. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Recon/ReconEnums.py +0 -0
  38. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Recon/ReconTools.py +0 -0
  39. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Recon/__init__.py +0 -0
  40. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/AOT_Recon/_mainRecon.py +0 -0
  41. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/Config.py +0 -0
  42. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps/Settings.py +0 -0
  43. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps.egg-info/SOURCES.txt +0 -0
  44. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps.egg-info/dependency_links.txt +0 -0
  45. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps.egg-info/requires.txt +0 -0
  46. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/AOT_biomaps.egg-info/top_level.txt +0 -0
  47. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/README.md +0 -0
  48. {aot_biomaps-2.9.215 → aot_biomaps-2.9.217}/setup.cfg +0 -0
@@ -293,25 +293,45 @@ class Experiment(ABC):
293
293
  if AOsignalPath.endswith(".cdh"):
294
294
  with open(AOsignalPath, "r") as file:
295
295
  cdh_content = file.readlines()
296
+
297
+ cdf_path = AOsignalPath.replace(".cdh", ".cdf")
296
298
 
297
- # Extraction des paramètres
298
- n_events = int([line.split(":")[1].strip() for line in cdh_content if "Number of events" in line][0])
299
- n_acquisitions = int([line.split(":")[1].strip() for line in cdh_content if "Number of acquisitions per event" in line][0])
299
+ # Extraire les paramètres depuis le fichier .cdh
300
+ n_scans = int([line.split(":")[1].strip() for line in cdh_content if "Number of events" in line][0])
301
+ n_acquisitions_per_event = int([line.split(":")[1].strip() for line in cdh_content if "Number of acquisitions per event" in line][0])
300
302
  num_elements = int([line.split(":")[1].strip() for line in cdh_content if "Number of US transducers" in line][0])
301
303
 
302
- # Initialisation avec la bonne forme : (n_acquisitions, n_events)
303
- AOsignal_matrix = np.zeros((n_acquisitions, n_events), dtype=np.float32)
304
+ print(f"Nombre de scans : {n_scans}")
305
+ print(f"Nombre d'acquisitions par événement : {n_acquisitions_per_event}")
306
+ print(f"Nombre d'éléments US : {num_elements}")
307
+
308
+
309
+ # Initialisation des structures
310
+ AO_signal = np.zeros((n_acquisitions_per_event, n_scans), dtype=np.float32)
311
+ active_lists = []
312
+ angles = []
313
+
314
+ # Lecture du fichier binaire
315
+ with open(cdf_path, "rb") as file:
316
+ for j in trange(n_scans, desc="Lecture des événements"):
317
+ # Lire l'activeList : 48 caractères hex = 24 bytes
318
+ active_list_bytes = file.read(24)
319
+ active_list_hex = active_list_bytes.hex()
320
+ active_lists.append(active_list_hex)
321
+
322
+ # Lire l'angle (1 byte signé)
323
+ angle_byte = file.read(1)
324
+ angle = np.frombuffer(angle_byte, dtype=np.int8)[0]
325
+ angles.append(angle)
326
+
327
+ # Lire le signal AO (float32)
328
+ data = np.frombuffer(file.read(n_acquisitions_per_event * 4), dtype=np.float32)
329
+ if len(data) != n_acquisitions_per_event:
330
+ raise ValueError(f"Erreur à l'événement {j} : attendu {n_acquisitions_per_event}, obtenu {len(data)}")
331
+ AO_signal[:, j] = data
304
332
 
305
- with open(AOsignalPath.replace(".cdh", ".cdf"), "rb") as file:
306
- hex_length = (num_elements + 3) // 4
307
- for event in range(n_events):
308
- file.read(hex_length // 2) # Sauter l'en-tête de l'événement
309
- signal = np.frombuffer(file.read(n_acquisitions * 4), dtype=np.float32)
310
- AOsignal_matrix[:, event] = signal # Remplir par colonne
311
-
312
- AOsignal_matrix = AOsignal_matrix
333
+ return AO_signal
313
334
 
314
- return AOsignal_matrix
315
335
 
316
336
  elif AOsignalPath.endswith(".npy"):
317
337
  return np.load(AOsignalPath) # Supposé déjà au bon format
@@ -345,10 +365,10 @@ class Experiment(ABC):
345
365
  header_content = (
346
366
  f"Data filename: {'AOSignals_withTumor.cdf' if withTumor else 'AOSignals_withoutTumor.cdf'}\n"
347
367
  f"Number of events: {nScan}\n"
348
- f"Number of acquisitions per event: {AO_signal.shape[1]}\n"
368
+ f"Number of acquisitions per event: {AO_signal.shape[0]}\n"
349
369
  f"Start time (s): 0\n"
350
370
  f"Duration (s): 1\n"
351
- f"Acquisition frequency (Hz): {1/self.AcousticFields[0].kgrid.dt}\n"
371
+ f"Acquisition frequency (Hz): {self.params.acoustic['f_saving']}\n"
352
372
  f"Data mode: histogram\n"
353
373
  f"Data type: AOT\n"
354
374
  f"Number of US transducers: {self.params.acoustic['num_elements']}"
@@ -82,7 +82,7 @@ from .AOT_Recon.AOT_PotentialFunctions.RelativeDifferences import *
82
82
  from .Config import config
83
83
  from .Settings import *
84
84
 
85
- __version__ = '2.9.215'
85
+ __version__ = '2.9.217'
86
86
  __process__ = config.get_process()
87
87
 
88
88
  def initialize(process=None):
@@ -249,6 +249,8 @@ def initialize(process=None):
249
249
 
250
250
 
251
251
 
252
+
253
+
252
254
 
253
255
 
254
256
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AOT_biomaps
3
- Version: 2.9.215
3
+ Version: 2.9.217
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
  Metadata-Version: 2.4
2
2
  Name: AOT_biomaps
3
- Version: 2.9.215
3
+ Version: 2.9.217
4
4
  Summary: Acousto-Optic Tomography
5
5
  Home-page: https://github.com/LucasDuclos/AcoustoOpticTomography
6
6
  Author: Lucas Duclos
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='AOT_biomaps',
5
- version='2.9.215',
5
+ version='2.9.217',
6
6
  packages=find_packages(),
7
7
  include_package_data=True,
8
8
  install_requires=[
@@ -224,6 +224,8 @@ setup(
224
224
 
225
225
 
226
226
 
227
+
228
+
227
229
 
228
230
 
229
231
 
File without changes
File without changes