-
Notifications
You must be signed in to change notification settings - Fork 18
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
[SHORT] Fix up codes for FFT class, making it more user friendly and fix grid search #111
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions
mri/operators/fourier/cartesian.py
Outdated
for ch in range(self.n_coils)]) | ||
axes = tuple(np.arange(1, img.ndim)) | ||
return self.mask * np.fft.ifftshift( | ||
np.fft.fftn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you check (and if so how) that fftn
is indeed faster than the loop?
Indeed I had this problem, summarized in this SO question a long time ago.
Finally, it might be nice to consider some parallelization on this (maybe for now as a TODO).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, there was a TODO for parallelization, but then I assumed that the fftn through numpy might as well handle this well and in practice this should not be that big a gain, but you do have a valid point. I will check this and get back here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to scipy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also added n_jobs and connected the argument to workers. This way, user has control on exact speed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One other test is failing for a matching problem, you should investigate to see if it's serious or not
Looks like scipy for some reason gives different result, causing issues when we compare Noncartesian to cartesian in some tests |
Also, I had a minute issue in gridsearch scripts which came up while using it, the n_coils term is missing and since it is a single line, I am merging it to this PR |
LGTM @chaithyagr , I'll let you merge when you think it's time |
merging, I see that the code worked on circleci well. |
This PR Covers:
axes
parameter ofnp.fft.fftn
to do FFT in vectorized way, than using loopsn_coils
to parameters in grid search