Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to pics broke wrapper #4

Open
fyrdahl opened this issue Jun 2, 2022 · 0 comments
Open

Update to pics broke wrapper #4

fyrdahl opened this issue Jun 2, 2022 · 0 comments

Comments

@fyrdahl
Copy link

fyrdahl commented Jun 2, 2022

I'm not sure if this project is still in active development, but I just wanted to submit an issue as a couple of recent changes in BART broke this wrapper

The first change I'm aware of was 2bf1f14.
This change only affected the pics tool, which will either fail silently and return incorrect output, or with a FileNotFound-error.

Using, set_debug(True) I can see the following command to bart

bart pics -t /tmp/tmpgm0hxcp9t /tmp/tmpgm0hxcp9kspace /tmp/tmpgm0hxcp9sensitivities /tmp/tmpgm0hxcp9output /tmp/tmpgm0hxcp9psf_export

Manually running this command gives the following error

ERROR: cmdline: too few or too many arguments

MWE:

import bartpy.tools as bart
import numpy as np

traj = bart.traj(x=256, y=144, r=True)
ksp = bart.phantom(t=traj, s=8)
img = bart.nufft(traj, ksp, i=True, t=True)
cart_ksp = bart.fft(img, u=True, bitmask=7)
sens, _ = bart.ecalib(cart_ksp, m=1)
pics_out = bart.pics(ksp, sens, t=traj, r=0.01)

print(np.array_equal(cart_ksp, pics_out))

The final check (array_equal) will return True. This highlights an issue related to #3
Since temp file names are global, and the files are not cleared, any tool can fail silently but still return an output that was created by another tool. In this case, pics returns the output of bart.fft.

The second change was 5393516 which breaks the wrapper completely and gives this error on import.

File "/content/bartpy/bartpy/tools/tools.py", line 1717
def ictv(input, llambda, flags, flags, i=None, u=None):
SyntaxError: duplicate argument 'flags' in function definition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant