-
Notifications
You must be signed in to change notification settings - Fork 3
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
Implement Gram Shortcut for FourierOp #503
Conversation
📚 Documentation |
139cc6e
to
d57aa80
Compare
This will need an adjustment once the CartesianSamplingOp is added to FourierOp. ✔️ Should we keep the helper function that creates the convolution kernel next to the Operators or should we move it into algorithms somewhere? It is IMHO not really an algorithm, just a tiny bit smarter way to do a Nufft with doubled images size in each dimension.. |
needs #517 .. |
We could remove the Gram Operators and instead return directly the composition of the other operators. |
Also, it could be made a bit more efficient if we add a normalize and fftshift flag to the fftop, we can avoid both by scaling/shifting the kernel instead. |
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.
looks good to me
Looks good to me as well, Toeplitz Kernel from tkbnufft and Gram also give very similar results |
Add Gram Operator to the FourierOp and CartesianSamplingOp
FourierOp:
written as convolution with kernel, making use of toeplitz structure of nufft. kernel is calculated with 2^n_dim adjoint nuffs, instead of one nufft with twice the size in all dimensions, saving on memory. same approach as done by tensorflow MRI, but with a loop over he combinations instead of recursion. The torchkbnufft adjoint nufft can at some point be replaced by a different nufft operation. Currently, the code prodces the same results as https://torchkbnufft.readthedocs.io/en/stable/_modules/torchkbnufft/_nufft/toep.html#calc_toeplitz_kernel
If we slit nufft op out of FourierOp, we can also move the nufft-related stuff from init and forward 1:1 to new nufft op.
CartesianSamplingOp
does forward and adjoint pass on an all-ones mask. this could be optimized to instead just set ones in a all-zero mask. but the current form works and is simple.
If we add CartesianSamplingOp to FourierOp, we would also have to include it in FourierOp.gram on the cartesian dimensions.
Tests compare against Operator.H@Operator as ground-truth.