mrirecon / bart

BART: Toolbox for Computational Magnetic Resonance Imaging
https://mrirecon.github.io/bart/
BSD 3-Clause "New" or "Revised" License
301 stars 164 forks source link

Modification of the Python wrapper #295

Closed mavel101 closed 2 years ago

mavel101 commented 2 years ago

This PR adds new functionality to the Python wrapper as it allows to provide optional arguments in BART via keyworded arguments in Python. In this way it is possible to pass more than one optional argument, that requires a file, to BART.

The pics command allows for example to provide a trajectory file and a pattern file via the option "-t" and "-p". This is however not supported by the current wrapper, as it just concatenates the command string with the arguments. With the changes, this is now possible by running e.g.: img = bart(1, 'pics', kspace, sensitivities, t=trj, p=pattern)

The changes should not break or change the current behaviour of the wrapper. In principle, these functionalities are already included in the "bartpy" wrapper, which is currently broken though (see https://github.com/malits/bartpy/issues/4).

hcmh commented 2 years ago

Thank you for your pull request, this seems both simple and quite useful!