Concerning the computational time for the simulated field :
To estimate the computational time for the algorithm loop, I have used the library time and started the timer before entering the "while self.running:" loop and stopped it "end_time = time.time()" right after the user pressed the stop button of the algo.
- If we dispaly the fields (input, output) and metrics at each step of the algorithm it took 15.81 seconds for 10 iterations in the GS with quadratic phase.
- I have commented the lines "self.algo_output_signal.emit(self.algo.get_fields_to_plot())" and "QtCore.QThread.msleep(20)" in the algorithm_app.py file in the function continuous_algo() to avoid the plots at each iterations. And for 10 iterations in the GS with a converging initial phase it took 11.31 seconds. I also added the "self.algo_output_signal.emit(self.algo.get_fields_to_plot())" line after the algorithm's loops is done to plot the final distribution. But obviously, for the metrics it also only display the last value and not the total curve.
4seconds difference for 10 iterations is clearly not negligeable for faster computational time and for a more fluid user experience.
Concerning the scripting ideas :
Would be great to be able to give a field and call a certain algorithm by specifying the name and the number of iterations needed.
We could store :
- A single time the input field (amplitude/phase)
- A single time the target (amplitude/phase) with ROI slice
- The metric value at each step of the algorithm
- The phase of the SLM (or the squared shape matrix computed by the algo) at each step
- The final amplitude/phase in the ouput plane when the maximum iteration number is reached
Maybe this can be a parameter for the user to check (if needed or not). Because for a real experiment, usually the user would want to only store the phase profile used for the data acquisition. (If we constantly save each computated phase, it can be overwhelming for the data treatment?)
Could be also great to have a parameter to earase the metric curve (accessible directly in the script). Like so, if the user wants to have 1 NRMSE for each algorithm loop he can.
Concerning the computational time for the simulated field :
To estimate the computational time for the algorithm loop, I have used the library time and started the timer before entering the "while self.running:" loop and stopped it "end_time = time.time()" right after the user pressed the stop button of the algo.
4seconds difference for 10 iterations is clearly not negligeable for faster computational time and for a more fluid user experience.
Concerning the scripting ideas :
Would be great to be able to give a field and call a certain algorithm by specifying the name and the number of iterations needed.
We could store :
Maybe this can be a parameter for the user to check (if needed or not). Because for a real experiment, usually the user would want to only store the phase profile used for the data acquisition. (If we constantly save each computated phase, it can be overwhelming for the data treatment?)
Could be also great to have a parameter to earase the metric curve (accessible directly in the script). Like so, if the user wants to have 1 NRMSE for each algorithm loop he can.