AOT-biomaps 2.9.221__tar.gz → 2.9.222__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.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Recon/AlgebraicRecon.py +97 -4
  2. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/__init__.py +2 -1
  3. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps.egg-info/PKG-INFO +1 -1
  4. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/PKG-INFO +1 -1
  5. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/setup.py +2 -1
  6. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Acoustic/AcousticEnums.py +0 -0
  7. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Acoustic/AcousticTools.py +0 -0
  8. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Acoustic/FocusedWave.py +0 -0
  9. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Acoustic/IrregularWave.py +0 -0
  10. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Acoustic/PlaneWave.py +0 -0
  11. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Acoustic/StructuredWave.py +0 -0
  12. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Acoustic/__init__.py +0 -0
  13. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Acoustic/_mainAcoustic.py +0 -0
  14. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Experiment/Focus.py +0 -0
  15. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Experiment/Tomography.py +0 -0
  16. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Experiment/__init__.py +0 -0
  17. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Experiment/_mainExperiment.py +0 -0
  18. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Optic/Absorber.py +0 -0
  19. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Optic/Laser.py +0 -0
  20. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Optic/OpticEnums.py +0 -0
  21. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Optic/__init__.py +0 -0
  22. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Optic/_mainOptic.py +0 -0
  23. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Recon/AOT_Optimizers/DEPIERRO.py +0 -0
  24. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Recon/AOT_Optimizers/LS.py +0 -0
  25. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Recon/AOT_Optimizers/MAPEM.py +0 -0
  26. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Recon/AOT_Optimizers/MLEM.py +0 -0
  27. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Recon/AOT_Optimizers/PDHG.py +0 -0
  28. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Recon/AOT_Optimizers/__init__.py +0 -0
  29. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Recon/AOT_PotentialFunctions/Huber.py +0 -0
  30. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Recon/AOT_PotentialFunctions/Quadratic.py +0 -0
  31. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Recon/AOT_PotentialFunctions/RelativeDifferences.py +0 -0
  32. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Recon/AOT_PotentialFunctions/__init__.py +0 -0
  33. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Recon/AnalyticRecon.py +0 -0
  34. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Recon/BayesianRecon.py +0 -0
  35. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Recon/DeepLearningRecon.py +0 -0
  36. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Recon/PrimalDualRecon.py +0 -0
  37. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Recon/ReconEnums.py +0 -0
  38. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Recon/ReconTools.py +0 -0
  39. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Recon/__init__.py +0 -0
  40. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/AOT_Recon/_mainRecon.py +0 -0
  41. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/Config.py +0 -0
  42. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps/Settings.py +0 -0
  43. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps.egg-info/SOURCES.txt +0 -0
  44. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps.egg-info/dependency_links.txt +0 -0
  45. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps.egg-info/requires.txt +0 -0
  46. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/AOT_biomaps.egg-info/top_level.txt +0 -0
  47. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/README.md +0 -0
  48. {aot_biomaps-2.9.221 → aot_biomaps-2.9.222}/setup.cfg +0 -0
@@ -676,7 +676,8 @@ class AlgebraicRecon(Recon):
676
676
 
677
677
  return (False, results_dir)
678
678
 
679
- def load(self, processType = ProcessType.PYTHON, withTumor=True, results_date=None, optimizer=None, filePath=None):
679
+
680
+ def load(self, withTumor=True, results_date=None, optimizer=None, filePath=None):
680
681
  """
681
682
  Load the reconstruction results (reconPhantom or reconLaser) and indices as lists of 2D np arrays into self.
682
683
  If the loaded file is a 3D array, it is split into a list of 2D arrays.
@@ -686,9 +687,101 @@ class AlgebraicRecon(Recon):
686
687
  optimizer: Optimizer name (as string or enum) to filter results. If None, uses the current optimizer of the instance.
687
688
  filePath: Optional. If provided, loads directly from this path (overrides saveDir and results_date).
688
689
  """
