IMSY-DKFZ / simpa

The Simulation and Image Processing for Photonics and Acoustics (SIMPA) toolkit.
https://simpa.readthedocs.io/en/main/
Other
73 stars 17 forks source link

Time_series #233

Closed mojgan-zare closed 12 months ago

mojgan-zare commented 1 year ago

in optical_and_acoustic_simulation code, when MATLAB file opens, the Matlab file wrote the name not exist and it closed then on the terminal wrote :

time_series_data, global_settings = self.k_wave_acoustic_forward_model( File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\acoustic_forward_module\acoustic_forward_module_k_wave_adapter.py", line 258, in k_wave_acoustic_forward_model raw_time_series_data = sio.loadmat(optical_path)[Tags.DATA_FIELD_TIME_SERIES_DATA] KeyError: 'time_series_data'

there is an error with access to time-series data or Matlab file. I can not understand it?!

kdreher commented 1 year ago

This looks like the time series file wasn't produced by k-wave/MATLAB. Could you maybe provide us with the full log-file of the simpa output? It might be the case that there was some error in k-wave/MATLAB. Maybe you can double-check if you installed MATLAB and k-wave properly?

mojgan-zare commented 1 year ago

Hi, Sure, I will send you the logs in my terminal.I hope this helps: 2023-08-04 12:35:05,611 - DEBUG - Running <class 'simpa.core.simulation_modules.optical_simulation_module.optical_forward_model_mcx_adapter.MCXAdapter'> 2023-08-04 12:35:05,611 - INFO - Simulating the optical forward process... 2023-08-04 12:35:07,028 - DEBUG - [-62. 50.5 0.5] {'Session': {'ID': '.\data\/CompletePipelineExample_4711_output', 'DoAutoThread': 1, 'Photons': 10000000.0, 'DoMismatch': 0, 'RNGSeed': 4711}, 'Forward': {'T0': 0, 'T1': 5e-09, 'Dt': 5e-09}, 'Optode': {'Source': {'Type': 'slit', 'Pos': [-62.0, 50.5, 0.5], 'Dir': [0.0, 0.0, 1.0], 'Param1': [500.0, 0.0, 0.0, 0], 'Param2': [0, 0, 0, 0]}}, 'Domain': {'OriginType': 0, 'LengthUnit': 0.2, 'Media': [{'mua': 0, 'mus': 0, 'g': 1, 'n': 1}, {'mua': 1, 'mus': 1, 'g': 0.9, 'n': 1}], 'MediaFormat': 'muamus_float', 'Dim': [375, 100, 125], 'VolumeFile': '.\data\/CompletePipelineExample_4711.bin'}} ###############################################################################

Monte Carlo eXtreme (MCX) -- CUDA

#

Copyright (c) 2009-2020 Qianqian Fang <q.fang at neu.edu>

#

http://mcx.space/

# # #

Computational Optics & Translational Imaging (COTI) Lab-

http://fanglab.org #

Department of Bioengineering, Northeastern University, Boston, MA, USA

# ###############################################################################

The MCX Project is funded by the NIH/NIGMS under grant R01-GM114365

# ############################################################################### $Rev::a6bc5a$ v2020 $Date::2020-09-07 13:18:12 -04$ by $Author::Qianqian Fang $ ###############################################################################

GPU=1 (GeForce 930MX) threadph=1627 extra=3712 np=10000000 nthread=6144 maxgate=1 repetition=1 initializing streams ... init complete : 13 ms requesting 1024 bytes of shared memory launching MCX simulation for time window [0.00e+000ns 5.00e+000ns] ... simulation run# 1 ... kernel complete: 34830 ms retrieving fields ... detected 0 photons, total: 0 transfer complete: 34866 ms normalizing raw data ... source 1, normalization factor alpha=0.000002 data normalization complete : 34951 ms saving data to file ... saving data complete : 34964 ms

simulated 10000000 photons (10000000) with 6144 threads (repeat x1) MCX simulation speed: 287.83 photon/ms total simulated energy: 10000000.00 absorbed: 23.38097% (loss due to initial specular reflection is excluded in the total) 2023-08-04 12:35:43,802 - INFO - Simulating the optical forward process...[Done] 2023-08-04 12:35:43,828 - DEBUG - Running <class 'simpa.core.processing_components.monospectral.noise.gaussian_noise.GaussianNoise'> 2023-08-04 12:35:43,829 - INFO - Applying Gaussian Noise Model... 2023-08-04 12:35:43,829 - DEBUG - Noise model mode: noise_mode_multiplicative 2023-08-04 12:35:43,830 - DEBUG - Noise model mean: 1 2023-08-04 12:35:43,831 - DEBUG - Noise model std: 0.01 2023-08-04 12:35:43,832 - DEBUG - Noise model non-negative: True 2023-08-04 12:35:44,127 - INFO - Applying Gaussian Noise Model...[Done] 2023-08-04 12:35:44,135 - DEBUG - Running <class 'simpa.core.simulation_modules.acoustic_forward_module.acoustic_forward_module_k_wave_adapter.KWaveAdapter'> 2023-08-04 12:35:44,137 - INFO - Simulating the acoustic forward process... 2023-08-04 12:35:44,137 - DEBUG - OPTICAL_PATH: /simulations/optical_forward_model_output/ 2023-08-04 12:35:44,207 - DEBUG - field_of_view_extent: [-15 15 0 0 0 20] 2023-08-04 12:35:44,210 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('detector_element_width_mm', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'detector_element_width_mm' has been given the value 0.24 2023-08-04 12:35:44,211 - DEBUG - Added parameter ('voxel_spacing_mm', <class 'numbers.Number'>) to kWave settings via global_settings 2023-08-04 12:35:44,212 - WARNING - Did not find parameter ('model_sensor_frequency_response', <class 'bool'>) in any settings. 2023-08-04 12:35:44,213 - DEBUG - Added parameter ('medium_alpha_power', <class 'numbers.Number'>) to kWave settings via componentsettings 2023-08-04 12:35:44,214 - DEBUG - Added parameter ('gpu', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via global_settings 2023-08-04 12:35:44,215 - DEBUG - Added parameter ('pml_inside', <class 'bool'>) to kWave settings via component_settings 2023-08-04 12:35:44,216 - DEBUG - Added parameter ('pml_alpha', <class 'numbers.Number'>) to kWave settings via component_settings 2023-08-04 12:35:44,216 - DEBUG - Added parameter ('plot_pml', <class 'bool'>) to kWave settings via component_settings 2023-08-04 12:35:44,217 - DEBUG - Added parameter ('recordmovie', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via component_settings 2023-08-04 12:35:44,217 - DEBUG - Added parameter ('movie_name', <class 'str'>) to kWave settings via component_settings 2023-08-04 12:35:44,218 - DEBUG - Added parameter ('acoustic_logscale', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via component_settings 2023-08-04 12:35:44,219 - WARNING - Did not find parameter sensor_directivity_pattern in any settings. 2023-08-04 12:35:44,220 - WARNING - Did not find parameter ('initial_pressure_smoothing', <class 'bool'>) in any settings. 2023-08-04 12:35:44,287 - INFO - Simulating 2D.... 2023-08-04 12:35:44,288 - INFO - ['C:\Program Files\MATLAB\R2022a\bin\matlab.exe', '-nodisplay', '-nosplash', '-automation', '-wait', '-r', "addpath('C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\acoustic_forward_module');simulate_2D('C:\Users\Admin\latest-simpa\data\CompletePipelineExample_4711.hdf5.mat');exit;"] Traceback (most recent call last): File "c:/Users/Admin/latest-simpa/simpa_examples/optical_and_acoustic_simulation.py", line 190, in sp.simulate(SIMULATION_PIPELINE, settings, device) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation.py", line 79, in simulate pipeline_element.run(digital_device_twin) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\acoustic_forward_module__init__.py", line 68, in run time_series_data = self.forward_model(_device) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\acoustic_forward_module\acoustic_forward_module_k_wave_adapter.py", line 121, in forward_model time_series_data, global_settings = self.k_wave_acoustic_forward_model( File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\acoustic_forward_module\acoustic_forward_module_k_wave_adapter.py", line 258, in k_wave_acoustic_forward_model raw_time_series_data = sio.loadmat(optical_path)[Tags.DATA_FIELD_TIME_SERIES_DATA] KeyError: 'time_series_data'

‫‪kdreher‬‏ @.***‬‏> در تاریخ جمعه ۴ اوت ۲۰۲۳ ساعت ۱۳:۱۸ نوشت:‬

This looks like the time series file wasn't produced by k-wave/MATLAB. Could you maybe provide us with the full log-file of the simpa output? It might be the case that there was some error in k-wave/MATLAB. Maybe you can double-check if you installed MATLAB and k-wave properly?

— Reply to this email directly, view it on GitHub https://github.com/IMSY-DKFZ/simpa/issues/233#issuecomment-1665339217, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBVTPCS3KDAH5TIOMD5R2ALXTTAQHANCNFSM6AAAAAA3D5TMAA . You are receiving this because you authored the thread.Message ID: @.***>

kdreher commented 1 year ago

Okay, yes this looks like MATLAB didn't start. Please make sure that MATLAB is fully installed on your system and that your provide the path to the matlab binary in the path_config.env file

mojgan-zare commented 1 year ago

Thanks. So Matlab start here but I faced with another error: ###############################################################################

Monte Carlo eXtreme (MCX) -- CUDA

#

Copyright (c) 2009-2020 Qianqian Fang <q.fang at neu.edu>

#

http://mcx.space/

# # #

Computational Optics & Translational Imaging (COTI) Lab-

http://fanglab.org #

Department of Bioengineering, Northeastern University, Boston, MA, USA

# ###############################################################################

The MCX Project is funded by the NIH/NIGMS under grant R01-GM114365

# ############################################################################### $Rev::a6bc5a$ v2020 $Date::2020-09-07 13:18:12 -04$ by $Author::Qianqian Fang $ ###############################################################################

GPU=1 (GeForce 930MX) threadph=1627 extra=3712 np=10000000 nthread=6144 maxgate=1 repetition=1 initializing streams ... init complete : 17 ms requesting 1024 bytes of shared memory launching MCX simulation for time window [0.00e+000ns 5.00e+000ns] ... simulation run# 1 ... kernel complete: 34758 ms retrieving fields ... detected 0 photons, total: 0 transfer complete: 34826 ms normalizing raw data ... source 1, normalization factor alpha=0.000002 data normalization complete : 35164 ms saving data to file ... saving data complete : 35190 ms

simulated 10000000 photons (10000000) with 6144 threads (repeat x1) MCX simulation speed: 288.07 photon/ms total simulated energy: 10000000.00 absorbed: 23.38097% (loss due to initial specular reflection is excluded in the total) 2023-08-11 17:58:51,550 - INFO - Simulating the optical forward process...[Done] 2023-08-11 17:58:51,590 - DEBUG - Running <class 'simpa.core.processing_components.monospectral.noise.gaussian_noise.GaussianNoise'> 2023-08-11 17:58:51,591 - INFO - Applying Gaussian Noise Model... 2023-08-11 17:58:51,593 - DEBUG - Noise model mode: noise_mode_multiplicative 2023-08-11 17:58:51,593 - DEBUG - Noise model mean: 1 2023-08-11 17:58:51,594 - DEBUG - Noise model std: 0.01 2023-08-11 17:58:51,595 - DEBUG - Noise model non-negative: True 2023-08-11 17:58:52,151 - INFO - Applying Gaussian Noise Model...[Done] 2023-08-11 17:58:52,173 - DEBUG - Running <class 'simpa.core.simulation_modules.acoustic_forward_module.acoustic_forward_module_k_wave_adapter.KWaveAdapter'> 2023-08-11 17:58:52,174 - INFO - Simulating the acoustic forward process... 2023-08-11 17:58:52,174 - DEBUG - OPTICAL_PATH: /simulations/optical_forward_model_output/ 2023-08-11 17:58:52,424 - DEBUG - field_of_view_extent: [-15 15 0 0 0 20] 2023-08-11 17:58:52,431 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('detector_element_width_mm', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'detector_element_width_mm' has been given the value 0.24 2023-08-11 17:58:52,433 - DEBUG - Added parameter ('voxel_spacing_mm', <class 'numbers.Number'>) to kWave settings via global_settings 2023-08-11 17:58:52,434 - WARNING - Did not find parameter ('model_sensor_frequency_response', <class 'bool'>) in any settings. 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('medium_alpha_power', <class 'numbers.Number'>) to kWave settings via componentsettings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('gpu', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via global_settings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('pml_inside', <class 'bool'>) to kWave settings via component_settings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('pml_alpha', <class 'numbers.Number'>) to kWave settings via component_settings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('plot_pml', <class 'bool'>) to kWave settings via component_settings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('recordmovie', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via component_settings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('movie_name', <class 'str'>) to kWave settings via component_settings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('acoustic_logscale', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via component_settings 2023-08-11 17:58:52,448 - WARNING - Did not find parameter sensor_directivity_pattern in any settings. 2023-08-11 17:58:52,452 - WARNING - Did not find parameter ('initial_pressure_smoothing', <class 'bool'>) in any settings. 2023-08-11 17:58:52,601 - INFO - Simulating 2D.... 2023-08-11 17:58:52,602 - INFO - ['C:\Program Files\MATLAB\R2022a\bin\win64\MATLAB.exe', '-nodisplay', '-nosplash', '-automation', '-wait', '-r', "addpath('C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\acoustic_forward_module');simulate_2D('C:\Users\Admin\latest-simpa\data\CompletePipelineExample_4711.hdf5.mat');exit;"] 2023-08-11 18:00:39,340 - INFO - Simulating the acoustic forward process...[Done] 2023-08-11 18:00:39,349 - DEBUG - Running <class 'simpa.core.processing_components.monospectral.noise.gaussian_noise.GaussianNoise'> 2023-08-11 18:00:39,350 - INFO - Applying Gaussian Noise Model... 2023-08-11 18:00:39,351 - DEBUG - Noise model mode: noise_mode_additive 2023-08-11 18:00:39,351 - DEBUG - Noise model mean: 0 2023-08-11 18:00:39,352 - DEBUG - Noise model std: 1 2023-08-11 18:00:39,352 - DEBUG - Noise model non-negative: False 2023-08-11 18:00:39,381 - INFO - Applying Gaussian Noise Model...[Done] 2023-08-11 18:00:39,382 - DEBUG - Running <class 'simpa.core.simulation_modules.reconstruction_module.reconstruction_module_time_reversal_adapter.TimeReversalAdapter'> 2023-08-11 18:00:39,382 - INFO - Performing reconstruction... 2023-08-11 18:00:39,395 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('dt', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'dt' has been given the value 2.5e-08 2023-08-11 18:00:39,396 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('Nt', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'Nt' has been given the value 2057 2023-08-11 18:00:39,406 - INFO - ['C:\Program Files\MATLAB\R2022a\bin\win64\MATLAB.exe', '-nodisplay', '-nosplash', '-automation', '-wait', '-r', "addpath('C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\reconstruction_module');time_reversal_2D('.\data\/CompletePipelineExample_4711.hdf5.mat');exit;"]

Traceback (most recent call last): File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 39, in _open_file return open(file_like, mode), True FileNotFoundError: [Errno 2] No such file or directory: '.\data\/CompletePipelineExample_4711.hdf5.mattr.mat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:/Users/Admin/latest-simpa/simpa_examples/optical_and_acoustic_simulation.py", line 190, in sp.simulate(SIMULATION_PIPELINE, settings, device) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation.py", line 79, in simulate pipeline_element.run(digital_device_twin) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\reconstruction_module__init.py", line 71, in run reconstruction = self.reconstruction_algorithm(time_series_sensor_data, _device) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\reconstruction_module\reconstruction_module_time_reversal_adapter.py", line 188, in reconstruction_algorithm reconstructed_data = sio.loadmat(acoustic_path + "tr.mat")[Tags.DATA_FIELD_RECONSTRUCTED_DATA] File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 225, in loadmat with _open_file_context(file_name, appendmat) as f: File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 113, in enter__ return next(self.gen) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 17, in _open_file_context f, opened = _open_file(file_like, appendmat, mode) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 45, in _open_file return open(file_like, mode), True FileNotFoundError: [Errno 2] No such file or directory: '.\data\/CompletePipelineExample_4711.hdf5.mattr.mat' PS C:\Users\Admin\latest-simpa>

‫‪kdreher‬‏ @.***‬‏> در تاریخ جمعه ۴ اوت ۲۰۲۳ ساعت ۱۴:۴۳ نوشت:‬

Okay, yes this looks like MATLAB didn't start. Please make sure that MATLAB is fully installed on your system and that your provide the path to the matlab binary in the path_config.env file

— Reply to this email directly, view it on GitHub https://github.com/IMSY-DKFZ/simpa/issues/233#issuecomment-1665441380, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBVTPCRB6PDJHCYXS7VL5W3XTTKL5ANCNFSM6AAAAAA3D5TMAA . You are receiving this because you authored the thread.Message ID: @.***>

mojgan-zare commented 1 year ago

Hi, Thank you. Could you please help me to debug this other error please? here Matlab opens for the first time and runs completely but for the second time it immediately closes.

###############################################################################

Monte Carlo eXtreme (MCX) -- CUDA

#

Copyright (c) 2009-2020 Qianqian Fang <q.fang at neu.edu>

#

http://mcx.space/

# # #

Computational Optics & Translational Imaging (COTI) Lab-

http://fanglab.org #

Department of Bioengineering, Northeastern University, Boston, MA, USA

# ###############################################################################

The MCX Project is funded by the NIH/NIGMS under grant R01-GM114365

# ############################################################################### $Rev::a6bc5a$ v2020 $Date::2020-09-07 13:18:12 -04$ by $Author::Qianqian Fang $ ###############################################################################

GPU=1 (GeForce 930MX) threadph=1627 extra=3712 np=10000000 nthread=6144 maxgate=1 repetition=1 initializing streams ... init complete : 18 ms requesting 1024 bytes of shared memory launching MCX simulation for time window [0.00e+000ns 5.00e+000ns] ... simulation run# 1 ... kernel complete: 35119 ms retrieving fields ... detected 0 photons, total: 0 transfer complete: 35155 ms normalizing raw data ... source 1, normalization factor alpha=0.000002 data normalization complete : 35314 ms saving data to file ... saving data complete : 35332 ms

simulated 10000000 photons (10000000) with 6144 threads (repeat x1) MCX simulation speed: 285.05 photon/ms total simulated energy: 10000000.00 absorbed: 23.38097% (loss due to initial specular reflection is excluded in the total) 2023-08-13 18:48:29,648 - INFO - Simulating the optical forward process...[Done] 2023-08-13 18:48:29,681 - DEBUG - Running <class 'simpa.core.processing_components.monospectral.noise.gaussian_noise.GaussianNoise'> 2023-08-13 18:48:29,683 - INFO - Applying Gaussian Noise Model... 2023-08-13 18:48:29,685 - DEBUG - Noise model mode: noise_mode_multiplicative 2023-08-13 18:48:29,686 - DEBUG - Noise model mean: 1 2023-08-13 18:48:29,687 - DEBUG - Noise model std: 0.01 2023-08-13 18:48:29,688 - DEBUG - Noise model non-negative: True 2023-08-13 18:48:30,226 - INFO - Applying Gaussian Noise Model...[Done] 2023-08-13 18:48:30,233 - DEBUG - Running <class 'simpa.core.simulation_modules.acoustic_forward_module.acoustic_forward_module_k_wave_adapter.KWaveAdapter'> 2023-08-13 18:48:30,236 - INFO - Simulating the acoustic forward process... 2023-08-13 18:48:30,238 - DEBUG - OPTICAL_PATH: /simulations/optical_forward_model_output/ 2023-08-13 18:48:30,367 - DEBUG - field_of_view_extent: [-15 15 0 0 0 20] 2023-08-13 18:48:30,372 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('detector_element_width_mm', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'detector_element_width_mm' has been given the value 0.24 2023-08-13 18:48:30,374 - DEBUG - Added parameter ('voxel_spacing_mm', <class 'numbers.Number'>) to kWave settings via global_settings 2023-08-13 18:48:30,375 - WARNING - Did not find parameter ('model_sensor_frequency_response', <class 'bool'>) in any settings. 2023-08-13 18:48:30,376 - DEBUG - Added parameter ('medium_alpha_power', <class 'numbers.Number'>) to kWave settings via componentsettings 2023-08-13 18:48:30,377 - DEBUG - Added parameter ('gpu', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via global_settings 2023-08-13 18:48:30,378 - DEBUG - Added parameter ('pml_inside', <class 'bool'>) to kWave settings via component_settings 2023-08-13 18:48:30,379 - DEBUG - Added parameter ('pml_alpha', <class 'numbers.Number'>) to kWave settings via component_settings 2023-08-13 18:48:30,380 - DEBUG - Added parameter ('plot_pml', <class 'bool'>) to kWave settings via component_settings 2023-08-13 18:48:30,380 - DEBUG - Added parameter ('recordmovie', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via component_settings 2023-08-13 18:48:30,381 - DEBUG - Added parameter ('movie_name', <class 'str'>) to kWave settings via component_settings 2023-08-13 18:48:30,382 - DEBUG - Added parameter ('acoustic_logscale', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via component_settings 2023-08-13 18:48:30,383 - WARNING - Did not find parameter sensor_directivity_pattern in any settings. 2023-08-13 18:48:30,384 - WARNING - Did not find parameter ('initial_pressure_smoothing', <class 'bool'>) in any settings. 2023-08-13 18:48:30,508 - INFO - Simulating 2D.... 2023-08-13 18:48:30,509 - INFO - ['C:\Program Files\MATLAB\R2022a\bin\win64\MATLAB.exe', '-nodisplay', '-nosplash', '-automation', '-wait', '-r', "addpath('C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\acoustic_forward_module');simulate_2D('C:\Users\Admin\latest-simpa\data\CompletePipelineExample_4711.hdf5.mat');exit;"] 2023-08-13 18:49:04,339 - INFO - Simulating the acoustic forward process...[Done] 2023-08-13 18:49:04,340 - DEBUG - Running <class 'simpa.core.processing_components.monospectral.noise.gaussian_noise.GaussianNoise'> 2023-08-13 18:49:04,341 - INFO - Applying Gaussian Noise Model... 2023-08-13 18:49:04,341 - DEBUG - Noise model mode: noise_mode_additive 2023-08-13 18:49:04,341 - DEBUG - Noise model mean: 0 2023-08-13 18:49:04,341 - DEBUG - Noise model std: 1 2023-08-13 18:49:04,341 - DEBUG - Noise model non-negative: False 2023-08-13 18:49:04,392 - INFO - Applying Gaussian Noise Model...[Done] 2023-08-13 18:49:04,392 - DEBUG - Running <class 'simpa.core.simulation_modules.reconstruction_module.reconstruction_module_time_reversal_adapter.TimeReversalAdapter'> 2023-08-13 18:49:04,392 - INFO - Performing reconstruction... 2023-08-13 18:49:04,422 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('dt', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'dt' has been given the value 2.5e-08 2023-08-13 18:49:04,425 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('Nt', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'Nt' has been given the value 2057 2023-08-13 18:49:04,445 - INFO - ['C:\Program Files\MATLAB\R2022a\bin\win64\MATLAB.exe', '-nodisplay', '-nosplash', '-automation', '-wait', '-r', "addpath('C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\reconstruction_module');time_reversal_2D('.\data\//CompletePipelineExample_4711.hdf5.mat');exit;"]

Traceback (most recent call last): File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 39, in _open_file return open(file_like, mode), True FileNotFoundError: [Errno 2] No such file or directory: '.\data\//CompletePipelineExample_4711.hdf5.mattr.mat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:/Users/Admin/latest-simpa/simpa_examples/optical_and_acoustic_simulation.py", line 190, in sp.simulate(SIMULATION_PIPELINE, settings, device) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation.py", line 79, in simulate pipeline_element.run(digital_device_twin) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\reconstruction_module__init.py", line 71, in run reconstruction = self.reconstruction_algorithm(time_series_sensor_data, _device) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\reconstruction_module\reconstruction_module_time_reversal_adapter.py", line 188, in reconstruction_algorithm reconstructed_data = sio.loadmat(acoustic_path + "tr.mat")[Tags.DATA_FIELD_RECONSTRUCTED_DATA] File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 225, in loadmat with _open_file_context(file_name, appendmat) as f: File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 113, in enter__ return next(self.gen) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 17, in _open_file_context f, opened = _open_file(file_like, appendmat, mode) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 45, in _open_file return open(file_like, mode), True FileNotFoundError: [Errno 2] No such file or directory: '.\data\//CompletePipelineExample_4711.hdf5.mattr.mat' PS C:\Users\Admin\latest-simpa>

‫‪ZAREI‬‏ @.***‬‏> در تاریخ جمعه ۱۱ اوت ۲۰۲۳ ساعت ۱۸:۰۲ نوشت:‬

Thanks. So Matlab start here but I faced with another error:

###############################################################################

Monte Carlo eXtreme (MCX) -- CUDA

#

Copyright (c) 2009-2020 Qianqian Fang <q.fang at neu.edu>

 #

http://mcx.space/

#

# #

Computational Optics & Translational Imaging (COTI) Lab-

http://fanglab.org #

Department of Bioengineering, Northeastern University, Boston, MA, USA

#

###############################################################################

The MCX Project is funded by the NIH/NIGMS under grant R01-GM114365

#

############################################################################### $Rev::a6bc5a$ v2020 $Date::2020-09-07 13:18:12 -04$ by $Author::Qianqian Fang $

###############################################################################

  • variant name: [Fermi] compiled by nvcc [7.5] with CUDA [7050]
  • compiled with: RNG [xorshift128+] with Seed Length [4]

GPU=1 (GeForce 930MX) threadph=1627 extra=3712 np=10000000 nthread=6144 maxgate=1 repetition=1 initializing streams ... init complete : 17 ms requesting 1024 bytes of shared memory launching MCX simulation for time window [0.00e+000ns 5.00e+000ns] ... simulation run# 1 ... kernel complete: 34758 ms retrieving fields ... detected 0 photons, total: 0 transfer complete: 34826 ms normalizing raw data ... source 1, normalization factor alpha=0.000002 data normalization complete : 35164 ms saving data to file ... saving data complete : 35190 ms

simulated 10000000 photons (10000000) with 6144 threads (repeat x1) MCX simulation speed: 288.07 photon/ms total simulated energy: 10000000.00 absorbed: 23.38097% (loss due to initial specular reflection is excluded in the total) 2023-08-11 17:58:51,550 - INFO - Simulating the optical forward process...[Done] 2023-08-11 17:58:51,590 - DEBUG - Running <class 'simpa.core.processing_components.monospectral.noise.gaussian_noise.GaussianNoise'> 2023-08-11 17:58:51,591 - INFO - Applying Gaussian Noise Model... 2023-08-11 17:58:51,593 - DEBUG - Noise model mode: noise_mode_multiplicative 2023-08-11 17:58:51,593 - DEBUG - Noise model mean: 1 2023-08-11 17:58:51,594 - DEBUG - Noise model std: 0.01 2023-08-11 17:58:51,595 - DEBUG - Noise model non-negative: True 2023-08-11 17:58:52,151 - INFO - Applying Gaussian Noise Model...[Done] 2023-08-11 17:58:52,173 - DEBUG - Running <class 'simpa.core.simulation_modules.acoustic_forward_module.acoustic_forward_module_k_wave_adapter.KWaveAdapter'> 2023-08-11 17:58:52,174 - INFO - Simulating the acoustic forward process... 2023-08-11 17:58:52,174 - DEBUG - OPTICAL_PATH: /simulations/optical_forward_model_output/ 2023-08-11 17:58:52,424 - DEBUG - field_of_view_extent: [-15 15 0 0 0 20] 2023-08-11 17:58:52,431 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('detector_element_width_mm', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'detector_element_width_mm' has been given the value 0.24 2023-08-11 17:58:52,433 - DEBUG - Added parameter ('voxel_spacing_mm', <class 'numbers.Number'>) to kWave settings via global_settings 2023-08-11 17:58:52,434 - WARNING - Did not find parameter ('model_sensor_frequency_response', <class 'bool'>) in any settings. 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('medium_alpha_power', <class 'numbers.Number'>) to kWave settings via componentsettings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('gpu', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via global_settings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('pml_inside', <class 'bool'>) to kWave settings via component_settings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('pml_alpha', <class 'numbers.Number'>) to kWave settings via component_settings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('plot_pml', <class 'bool'>) to kWave settings via component_settings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('recordmovie', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via component_settings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('movie_name', <class 'str'>) to kWave settings via component_settings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('acoustic_logscale', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via component_settings 2023-08-11 17:58:52,448 - WARNING - Did not find parameter sensor_directivity_pattern in any settings. 2023-08-11 17:58:52,452 - WARNING - Did not find parameter ('initial_pressure_smoothing', <class 'bool'>) in any settings. 2023-08-11 17:58:52,601 - INFO - Simulating 2D.... 2023-08-11 17:58:52,602 - INFO - ['C:\Program Files\MATLAB\R2022a\bin\win64\MATLAB.exe', '-nodisplay', '-nosplash', '-automation', '-wait', '-r', "addpath('C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\acoustic_forward_module');simulate_2D('C:\Users\Admin\latest-simpa\data\CompletePipelineExample_4711.hdf5.mat');exit;"] 2023-08-11 18:00:39,340 - INFO - Simulating the acoustic forward process...[Done] 2023-08-11 18:00:39,349 - DEBUG - Running <class 'simpa.core.processing_components.monospectral.noise.gaussian_noise.GaussianNoise'> 2023-08-11 18:00:39,350 - INFO - Applying Gaussian Noise Model... 2023-08-11 18:00:39,351 - DEBUG - Noise model mode: noise_mode_additive 2023-08-11 18:00:39,351 - DEBUG - Noise model mean: 0 2023-08-11 18:00:39,352 - DEBUG - Noise model std: 1 2023-08-11 18:00:39,352 - DEBUG - Noise model non-negative: False 2023-08-11 18:00:39,381 - INFO - Applying Gaussian Noise Model...[Done] 2023-08-11 18:00:39,382 - DEBUG - Running <class 'simpa.core.simulation_modules.reconstruction_module.reconstruction_module_time_reversal_adapter.TimeReversalAdapter'> 2023-08-11 18:00:39,382 - INFO - Performing reconstruction... 2023-08-11 18:00:39,395 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('dt', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'dt' has been given the value 2.5e-08 2023-08-11 18:00:39,396 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('Nt', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'Nt' has been given the value 2057 2023-08-11 18:00:39,406 - INFO - ['C:\Program Files\MATLAB\R2022a\bin\win64\MATLAB.exe', '-nodisplay', '-nosplash', '-automation', '-wait', '-r', "addpath('C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\reconstruction_module');time_reversal_2D('.\data\/CompletePipelineExample_4711.hdf5.mat');exit;"]

Traceback (most recent call last): File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 39, in _open_file return open(file_like, mode), True FileNotFoundError: [Errno 2] No such file or directory: '.\data\/CompletePipelineExample_4711.hdf5.mattr.mat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:/Users/Admin/latest-simpa/simpa_examples/optical_and_acoustic_simulation.py", line 190, in sp.simulate(SIMULATION_PIPELINE, settings, device) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation.py", line 79, in simulate pipeline_element.run(digital_device_twin) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\reconstruction_module__init.py", line 71, in run reconstruction = self.reconstruction_algorithm(time_series_sensor_data, _device) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\reconstruction_module\reconstruction_module_time_reversal_adapter.py", line 188, in reconstruction_algorithm reconstructed_data = sio.loadmat(acoustic_path + "tr.mat")[Tags.DATA_FIELD_RECONSTRUCTED_DATA] File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 225, in loadmat with _open_file_context(file_name, appendmat) as f: File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 113, in enter__ return next(self.gen) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 17, in _open_file_context f, opened = _open_file(file_like, appendmat, mode) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 45, in _open_file return open(file_like, mode), True FileNotFoundError: [Errno 2] No such file or directory: '.\data\/CompletePipelineExample_4711.hdf5.mattr.mat' PS C:\Users\Admin\latest-simpa>

‫‪kdreher‬‏ @.***‬‏> در تاریخ جمعه ۴ اوت ۲۰۲۳ ساعت ۱۴:۴۳ نوشت:‬

Okay, yes this looks like MATLAB didn't start. Please make sure that MATLAB is fully installed on your system and that your provide the path to the matlab binary in the path_config.env file

— Reply to this email directly, view it on GitHub https://github.com/IMSY-DKFZ/simpa/issues/233#issuecomment-1665441380, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBVTPCRB6PDJHCYXS7VL5W3XTTKL5ANCNFSM6AAAAAA3D5TMAA . You are receiving this because you authored the thread.Message ID: @.***>

mojgan-zare commented 1 year ago

I will send debug lines again with the first matlab file opened as an attachment. Thanks 2023-08-13 18:53:23,727 - DEBUG - Using $HOME$ path to search for config file: C:\Users\Admin\path_config.env 2023-08-13 18:53:23,730 - DEBUG - Did not find path config in $HOME$: C:\Users\Admin\path_config.env 2023-08-13 18:53:23,733 - DEBUG - Searching for path config in current working directory... 2023-08-13 18:53:23,735 - DEBUG - Found path_config.env in current working directory: C:\Users\Admin\latest-simpa\path_config.env 2023-08-13 18:53:23,744 - DEBUG - Retrieved SAVE_PATH=.\data\ 2023-08-13 18:53:23,915 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('Background', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'Background' has been given the value {'molecule_composition': [<simpa.utils.libraries.molecule_library.Molecule object at 0x0000024B0FEBFF40>], 'structure_type': 'Background'} 2023-08-13 18:53:24,064 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('muscle', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'muscle' has been given the value {('structure_start', (<class 'list'>, <class 'tuple'>, <class 'numpy.ndarray'>)): [0, 0, 0], ('structure_end', (<class 'list'>, <class 'tuple'>, <class 'numpy.ndarray'>)): [0, 0, 100], ('priority', <class 'numbers.Number'>): 1, ('molecule_composition', <class 'list'>): [<simpa.utils.libraries.molecule_library.Molecule object at 0x0000024B0FEBF5B0>], ('consider_partial_volume', <class 'bool'>): True, ('adhere_to_deformation', <class 'bool'>): True, ('structure_type', <class 'str'>): 'HorizontalLayerStructure'} 2023-08-13 18:53:24,321 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('epidermis', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'epidermis' has been given the value {('structure_start', (<class 'list'>, <class 'tuple'>, <class 'numpy.ndarray'>)): [0, 0, 1], ('structure_end', (<class 'list'>, <class 'tuple'>, <class 'numpy.ndarray'>)): [0, 0, 1.1], ('priority', <class 'numbers.Number'>): 8, ('molecule_composition', <class 'list'>): [<simpa.utils.libraries.molecule_library.Molecule object at 0x0000024B71846160>, <simpa.utils.libraries.molecule_library.Molecule object at 0x0000024B0FEE0EB0>], ('consider_partial_volume', <class 'bool'>): True, ('adhere_to_deformation', <class 'bool'>): True, ('structure_type', <class 'str'>): 'HorizontalLayerStructure'} 2023-08-13 18:53:24,627 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('vessel_1', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'vessel_1' has been given the value {('structure_start', (<class 'list'>, <class 'tuple'>, <class 'numpy.ndarray'>)): [27.5, 0, 5], ('structure_end', (<class 'list'>, <class 'tuple'>, <class 'numpy.ndarray'>)): [27.5, 20, 5], ('structure_radius', (<class 'numbers.Number'>, <class 'numpy.ndarray'>)): 2, ('priority', <class 'numbers.Number'>): 3, ('molecule_composition', <class 'list'>): [<simpa.utils.libraries.molecule_library.Molecule object at 0x0000024B0FEEC8E0>, <simpa.utils.libraries.molecule_library.Molecule object at 0x0000024B0FEECD90>], ('consider_partial_volume', <class 'bool'>): True, ('adhere_to_deformation', <class 'bool'>): False, ('structure_type', <class 'str'>): 'CircularTubularStructure'} 2023-08-13 18:53:24,994 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('vessel_2', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'vessel_2' has been given the value {('structure_start', (<class 'list'>, <class 'tuple'>, <class 'numpy.ndarray'>)): [37.5, 0, 10], ('structure_end', (<class 'list'>, <class 'tuple'>, <class 'numpy.ndarray'>)): [37.5, 20, 10], ('structure_radius', (<class 'numbers.Number'>, <class 'numpy.ndarray'>)): 3, ('priority', <class 'numbers.Number'>): 3, ('molecule_composition', <class 'list'>): [<simpa.utils.libraries.molecule_library.Molecule object at 0x0000024B0FEBF610>, <simpa.utils.libraries.molecule_library.Molecule object at 0x0000024B0FEBFE80>], ('consider_partial_volume', <class 'bool'>): True, ('adhere_to_deformation', <class 'bool'>): False, ('structure_type', <class 'str'>): 'CircularTubularStructure'} 2023-08-13 18:53:25,009 - DEBUG - Retrieved MCX_BINARY_PATH=C:\Users\Admin\Desktop\mcx\bin\mcx.exe 2023-08-13 18:53:25,017 - DEBUG - Retrieved MATLAB_BINARY_PATH=C:\Program Files\MATLAB\R2022a\bin\win64\MATLAB.exe 2023-08-13 18:53:25,024 - DEBUG - Retrieved MATLAB_BINARY_PATH=C:\Program Files\MATLAB\R2022a\bin\win64\MATLAB.exe 2023-08-13 18:53:25,031 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('sos', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'sos' has been given the value 1540 2023-08-13 18:53:25,040 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('alpha_coeff', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'alpha_coeff' has been given the value 0.01 2023-08-13 18:53:25,047 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('density', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'density' has been given the value 1000 2023-08-13 18:53:25,055 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('noise_initial_pressure', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'noise_initial_pressure' has been given the value {'noise_mean': 1, 'noise_std': 0.01, 'noise_mode': 'noise_mode_multiplicative', 'data_field': 'initial_pressure', 'noise_non_negativity_constraint': True} 2023-08-13 18:53:25,063 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('noise_time_series', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'noise_time_series' has been given the value {'noise_std': 1, 'noise_mode': 'noise_mode_additive', 'data_field': 'time_series_data'} [[-12.375 0. 0. ] [-12.125 0. 0. ] [-11.875 0. 0. ] [-11.625 0. 0. ] [-11.375 0. 0. ] [-11.125 0. 0. ] [-10.875 0. 0. ] [-10.625 0. 0. ] [-10.375 0. 0. ] [-10.125 0. 0. ] [ -9.875 0. 0. ] [ -9.625 0. 0. ] [ -9.375 0. 0. ] [ -9.125 0. 0. ] [ -8.875 0. 0. ] [ -8.625 0. 0. ] [ -8.375 0. 0. ] [ -8.125 0. 0. ] [ -7.875 0. 0. ] [ -7.625 0. 0. ] [ -7.375 0. 0. ] [ -7.125 0. 0. ] [ -6.875 0. 0. ] [ -6.625 0. 0. ] [ -6.375 0. 0. ] [ -6.125 0. 0. ] [ -5.875 0. 0. ] [ -5.625 0. 0. ] [ -5.375 0. 0. ] [ -5.125 0. 0. ] [ -4.875 0. 0. ] [ -4.625 0. 0. ] [ -4.375 0. 0. ] [ -4.125 0. 0. ] [ -3.875 0. 0. ] [ -3.625 0. 0. ] [ -3.375 0. 0. ] [ -3.125 0. 0. ] [ -2.875 0. 0. ] [ -2.625 0. 0. ] [ -2.375 0. 0. ] [ -2.125 0. 0. ] [ -1.875 0. 0. ] [ -1.625 0. 0. ] [ -1.375 0. 0. ] [ -1.125 0. 0. ] [ -0.875 0. 0. ] [ -0.625 0. 0. ] [ -0.375 0. 0. ] [ -0.125 0. 0. ] [ 0.125 0. 0. ] [ 0.375 0. 0. ] [ 0.625 0. 0. ] [ 0.875 0. 0. ] [ 1.125 0. 0. ] [ 1.375 0. 0. ] [ 1.625 0. 0. ] [ 1.875 0. 0. ] [ 2.125 0. 0. ] [ 2.375 0. 0. ] [ 2.625 0. 0. ] [ 2.875 0. 0. ] [ 3.125 0. 0. ] [ 3.375 0. 0. ] [ 3.625 0. 0. ] [ 3.875 0. 0. ] [ 4.125 0. 0. ] [ 4.375 0. 0. ] [ 4.625 0. 0. ] [ 4.875 0. 0. ] [ 5.125 0. 0. ] [ 5.375 0. 0. ] [ 5.625 0. 0. ] [ 5.875 0. 0. ] [ 6.125 0. 0. ] [ 6.375 0. 0. ] [ 6.625 0. 0. ] [ 6.875 0. 0. ] [ 7.125 0. 0. ] [ 7.375 0. 0. ] [ 7.625 0. 0. ] [ 7.875 0. 0. ] [ 8.125 0. 0. ] [ 8.375 0. 0. ] [ 8.625 0. 0. ] [ 8.875 0. 0. ] [ 9.125 0. 0. ] [ 9.375 0. 0. ] [ 9.625 0. 0. ] [ 9.875 0. 0. ] [ 10.125 0. 0. ] [ 10.375 0. 0. ] [ 10.625 0. 0. ] [ 10.875 0. 0. ] [ 11.125 0. 0. ] [ 11.375 0. 0. ] [ 11.625 0. 0. ] [ 11.875 0. 0. ] [ 12.125 0. 0. ] [ 12.375 0. 0. ]] 2023-08-13 18:53:25,241 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('data_field', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'data_field' has been given the value ['mua', 'mus', 'g', 'gamma', 'seg', 'oxy', 'density', 'sos', 'alpha_coeff', 'fluence', 'initial_pressure'] 2023-08-13 18:53:25,245 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('FieldOfViewCropping', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'FieldOfViewCropping' has been given the value {'data_field': ['mua', 'mus', 'g', 'gamma', 'seg', 'oxy', 'density', 'sos', 'alpha_coeff', 'fluence', 'initial_pressure']} heloooooooooooooooo {'random_seed': 4711, 'volume_name': 'CompletePipelineExample_4711', 'simulation_path': '.\data\', 'voxel_spacing_mm': 0.2, 'volume_z_dim_mm': 25, 'volume_x_dim_mm': 75, 'volume_y_dim_mm': 20, 'volume_creator': 'volume_creator_versatile', 'gpu': True, 'wavelengths': [700, 800], 'minimize_file_size': True, 'do_ipasc_export': True, 'volume_creation_model_settings': {'structures': {'Background': {'molecule_composition': [<simpa.utils.libraries.molecule_library.Molecule object at 0x0000024B0FEBFF40>], 'structure_type': 'Background'}, 'muscle': {('structure_start', (<class 'list'>, <class 'tuple'>, <class 'numpy.ndarray'>)): [0, 0, 0], ('structure_end', (<class 'list'>, <class 'tuple'>, <class 'numpy.ndarray'>)): [0, 0, 100], ('priority', <class 'numbers.Number'>): 1, ('molecule_composition', <class 'list'>): [<simpa.utils.libraries.molecule_library.Molecule object at 0x0000024B0FEBF5B0>], ('consider_partial_volume', <class 'bool'>): True, ('adhere_to_deformation', <class 'bool'>): True, ('structure_type', <class 'str'>): 'HorizontalLayerStructure'}, 'epidermis': {('structure_start', (<class 'list'>, <class 'tuple'>, <class 'numpy.ndarray'>)): [0, 0, 1], ('structure_end', (<class 'list'>, <class 'tuple'>, <class 'numpy.ndarray'>)): [0, 0, 1.1], ('priority', <class 'numbers.Number'>): 8, ('molecule_composition', <class 'list'>): [<simpa.utils.libraries.molecule_library.Molecule object at 0x0000024B71846160>, <simpa.utils.libraries.molecule_library.Molecule object at 0x0000024B0FEE0EB0>], ('consider_partial_volume', <class 'bool'>): True, ('adhere_to_deformation', <class 'bool'>): True, ('structure_type', <class 'str'>): 'HorizontalLayerStructure'}, 'vessel_1': {('structure_start', (<class 'list'>, <class 'tuple'>, <class 'numpy.ndarray'>)): [27.5, 0, 5], ('structure_end', (<class 'list'>, <class 'tuple'>, <class 'numpy.ndarray'>)): [27.5, 20, 5], ('structure_radius', (<class 'numbers.Number'>, <class 'numpy.ndarray'>)): 2, ('priority', <class 'numbers.Number'>): 3, ('molecule_composition', <class 'list'>): [<simpa.utils.libraries.molecule_library.Molecule object at 0x0000024B0FEEC8E0>, <simpa.utils.libraries.molecule_library.Molecule object at 0x0000024B0FEECD90>], ('consider_partial_volume', <class 'bool'>): True, ('adhere_to_deformation', <class 'bool'>): False, ('structure_type', <class 'str'>): 'CircularTubularStructure'}, 'vessel_2': {('structure_start', (<class 'list'>, <class 'tuple'>, <class 'numpy.ndarray'>)): [37.5, 0, 10], ('structure_end', (<class 'list'>, <class 'tuple'>, <class 'numpy.ndarray'>)): [37.5, 20, 10], ('structure_radius', (<class 'numbers.Number'>, <class 'numpy.ndarray'>)): 3, ('priority', <class 'numbers.Number'>): 3, ('molecule_composition', <class 'list'>): [<simpa.utils.libraries.molecule_library.Molecule object at 0x0000024B0FEBF610>, <simpa.utils.libraries.molecule_library.Molecule object at 0x0000024B0FEBFE80>], ('consider_partial_volume', <class 'bool'>): True, ('adhere_to_deformation', <class 'bool'>): False, ('structure_type', <class 'str'>): 'CircularTubularStructure'}}, 'simulate_deformed_layers': True}, 'optical_model_settings': {'optical_model_number_of_photons': 10000000.0, 'optical_model_binary_path': 'C:\Users\Admin\Desktop\mcx\bin\mcx.exe', 'optical_model_illumination_type': 'msot_acuity_echo', 'laser_pulse_energy_in_millijoule': 50, 'mcx_assumed_anisotropy': 0.9}, 'acoustic_model_settings': {'acoustic_simulation_3d': False, 'acoustic_model_binary_path': 'C:\Program Files\MATLAB\R2022a\bin\win64\MATLAB.exe', 'medium_alpha_power': 0.0, 'sensor_record': 'p', 'pml_inside': False, 'pml_size': [31, 32], 'pml_alpha': 1.5, 'plot_pml': False, 'record_movie': False, 'movie_name': 'visualization_log', 'acoustic_log_scale': True}, 'reconstruction_model_settings': {'reconstruction_perform_bandpass_filtering': False, 'acoustic_model_binary_path': 'C:\Program Files\MATLAB\R2022a\bin\win64\MATLAB.exe', 'acoustic_simulation_3d': False, 'medium_alpha_power': 0.0, 'tukey_window_alpha': 0.5, 'bandpass_cuttoff_lowpass_in_HZ': 8000000, 'bandpass_cuttoff_highpass_in_HZ': 1000, 'Envelope_Detection_after_Reconstruction': False, 'reconstruction_bmode_method': 'EnvelopeDetection', 'reconstruction_apodization_method': 'BoxApodization', 'reconstruction_mode': 'pressure', 'sensor_record': 'p', 'pml_inside': False, 'pml_size': [31, 32], 'pml_alpha': 1.5, 'plot_pml': False, 'record_movie': False, 'movie_name': 'visualization_log', 'acoustic_log_scale': True, 'sos': 1540, 'alpha_coeff': 0.01, 'density': 1000, 'voxel_spacing_mm': 0.2}, 'noise_initial_pressure': {'noise_mean': 1, 'noise_std': 0.01, 'noise_mode': 'noise_mode_multiplicative', 'data_field': 'initial_pressure', 'noise_non_negativity_constraint': True}, 'noise_time_series': {'noise_std': 1, 'noise_mode': 'noise_mode_additive', 'data_field': 'time_series_data'}, 'FieldOfViewCropping': {'data_field': ['mua', 'mus', 'g', 'gamma', 'seg', 'oxy', 'density', 'sos', 'alpha_coeff', 'fluence', 'initial_pressure']}} heloooooooooooooooo 2023-08-13 18:53:25,322 - DEBUG - Saving settings dictionary... 2023-08-13 18:53:27,159 - DEBUG - Saving settings dictionary...[Done] 2023-08-13 18:53:27,169 - DEBUG - Running pipeline for wavelength 700nm... 2023-08-13 18:53:27,172 - DEBUG - Running <class 'simpa.core.simulation_modules.volume_creation_module.volume_creation_module_model_based_adapter.ModelBasedVolumeCreationAdapter'> 2023-08-13 18:53:27,179 - INFO - VOLUME CREATION 2023-08-13 18:53:27,186 - DEBUG - Tags.SIMULATE_DEFORMED_LAYERS in self.component_settings is TRUE 2023-08-13 18:53:27,202 - DEBUG - This structure will simulate deformations: True 2023-08-13 18:53:27,212 - DEBUG - This structure's deformation functional: <scipy.interpolate._interpolate.interp2d object at 0x0000024B0FEF1700> 2023-08-13 18:53:27,445 - DEBUG - This structure will simulate deformations: True 2023-08-13 18:53:27,450 - DEBUG - This structure's deformation functional: <scipy.interpolate._interpolate.interp2d object at 0x0000024B0FEF1670> 2023-08-13 18:53:29,529 - DEBUG - This structure will simulate deformations: True 2023-08-13 18:53:29,547 - DEBUG - This structure's deformation functional: <scipy.interpolate._interpolate.interp2d object at 0x0000024B0FEF12E0> 2023-08-13 18:53:31,372 - DEBUG - This structure will simulate deformations: False 2023-08-13 18:53:31,382 - DEBUG - This structure's deformation functional: None 2023-08-13 18:53:37,254 - DEBUG - This structure will simulate deformations: False 2023-08-13 18:53:37,263 - DEBUG - This structure's deformation functional: None 2023-08-13 18:53:43,078 - DEBUG - <class 'simpa.utils.libraries.structure_library.HorizontalLayerStructure.HorizontalLayerStructure'> 2023-08-13 18:53:44,560 - DEBUG - <class 'simpa.utils.libraries.structure_library.CircularTubularStructure.CircularTubularStructure'> 2023-08-13 18:53:45,509 - DEBUG - <class 'simpa.utils.libraries.structure_library.CircularTubularStructure.CircularTubularStructure'> 2023-08-13 18:53:46,575 - DEBUG - <class 'simpa.utils.libraries.structure_library.HorizontalLayerStructure.HorizontalLayerStructure'> 2023-08-13 18:53:50,209 - DEBUG - <class 'simpa.utils.libraries.structure_library.BackgroundStructure.Background'> 2023-08-13 18:53:59,848 - DEBUG - Running <class 'simpa.core.simulation_modules.optical_simulation_module.optical_forward_model_mcx_adapter.MCXAdapter'> 2023-08-13 18:53:59,853 - INFO - Simulating the optical forward process... 2023-08-13 18:54:08,924 - DEBUG - [-62. 50.5 0.5] {'Session': {'ID': '.\data\/CompletePipelineExample_4711_output', 'DoAutoThread': 1, 'Photons': 10000000.0, 'DoMismatch': 0, 'RNGSeed': 4711}, 'Forward': {'T0': 0, 'T1': 5e-09, 'Dt': 5e-09}, 'Optode': {'Source': {'Type': 'slit', 'Pos': [-62.0, 50.5, 0.5], 'Dir': [0.0, 0.0, 1.0], 'Param1': [500.0, 0.0, 0.0, 0], 'Param2': [0, 0, 0, 0]}}, 'Domain': {'OriginType': 0, 'LengthUnit': 0.2, 'Media': [{'mua': 0, 'mus': 0, 'g': 1, 'n': 1}, {'mua': 1, 'mus': 1, 'g': 0.9, 'n': 1}], 'MediaFormat': 'muamus_float', 'Dim': [375, 100, 125], 'VolumeFile': '.\data\/CompletePipelineExample_4711.bin'}} ###############################################################################

Monte Carlo eXtreme (MCX) -- CUDA

#

Copyright (c) 2009-2020 Qianqian Fang <q.fang at neu.edu>

#

http://mcx.space/

# # #

Computational Optics & Translational Imaging (COTI) Lab-

http://fanglab.org #

Department of Bioengineering, Northeastern University, Boston, MA, USA

# ###############################################################################

The MCX Project is funded by the NIH/NIGMS under grant R01-GM114365

# ############################################################################### $Rev::a6bc5a$ v2020 $Date::2020-09-07 13:18:12 -04$ by $Author::Qianqian Fang $ ###############################################################################

GPU=1 (GeForce 930MX) threadph=1627 extra=3712 np=10000000 nthread=6144 maxgate=1 repetition=1 initializing streams ... init complete : 26 ms requesting 1024 bytes of shared memory launching MCX simulation for time window [0.00e+000ns 5.00e+000ns] ... simulation run# 1 ... kernel complete: 37063 ms retrieving fields ... detected 0 photons, total: 0 transfer complete: 37099 ms normalizing raw data ... source 1, normalization factor alpha=0.000002 data normalization complete : 37223 ms saving data to file ... saving data complete : 37276 ms

simulated 10000000 photons (10000000) with 6144 threads (repeat x1) MCX simulation speed: 270.25 photon/ms total simulated energy: 10000000.00 absorbed: 23.38097% (loss due to initial specular reflection is excluded in the total) 2023-08-13 18:55:27,478 - INFO - Simulating the optical forward process...[Done] 2023-08-13 18:55:27,623 - DEBUG - Running <class 'simpa.core.processing_components.monospectral.noise.gaussian_noise.GaussianNoise'> 2023-08-13 18:55:27,656 - INFO - Applying Gaussian Noise Model... 2023-08-13 18:55:27,700 - DEBUG - Noise model mode: noise_mode_multiplicative 2023-08-13 18:55:27,727 - DEBUG - Noise model mean: 1 2023-08-13 18:55:27,747 - DEBUG - Noise model std: 0.01 2023-08-13 18:55:27,778 - DEBUG - Noise model non-negative: True 2023-08-13 18:55:28,534 - INFO - Applying Gaussian Noise Model...[Done] 2023-08-13 18:55:28,537 - DEBUG - Running <class 'simpa.core.simulation_modules.acoustic_forward_module.acoustic_forward_module_k_wave_adapter.KWaveAdapter'> 2023-08-13 18:55:28,538 - INFO - Simulating the acoustic forward process... 2023-08-13 18:55:28,538 - DEBUG - OPTICAL_PATH: /simulations/optical_forward_model_output/ 2023-08-13 18:55:28,896 - DEBUG - field_of_view_extent: [-15 15 0 0 0 20] 2023-08-13 18:55:28,896 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('detector_element_width_mm', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'detector_element_width_mm' has been given the value 0.24 2023-08-13 18:55:28,896 - DEBUG - Added parameter ('voxel_spacing_mm', <class 'numbers.Number'>) to kWave settings via global_settings 2023-08-13 18:55:28,911 - WARNING - Did not find parameter ('model_sensor_frequency_response', <class 'bool'>) in any settings. 2023-08-13 18:55:28,924 - DEBUG - Added parameter ('medium_alpha_power', <class 'numbers.Number'>) to kWave settings via componentsettings 2023-08-13 18:55:28,928 - DEBUG - Added parameter ('gpu', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via global_settings 2023-08-13 18:55:28,935 - DEBUG - Added parameter ('pml_inside', <class 'bool'>) to kWave settings via component_settings 2023-08-13 18:55:28,942 - DEBUG - Added parameter ('pml_alpha', <class 'numbers.Number'>) to kWave settings via component_settings 2023-08-13 18:55:28,951 - DEBUG - Added parameter ('plot_pml', <class 'bool'>) to kWave settings via component_settings 2023-08-13 18:55:28,962 - DEBUG - Added parameter ('recordmovie', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via component_settings 2023-08-13 18:55:28,972 - DEBUG - Added parameter ('movie_name', <class 'str'>) to kWave settings via component_settings 2023-08-13 18:55:28,988 - DEBUG - Added parameter ('acoustic_logscale', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via component_settings 2023-08-13 18:55:29,002 - WARNING - Did not find parameter sensor_directivity_pattern in any settings. 2023-08-13 18:55:29,020 - WARNING - Did not find parameter ('initial_pressure_smoothing', <class 'bool'>) in any settings. 2023-08-13 18:55:29,157 - INFO - Simulating 2D.... 2023-08-13 18:55:29,158 - INFO - ['C:\Program Files\MATLAB\R2022a\bin\win64\MATLAB.exe', '-nodisplay', '-nosplash', '-automation', '-wait', '-r', "addpath('C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\acoustic_forward_module');simulate_2D('C:\Users\Admin\latest-simpa\data\CompletePipelineExample_4711.hdf5.mat');exit;"] 2023-08-13 18:56:05,579 - INFO - Simulating the acoustic forward process...[Done] 2023-08-13 18:56:05,579 - DEBUG - Running <class 'simpa.core.processing_components.monospectral.noise.gaussian_noise.GaussianNoise'> 2023-08-13 18:56:05,579 - INFO - Applying Gaussian Noise Model... 2023-08-13 18:56:05,579 - DEBUG - Noise model mode: noise_mode_additive 2023-08-13 18:56:05,579 - DEBUG - Noise model mean: 0 2023-08-13 18:56:05,579 - DEBUG - Noise model std: 1 2023-08-13 18:56:05,579 - DEBUG - Noise model non-negative: False 2023-08-13 18:56:05,599 - INFO - Applying Gaussian Noise Model...[Done] 2023-08-13 18:56:05,600 - DEBUG - Running <class 'simpa.core.simulation_modules.reconstruction_module.reconstruction_module_time_reversal_adapter.TimeReversalAdapter'> 2023-08-13 18:56:05,600 - INFO - Performing reconstruction... 2023-08-13 18:56:05,620 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('dt', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'dt' has been given the value 2.5e-08 2023-08-13 18:56:05,621 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('Nt', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'Nt' has been given the value 2057 2023-08-13 18:56:05,628 - INFO - ['C:\Program Files\MATLAB\R2022a\bin\win64\MATLAB.exe', '-nodisplay', '-nosplash', '-automation', '-wait', '-r', "addpath('C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\reconstruction_module');time_reversal_2D('.\data\/CompletePipelineExample_4711.hdf5.mat');exit;"]

Traceback (most recent call last): File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 39, in _open_file return open(file_like, mode), True FileNotFoundError: [Errno 2] No such file or directory: '.\data\/CompletePipelineExample_4711.hdf5.mattr.mat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:/Users/Admin/latest-simpa/simpa_examples/optical_and_acoustic_simulation.py", line 190, in sp.simulate(SIMULATION_PIPELINE, settings, device) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation.py", line 79, in simulate pipeline_element.run(digital_device_twin) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\reconstruction_module__init.py", line 71, in run reconstruction = self.reconstruction_algorithm(time_series_sensor_data, _device) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\reconstruction_module\reconstruction_module_time_reversal_adapter.py", line 188, in reconstruction_algorithm reconstructed_data = sio.loadmat(acoustic_path + "tr.mat")[Tags.DATA_FIELD_RECONSTRUCTED_DATA] File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 225, in loadmat with _open_file_context(file_name, appendmat) as f: File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 113, in enter__ return next(self.gen) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 17, in _open_file_context f, opened = _open_file(file_like, appendmat, mode) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 45, in _open_file return open(file_like, mode), True FileNotFoundError: [Errno 2] No such file or directory: '.\data\/CompletePipelineExample_4711.hdf5.mattr.mat' PS C:\Users\Admin\latest-simpa>

‫‪ZAREI‬‏ @.***‬‏> در تاریخ یکشنبه ۱۳ اوت ۲۰۲۳ ساعت ۱۸:۵۱ نوشت:‬

Hi, Thank you. Could you please help me to debug this other error please? here Matlab opens for the first time and runs completely but for the second time it immediately closes.

###############################################################################

Monte Carlo eXtreme (MCX) -- CUDA

#

Copyright (c) 2009-2020 Qianqian Fang <q.fang at neu.edu>

 #

http://mcx.space/

#

# #

Computational Optics & Translational Imaging (COTI) Lab-

http://fanglab.org #

Department of Bioengineering, Northeastern University, Boston, MA, USA

#

###############################################################################

The MCX Project is funded by the NIH/NIGMS under grant R01-GM114365

#

############################################################################### $Rev::a6bc5a$ v2020 $Date::2020-09-07 13:18:12 -04$ by $Author::Qianqian Fang $

###############################################################################

  • variant name: [Fermi] compiled by nvcc [7.5] with CUDA [7050]
  • compiled with: RNG [xorshift128+] with Seed Length [4]

GPU=1 (GeForce 930MX) threadph=1627 extra=3712 np=10000000 nthread=6144 maxgate=1 repetition=1 initializing streams ... init complete : 18 ms requesting 1024 bytes of shared memory launching MCX simulation for time window [0.00e+000ns 5.00e+000ns] ... simulation run# 1 ... kernel complete: 35119 ms retrieving fields ... detected 0 photons, total: 0 transfer complete: 35155 ms normalizing raw data ... source 1, normalization factor alpha=0.000002 data normalization complete : 35314 ms saving data to file ... saving data complete : 35332 ms

simulated 10000000 photons (10000000) with 6144 threads (repeat x1) MCX simulation speed: 285.05 photon/ms total simulated energy: 10000000.00 absorbed: 23.38097% (loss due to initial specular reflection is excluded in the total) 2023-08-13 18:48:29,648 - INFO - Simulating the optical forward process...[Done] 2023-08-13 18:48:29,681 - DEBUG - Running <class 'simpa.core.processing_components.monospectral.noise.gaussian_noise.GaussianNoise'> 2023-08-13 18:48:29,683 - INFO - Applying Gaussian Noise Model... 2023-08-13 18:48:29,685 - DEBUG - Noise model mode: noise_mode_multiplicative 2023-08-13 18:48:29,686 - DEBUG - Noise model mean: 1 2023-08-13 18:48:29,687 - DEBUG - Noise model std: 0.01 2023-08-13 18:48:29,688 - DEBUG - Noise model non-negative: True 2023-08-13 18:48:30,226 - INFO - Applying Gaussian Noise Model...[Done] 2023-08-13 18:48:30,233 - DEBUG - Running <class 'simpa.core.simulation_modules.acoustic_forward_module.acoustic_forward_module_k_wave_adapter.KWaveAdapter'> 2023-08-13 18:48:30,236 - INFO - Simulating the acoustic forward process... 2023-08-13 18:48:30,238 - DEBUG - OPTICAL_PATH: /simulations/optical_forward_model_output/ 2023-08-13 18:48:30,367 - DEBUG - field_of_view_extent: [-15 15 0 0 0 20] 2023-08-13 18:48:30,372 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('detector_element_width_mm', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'detector_element_width_mm' has been given the value 0.24 2023-08-13 18:48:30,374 - DEBUG - Added parameter ('voxel_spacing_mm', <class 'numbers.Number'>) to kWave settings via global_settings 2023-08-13 18:48:30,375 - WARNING - Did not find parameter ('model_sensor_frequency_response', <class 'bool'>) in any settings. 2023-08-13 18:48:30,376 - DEBUG - Added parameter ('medium_alpha_power', <class 'numbers.Number'>) to kWave settings via componentsettings 2023-08-13 18:48:30,377 - DEBUG - Added parameter ('gpu', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via global_settings 2023-08-13 18:48:30,378 - DEBUG - Added parameter ('pml_inside', <class 'bool'>) to kWave settings via component_settings 2023-08-13 18:48:30,379 - DEBUG - Added parameter ('pml_alpha', <class 'numbers.Number'>) to kWave settings via component_settings 2023-08-13 18:48:30,380 - DEBUG - Added parameter ('plot_pml', <class 'bool'>) to kWave settings via component_settings 2023-08-13 18:48:30,380 - DEBUG - Added parameter ('recordmovie', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via component_settings 2023-08-13 18:48:30,381 - DEBUG - Added parameter ('movie_name', <class 'str'>) to kWave settings via component_settings 2023-08-13 18:48:30,382 - DEBUG - Added parameter ('acoustic_logscale', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via component_settings 2023-08-13 18:48:30,383 - WARNING - Did not find parameter sensor_directivity_pattern in any settings. 2023-08-13 18:48:30,384 - WARNING - Did not find parameter ('initial_pressure_smoothing', <class 'bool'>) in any settings. 2023-08-13 18:48:30,508 - INFO - Simulating 2D.... 2023-08-13 18:48:30,509 - INFO - ['C:\Program Files\MATLAB\R2022a\bin\win64\MATLAB.exe', '-nodisplay', '-nosplash', '-automation', '-wait', '-r', "addpath('C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\acoustic_forward_module');simulate_2D('C:\Users\Admin\latest-simpa\data\CompletePipelineExample_4711.hdf5.mat');exit;"] 2023-08-13 18:49:04,339 - INFO - Simulating the acoustic forward process...[Done] 2023-08-13 18:49:04,340 - DEBUG - Running <class 'simpa.core.processing_components.monospectral.noise.gaussian_noise.GaussianNoise'> 2023-08-13 18:49:04,341 - INFO - Applying Gaussian Noise Model... 2023-08-13 18:49:04,341 - DEBUG - Noise model mode: noise_mode_additive 2023-08-13 18:49:04,341 - DEBUG - Noise model mean: 0 2023-08-13 18:49:04,341 - DEBUG - Noise model std: 1 2023-08-13 18:49:04,341 - DEBUG - Noise model non-negative: False 2023-08-13 18:49:04,392 - INFO - Applying Gaussian Noise Model...[Done] 2023-08-13 18:49:04,392 - DEBUG - Running <class 'simpa.core.simulation_modules.reconstruction_module.reconstruction_module_time_reversal_adapter.TimeReversalAdapter'> 2023-08-13 18:49:04,392 - INFO - Performing reconstruction... 2023-08-13 18:49:04,422 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('dt', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'dt' has been given the value 2.5e-08 2023-08-13 18:49:04,425 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('Nt', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'Nt' has been given the value 2057 2023-08-13 18:49:04,445 - INFO - ['C:\Program Files\MATLAB\R2022a\bin\win64\MATLAB.exe', '-nodisplay', '-nosplash', '-automation', '-wait', '-r', "addpath('C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\reconstruction_module');time_reversal_2D('.\data\//CompletePipelineExample_4711.hdf5.mat');exit;"]

Traceback (most recent call last): File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 39, in _open_file return open(file_like, mode), True FileNotFoundError: [Errno 2] No such file or directory: '.\data\//CompletePipelineExample_4711.hdf5.mattr.mat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:/Users/Admin/latest-simpa/simpa_examples/optical_and_acoustic_simulation.py", line 190, in sp.simulate(SIMULATION_PIPELINE, settings, device) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation.py", line 79, in simulate pipeline_element.run(digital_device_twin) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\reconstruction_module__init.py", line 71, in run reconstruction = self.reconstruction_algorithm(time_series_sensor_data, _device) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\reconstruction_module\reconstruction_module_time_reversal_adapter.py", line 188, in reconstruction_algorithm reconstructed_data = sio.loadmat(acoustic_path + "tr.mat")[Tags.DATA_FIELD_RECONSTRUCTED_DATA] File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 225, in loadmat with _open_file_context(file_name, appendmat) as f: File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 113, in enter__ return next(self.gen) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 17, in _open_file_context f, opened = _open_file(file_like, appendmat, mode) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 45, in _open_file return open(file_like, mode), True FileNotFoundError: [Errno 2] No such file or directory: '.\data\//CompletePipelineExample_4711.hdf5.mattr.mat' PS C:\Users\Admin\latest-simpa>

‫‪ZAREI‬‏ @.***‬‏> در تاریخ جمعه ۱۱ اوت ۲۰۲۳ ساعت ۱۸:۰۲ نوشت:‬

Thanks. So Matlab start here but I faced with another error:

###############################################################################

Monte Carlo eXtreme (MCX) -- CUDA

 #

Copyright (c) 2009-2020 Qianqian Fang <q.fang at neu.edu>

 #

http://mcx.space/

  #

# #

Computational Optics & Translational Imaging (COTI) Lab-

http://fanglab.org #

Department of Bioengineering, Northeastern University, Boston, MA,

USA #

###############################################################################

The MCX Project is funded by the NIH/NIGMS under grant R01-GM114365

 #

############################################################################### $Rev::a6bc5a$ v2020 $Date::2020-09-07 13:18:12 -04$ by $Author::Qianqian Fang $

###############################################################################

  • variant name: [Fermi] compiled by nvcc [7.5] with CUDA [7050]
  • compiled with: RNG [xorshift128+] with Seed Length [4]

GPU=1 (GeForce 930MX) threadph=1627 extra=3712 np=10000000 nthread=6144 maxgate=1 repetition=1 initializing streams ... init complete : 17 ms requesting 1024 bytes of shared memory launching MCX simulation for time window [0.00e+000ns 5.00e+000ns] ... simulation run# 1 ... kernel complete: 34758 ms retrieving fields ... detected 0 photons, total: 0 transfer complete: 34826 ms normalizing raw data ... source 1, normalization factor alpha=0.000002 data normalization complete : 35164 ms saving data to file ... saving data complete : 35190 ms

simulated 10000000 photons (10000000) with 6144 threads (repeat x1) MCX simulation speed: 288.07 photon/ms total simulated energy: 10000000.00 absorbed: 23.38097% (loss due to initial specular reflection is excluded in the total) 2023-08-11 17:58:51,550 - INFO - Simulating the optical forward process...[Done] 2023-08-11 17:58:51,590 - DEBUG - Running <class 'simpa.core.processing_components.monospectral.noise.gaussian_noise.GaussianNoise'> 2023-08-11 17:58:51,591 - INFO - Applying Gaussian Noise Model... 2023-08-11 17:58:51,593 - DEBUG - Noise model mode: noise_mode_multiplicative 2023-08-11 17:58:51,593 - DEBUG - Noise model mean: 1 2023-08-11 17:58:51,594 - DEBUG - Noise model std: 0.01 2023-08-11 17:58:51,595 - DEBUG - Noise model non-negative: True 2023-08-11 17:58:52,151 - INFO - Applying Gaussian Noise Model...[Done] 2023-08-11 17:58:52,173 - DEBUG - Running <class 'simpa.core.simulation_modules.acoustic_forward_module.acoustic_forward_module_k_wave_adapter.KWaveAdapter'> 2023-08-11 17:58:52,174 - INFO - Simulating the acoustic forward process... 2023-08-11 17:58:52,174 - DEBUG - OPTICAL_PATH: /simulations/optical_forward_model_output/ 2023-08-11 17:58:52,424 - DEBUG - field_of_view_extent: [-15 15 0 0 0 20] 2023-08-11 17:58:52,431 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('detector_element_width_mm', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'detector_element_width_mm' has been given the value 0.24 2023-08-11 17:58:52,433 - DEBUG - Added parameter ('voxel_spacing_mm', <class 'numbers.Number'>) to kWave settings via global_settings 2023-08-11 17:58:52,434 - WARNING - Did not find parameter ('model_sensor_frequency_response', <class 'bool'>) in any settings. 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('medium_alpha_power', <class 'numbers.Number'>) to kWave settings via componentsettings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('gpu', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via global_settings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('pml_inside', <class 'bool'>) to kWave settings via component_settings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('pml_alpha', <class 'numbers.Number'>) to kWave settings via component_settings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('plot_pml', <class 'bool'>) to kWave settings via component_settings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('recordmovie', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via component_settings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('movie_name', <class 'str'>) to kWave settings via component_settings 2023-08-11 17:58:52,438 - DEBUG - Added parameter ('acoustic_logscale', (<class 'bool'>, <class 'numpy.bool'>)) to kWave settings via component_settings 2023-08-11 17:58:52,448 - WARNING - Did not find parameter sensor_directivity_pattern in any settings. 2023-08-11 17:58:52,452 - WARNING - Did not find parameter ('initial_pressure_smoothing', <class 'bool'>) in any settings. 2023-08-11 17:58:52,601 - INFO - Simulating 2D.... 2023-08-11 17:58:52,602 - INFO - ['C:\Program Files\MATLAB\R2022a\bin\win64\MATLAB.exe', '-nodisplay', '-nosplash', '-automation', '-wait', '-r', "addpath('C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\acoustic_forward_module');simulate_2D('C:\Users\Admin\latest-simpa\data\CompletePipelineExample_4711.hdf5.mat');exit;"] 2023-08-11 18:00:39,340 - INFO - Simulating the acoustic forward process...[Done] 2023-08-11 18:00:39,349 - DEBUG - Running <class 'simpa.core.processing_components.monospectral.noise.gaussian_noise.GaussianNoise'> 2023-08-11 18:00:39,350 - INFO - Applying Gaussian Noise Model... 2023-08-11 18:00:39,351 - DEBUG - Noise model mode: noise_mode_additive 2023-08-11 18:00:39,351 - DEBUG - Noise model mean: 0 2023-08-11 18:00:39,352 - DEBUG - Noise model std: 1 2023-08-11 18:00:39,352 - DEBUG - Noise model non-negative: False 2023-08-11 18:00:39,381 - INFO - Applying Gaussian Noise Model...[Done] 2023-08-11 18:00:39,382 - DEBUG - Running <class 'simpa.core.simulation_modules.reconstruction_module.reconstruction_module_time_reversal_adapter.TimeReversalAdapter'> 2023-08-11 18:00:39,382 - INFO - Performing reconstruction... 2023-08-11 18:00:39,395 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('dt', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'dt' has been given the value 2.5e-08 2023-08-11 18:00:39,396 - WARNING - The key for the Settings dictionary should be a tuple in the form of ('Nt', (data_type_1, data_type_2, ...)). The tuple of data types specifies all possible types, the value can have. The key 'Nt' has been given the value 2057 2023-08-11 18:00:39,406 - INFO - ['C:\Program Files\MATLAB\R2022a\bin\win64\MATLAB.exe', '-nodisplay', '-nosplash', '-automation', '-wait', '-r', "addpath('C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\reconstruction_module');time_reversal_2D('.\data\/CompletePipelineExample_4711.hdf5.mat');exit;"]

Traceback (most recent call last): File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 39, in _open_file return open(file_like, mode), True FileNotFoundError: [Errno 2] No such file or directory: '.\data\/CompletePipelineExample_4711.hdf5.mattr.mat'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:/Users/Admin/latest-simpa/simpa_examples/optical_and_acoustic_simulation.py", line 190, in sp.simulate(SIMULATION_PIPELINE, settings, device) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation.py", line 79, in simulate pipeline_element.run(digital_device_twin) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\reconstruction_module__init.py", line 71, in run reconstruction = self.reconstruction_algorithm(time_series_sensor_data, _device) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\simpa\core\simulation_modules\reconstruction_module\reconstruction_module_time_reversal_adapter.py", line 188, in reconstruction_algorithm reconstructed_data = sio.loadmat(acoustic_path + "tr.mat")[Tags.DATA_FIELD_RECONSTRUCTED_DATA] File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 225, in loadmat with _open_file_context(file_name, appendmat) as f: File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 113, in enter__ return next(self.gen) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 17, in _open_file_context f, opened = _open_file(file_like, appendmat, mode) File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\scipy\io\matlab_mio.py", line 45, in _open_file return open(file_like, mode), True FileNotFoundError: [Errno 2] No such file or directory: '.\data\/CompletePipelineExample_4711.hdf5.mattr.mat' PS C:\Users\Admin\latest-simpa>

‫‪kdreher‬‏ @.***‬‏> در تاریخ جمعه ۴ اوت ۲۰۲۳ ساعت ۱۴:۴۳ نوشت:‬

Okay, yes this looks like MATLAB didn't start. Please make sure that MATLAB is fully installed on your system and that your provide the path to the matlab binary in the path_config.env file

— Reply to this email directly, view it on GitHub https://github.com/IMSY-DKFZ/simpa/issues/233#issuecomment-1665441380, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBVTPCRB6PDJHCYXS7VL5W3XTTKL5ANCNFSM6AAAAAA3D5TMAA . You are receiving this because you authored the thread.Message ID: @.***>

jgroehl commented 1 year ago

Hi @mojgan-zare , looks like the acoustic forward model is running through okay and now it crashes during image reconstruction using time reversal. We have added a hook to the MATLAB scripts that close the script on error to clean up the threads in case they are run on a server environment. You could take a look at the actual MATLAB output when commenting out this line in "time_reversal_2D.m":

https://github.com/IMSY-DKFZ/simpa/blob/main/simpa/core/simulation_modules/reconstruction_module/time_reversal_2D.m#L8

The output might give you an indication where the error is :) Please paste the MATLAB output here if you need help interpreting the error message!

lkeegan commented 1 year ago

It looks like this may be a relative path issue - for the first matlab run simpa does

        optical_path = optical_path + ".mat"
        optical_path = os.path.abspath(optical_path)

which gives simulate_2D('C:\\Users\\Admin\\latest-simpa\\data\\CompletePipelineExample_4711.hdf5.mat'); in matlab

But for the second one simpa only does

        acoustic_path = self.global_settings[Tags.SIMPA_OUTPUT_PATH] + ".mat"

which then gives time_reversal_2D('.\\data\\//CompletePipelineExample_4711.hdf5.mat') in matlab.

So maybe adding acoustic_path = os.path.abspath(acoustic_path) below this line would fix this?

https://github.com/IMSY-DKFZ/simpa/blob/6278d01a64f886bb92502fe126be90fd75e1be32/simpa/core/simulation_modules/reconstruction_module/reconstruction_module_time_reversal_adapter.py#L130

mojgan-zare commented 1 year ago

Hi, Thanks for your response, I did all of this work but again I faced that error! :(

‫‪Liam Keegan‬‏ @.***‬‏> در تاریخ دوشنبه ۱۴ اوت ۲۰۲۳ ساعت ۱۱:۰۹ نوشت:‬

It looks like this may be a relative path issue - for the first matlab run simpa does

    optical_path = optical_path + ".mat"
    optical_path = os.path.abspath(optical_path)

which gives simulate_2D('C:\Users\Admin\latest-simpa\data\CompletePipelineExample_4711.hdf5.mat'); in matlab

But for the second one simpa only does

    acoustic_path = self.global_settings[Tags.SIMPA_OUTPUT_PATH] + ".mat"

which then gives time_reversal_2D('.\data\//CompletePipelineExample_4711.hdf5.mat') in matlab.

So maybe adding acoustic_path = os.path.abspath(acoustic_path) below this line would fix this?

https://github.com/IMSY-DKFZ/simpa/blob/6278d01a64f886bb92502fe126be90fd75e1be32/simpa/core/simulation_modules/reconstruction_module/reconstruction_module_time_reversal_adapter.py#L130

— Reply to this email directly, view it on GitHub https://github.com/IMSY-DKFZ/simpa/issues/233#issuecomment-1676828431, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBVTPCXVGLBKHWNYBYZYEX3XVHI2HANCNFSM6AAAAAA3D5TMAA . You are receiving this because you were mentioned.Message ID: @.***>