-
-
Notifications
You must be signed in to change notification settings - Fork 5
Considering moving to Python #158
Comments
Pros: |
https://numpy.org/devdocs/user/numpy-for-matlab-users.html helps move from matlab to python for scientific computation. |
Optimization algorithms in python: |
It really isn't that difficult of a transition (MATLAB->Python, not rewriting code) in my opinion - you just need to know/find which tools have the functions that you're used to using in MATLAB. Also know that everything in Python is a class object "underneath the hood". The biggest hurdle is if any of your features depend on a tool that was written for MATLAB - rewriting that tool is likely out of the question, so you either have to find a replacement or give up on that feature. And once you switch from MATLAB to Python, the added features that @jcohenadad listed and many more (e.g. a very active open-source community, jupyter notebooks, binder, plotly, etc.) will make your life so much easier that you might never want to turn back... |
Strategy is to:
|
For an example, to port the b0 map step, I would start by making this CLI:
For some starter code, you can use
On mac/linux you can put that into "b0maps" and then run it like:
On Windows the first line, the "shebang", doesn't work, but you can save it to
|
thank you for the head start here shimming-toolbox/shimming-toolbox#158 (comment) @kousu. however, i would suggest to separate CLIs as much as possible, i.e. not mix dcm2nii conversion and b0map fitting (because we know that later one these will have to be separated anyway) how about following the latest examples we did? @gaspardcereza @po09i are working on example scenario scripts, so maybe we can follow this sequence of calls instead.
does that make sense? |
Right now we don't have all the functions required to run a full scenario (from dicoms to shim calculation) so that's why we decided to go with a gdoc instead of a code that wouldn't be fully functional. Would it be ok if the parts of the code that are not available yet were just commented until we create them ? |
definitely ok! the goal here is to get started immediately with something
yup! again, i would strongly encourage to centralize everything in github. This is much easier to manage the project. |
this is happening 🙌 --> https://github.com/shimming-toolbox/shimming-toolbox-py |
Pros:
Cons:
The text was updated successfully, but these errors were encountered: