Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add a faster solver. Add a new class to allow the user to optimize the currents with scipy.optimize.minimize by using the residuals_mse function, and the jacobian of it * Use the smaller dataset * Faster the sequencer 1) Removed the multiprocessing, if the user is using a mac (Spawn method makes the optimization slower) 2) If there is no correction in a slice then it's possible to reduce the calculation time of _eval_static_shim and _cal_anat_orient. By not making all of the time consumming process. * Make _plot_coef faster Removes all of the useless subplot where there is no corrections. Change the size of the figure to make it smaller if there is less subplot to show Add a subplot to show an example of the current correction in an unshimmed slice If the bounds are the same in every channel, then don't display it for all of them, but instead plot a single line to represent all of them * Creating the Shimmed anat orient faster -Reshape the coils_anat matrix into a 2D matrix -Change the dimension of the correction matrix to a 2D one (This allow to make the calculation a lot faster, by removing a dimension for the np.sum) - Make a list of the slices to shim to make the code faster and more readable * Fixed a typo mistake in calc_shimmed_anat_orient * Make sure that the merge with master is working Use the new opt_criteria from master In Eval_static_shim, only print in the debugging if there is a correction in a slice * Make sure that the optimization is working with the merge Inplement a jacobian when the function to minimize is mse Delete lsq_faster_solver which is now obsolet * Fix all of the problem with the merging Removed all of the comment about least-squares-faster Fixed some typo problem Put opt_criteria, everytime that the optimize function is called * Removed the jacobian in real time shimming * Removed an useless test * Syntax of comment Co-authored-by: Alex Dastous <47249340+po09i@users.noreply.github.com> * Fixed a mispell in a comment Co-authored-by: Alex Dastous <47249340+po09i@users.noreply.github.com> * Fixed syntax in a comment Co-authored-by: Alex Dastous <47249340+po09i@users.noreply.github.com> * Fixed syntax in a comment Co-authored-by: Alex Dastous <47249340+po09i@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Alex Dastous <47249340+po09i@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Alex Dastous <47249340+po09i@users.noreply.github.com> * Fixed a problem with the reviews changes * Apply the review changes Put a continue in the for loop of eval_static_shim Apply the correct indentation * Fixed the bug in plot_coefs + changes in calc_shimmed_anat_orient make sure that the program doesn't crash if the slices dimension is different than 1 * Fixed the cases where all the slices are shim in plot_coefs * Put Multiprocessing for every dataset (May change) * Refactor _plot_coefs * Refactor optimizer * Small fixups * Comment mp bug that outputs debug even when not in debug * Move plotting of currents after saving the coefficients * Remove newline Co-authored-by: Alex Dastous <47249340+po09i@users.noreply.github.com> Co-authored-by: Alexandre D'Astous <po09i@hotmail.com>
- Loading branch information
1 parent
f577494
commit ceb5fd5
Showing
5 changed files
with
213 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.