689
-
690
- pass
691
- # print(f"Loaded reconstruction results and indices from {results_dir}")
690
+ if filePath is not None:
691
+ # Mode chargement direct depuis un fichier
692
+ recon_key = 'reconPhantom' if withTumor else 'reconLaser'
693
+ recon_path = filePath
694
+ if not os.path.exists(recon_path):
695
+ raise FileNotFoundError(f"No reconstruction file found at {recon_path}.")
696
+ # Charge le fichier (3D ou liste de 2D)
697
+ data = np.load(recon_path, allow_pickle=True)
698
+ # Découpe en liste de 2D si c'est un tableau 3D
699
+ if isinstance(data, np.ndarray) and data.ndim == 3:
700
+ if withTumor:
701
+ self.reconPhantom = [data[i, :, :] for i in range(data.shape[0])]
702
+ else:
703
+ self.reconLaser = [data[i, :, :] for i in range(data.shape[0])]
704
+ else:
705
+ # Sinon, suppose que c'est déjà une liste de 2D
706
+ if withTumor:
707
+ self.reconPhantom = data
708
+ else:
709
+ self.reconLaser = data
710
+ # Essayer de charger les indices
711
+ base_dir, _ = os.path.split(recon_path)
712
+ indices_path = os.path.join(base_dir, 'indices.npy')
713
+ if os.path.exists(indices_path):
714
+ indices_data = np.load(indices_path, allow_pickle=True)
715
+ if isinstance(indices_data, np.ndarray) and indices_data.ndim == 3:
716
+ self.indices = [indices_data[i, :, :] for i in range(indices_data.shape[0])]
717
+ else:
718
+ self.indices = indices_data
719
+ else:
720
+ self.indices = None
721
+ print(f"Loaded reconstruction results and indices from {recon_path}")
722
+ else:
723
+ # Mode chargement depuis le répertoire de résultats
724
+ if self.saveDir is None:
725
+ raise ValueError("Save directory is not specified. Please set saveDir before loading.")
726
+ # Use current optimizer and potential function if not provided
727
+ opt_name = optimizer.value if optimizer is not None else self.optimizer.value
728
+ # Build the base directory pattern
729
+ dir_pattern = f'results_*_{opt_name}'
730
+ # Add parameters to the pattern based on the optimizer
731
+ if optimizer is None:
732
+ optimizer = self.optimizer
733
+ if optimizer == OptimizerType.PPGMLEM:
734
+ beta_str = f'_Beta_{self.beta}'
735
+ delta_str = f'_Delta_{self.delta}'
736
+ gamma_str = f'_Gamma_{self.gamma}'
737
+ sigma_str = f'_Sigma_{self.sigma}'
738
+ dir_pattern += f'{beta_str}{delta_str}{gamma_str}{sigma_str}'
739
+ elif optimizer in (OptimizerType.PGC, OptimizerType.DEPIERRO95):
740
+ beta_str = f'_Beta_{self.beta}'
741
+ sigma_str = f'_Sigma_{self.sigma}'
742
+ dir_pattern += f'{beta_str}{sigma_str}'
743
+ # Find the most recent results directory if no date is specified
744
+ if results_date is None:
745
+ dirs = [d for d in os.listdir(self.saveDir) if os.path.isdir(os.path.join(self.saveDir, d)) and dir_pattern in d]
746
+ if not dirs:
747
+ raise FileNotFoundError(f"No matching results directory found for pattern '{dir_pattern}' in {self.saveDir}.")
748
+ dirs.sort(reverse=True) # Most recent first
749
+ results_dir = os.path.join(self.saveDir, dirs[0])
750
+ else:
751
+ results_dir = os.path.join(self.saveDir, f'results_{results_date}_{opt_name}')
752
+ if optimizer == OptimizerType.MLEM:
753
+ pass
754
+ elif optimizer == OptimizerType.LS:
755
+ results_dir += f'_Alpha_{self.alpha}'
756
+ if not os.path.exists(results_dir):
757
+ raise FileNotFoundError(f"Directory {results_dir} does not exist.")
758
+ # Load reconstruction results
759
+ recon_key = 'reconPhantom' if withTumor else 'reconLaser'
760
+ recon_path = os.path.join(results_dir, f'{recon_key}.npy')
761
+ if not os.path.exists(recon_path):
762
+ raise FileNotFoundError(f"No reconstruction file found at {recon_path}.")
763
+ data = np.load(recon_path, allow_pickle=True)
764
+ if isinstance(data, np.ndarray) and data.ndim == 3:
765
+ if withTumor:
766
+ self.reconPhantom = [data[i, :, :] for i in range(data.shape[0])]
767
+ else:
768
+ self.reconLaser = [data[i, :, :] for i in range(data.shape[0])]
769
+ else:
770
+ if withTumor:
771
+ self.reconPhantom = data
772
+ else:
773
+ self.reconLaser = data
774
+ # Load saved indices as list of 2D arrays
775
+ indices_path = os.path.join(results_dir, 'indices.npy')
776
+ if not os.path.exists(indices_path):
777
+ raise FileNotFoundError(f"No indices file found at {indices_path}.")
778
+ indices_data = np.load(indices_path, allow_pickle=True)
779
+ if isinstance(indices_data, np.ndarray) and indices_data.ndim == 3:
780
+ self.indices = [indices_data[i, :, :] for i in range(indices_data.shape[0])]
781
+ else:
782
+ self.indices = indices_data
783
+ print(f"Loaded reconstruction results and indices from {results_dir}")
784
+
692
785
 
693
786
  def normalizeSMatrix(self):
694
787
  self.SMatrix = self.SMatrix / (float(self.experiment.params.acoustic['voltage'])*float(self.experiment.params.acoustic['sensitivity']))
@@ -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.221'
85
+ __version__ = '2.9.222'
86
86
  __process__ = config.get_process()
87
87
 
88
88
  def initialize(process=None):
@@ -256,5 +256,6 @@ def initialize(process=None):
256
256
 
257
257
 
258
258
 
259
+
259
260
 
260
261
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AOT_biomaps
3
- Version: 2.9.221
3
+ Version: 2.9.222
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.221
3
+ Version: 2.9.222
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.221',
5
+ version='2.9.222',
6
6
  packages=find_packages(),
7
7
  include_package_data=True,
8
8
  install_requires=[
@@ -231,5 +231,6 @@ setup(
231
231
 
232
232
 
233
233
 
234
+
234
235
 
235
236
 
File without changes
File without changes