Repository navigation
Add rotate_3d implementation - #378
Conversation
|
This PR adds the rotate3D function to PyPulseq which enables rotation of gradient waveforms in 3D space. |
|
why do the gradients need to be realigned after scaling? also there are some strange (llm?) comments left in... |
|
Thanks for the comments. I updated it accordingly and resolved the issues. |
|
@Moji3h thank you for the review! I still see some issues with the docstring, as well as the remaining issue of post rotation gradient alignment. In addition, I would strongly advise to add some unit tests, it is important not to decrease the coverage. Thanks again for your support! |
|
Hi @Moji3h, do you have any updates by any chance? I am happy to help with the coverage if you're ok with me pushing commits on this branch |
|
based on this PR, #302 and https://github.com/m-a-x-i-m-z/pypulseq-matlab-like/blob/master/src/pypulseq_matlab_like/rotate_3d.py me and my AI coding partner created an updated, documented and tested (96% coverage) version of the rotate_3d function. I also did a MATLAB cross-check using 7 cases covering all input forms and gradient types. All output gradients match in channel, type, timing and waveform (max |Δ| ≈ 1e-10 Hz/m) and trapezoid amplitudes. I also adjusted the function name (and filename) to def rotate_3d(
*args: SimpleNamespace,
rotation: Union[np.ndarray, list, tuple, float, Rotation],
system: Union[Opts, None] = None,
) -> List[SimpleNamespace]:So the overlap with the current code is quite small. @mcencini I guess you would be the best candidate to review it. Do you prefer a new PR or should I push the changes here? |
|
@schuenke thanks for looking into this! I will be happy to review it asap. I think it is ok to push the changes here. |
No description provided.