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

Inconsistency between 1D NFFT and (N,1)-dimensional NFFT #34

Open
JeffFessler opened this issue Jun 10, 2019 · 3 comments
Open

Inconsistency between 1D NFFT and (N,1)-dimensional NFFT #34

JeffFessler opened this issue Jun 10, 2019 · 3 comments

Comments

@JeffFessler
Copy link
Collaborator

The result of a 1D NFFT of length N and a (N,1)-dimensional NFFT are quite inconsistent.
Here is a MWE:

using NFFT
M = 4
x1 = collect((-Int(M/2)):(Int(M/2)-1))/M
N1 = M
p1 = NFFTPlan(x1, N1) # 1D plan
f1 = ones(N1)
o1 = nfft(p1, complex(f1))

N2 = (M,1)
x2 = [x1 zeros(M)]
p2 = NFFTPlan(x2', N2)
f2 = ones(N2)
o2 = nfft(p2, complex(f2))

display(o1), display(o2)

Perhaps there is some minimum size requirement for each dimension of a multi-dimensional NFFT? If so then should NFFTPlan throw an error if that requirement is not met?

1D NFFT is working great for me but 2D NFFT is not behaving as I am expecting, so this (N,1) case is an example of a test I am doing to try to diagnose my 2D issues...

@tknopp
Copy link
Member

tknopp commented Jun 11, 2019

Yes, there is a minimum size requirement because of the convolution. My proposal is that we catch the error within the constructor.

Out of curious: How does your Matlab NUFFT implementation handle this?

@tknopp
Copy link
Member

tknopp commented Jun 11, 2019

1D NFFT is working great for me but 2D NFFT is not behaving as I am expecting

Could you elaborate on this? We have unit tests against the NDFT. We also apply the implementation to measured MRI data. This does, however, not imply that the implementation is bug-free. Maybe we could try getting some example test setting (N, alpha, m, M) where you could report the error that you get with your NUFFT implementation. Potentially we could also check the error compared to the NFFT C library. I currently have no runnable version of that though.

@JeffFessler
Copy link
Collaborator Author

My Matlab NUFFT checks to see if the zero-padded fft size (K) is smaller than the interpolation kernel width (J) and if it is then it produces a warning and decreases J accordingly.
See line 53 here:
https://github.com/JeffFessler/mirt/blob/master/nufft/nufft_init.m
I don't recall if I ever tested it with a (N,1) case though :)

Perhaps my 2D NFFT tests were using a size below the minimum, so I will look into it more and get back to you if I find a MWE with a larger dimension.

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

2 participants