Skip to content

Commit be0cd5b

Browse files
authored
Patch refactor (#16)
1 parent 0671e54 commit be0cd5b

File tree

10 files changed

+62
-56
lines changed

10 files changed

+62
-56
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ interpolation, sparse matrix-based NUFFT interpolation, and forward/backward
3030
operators with Toeplitz-embedded FFTs [[3](#references)]. Roughly, computation
3131
speed follows:
3232

33-
| Type | Speed |
34-
| ------------- | ------------------------------------ |
35-
| Toeplitz | Fastest |
36-
| Table | Medium |
37-
| Sparse Matrix | Slow (Faster for many-coil problems) |
33+
| Type | Speed |
34+
| ------------- | ---------------------- |
35+
| Toeplitz | Fastest |
36+
| Table | Medium |
37+
| Sparse Matrix | Slow (not recommended) |
3838

3939
It is generally best to start with Table interpolation and then experiment with
4040
the other modes for your problem.

docs/source/index.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ About
1515
[`1 <https://doi.org/10.1109/TSP.2002.807005>`_,
1616
`2 <https://doi.org/10.1109/TMI.2005.848376>`_] with
1717
Kaiser-Bessel gridding in PyTorch. The implementation is completely in Python,
18-
facilitating flexible deployment in human-readable code with no compilation.
19-
NUFFT functions are each wrapped as a :py:class:`torch.autograd.Function`, allowing
18+
facilitating flexible deployment in readable code with no compilation. NUFFT
19+
functions are each wrapped as a :py:class:`torch.autograd.Function`, allowing
2020
backpropagation through NUFFT operators for training neural networks.
2121

2222
This package was inspired in large part by the NUFFT implementation in the
@@ -41,11 +41,11 @@ Operation Modes and Stages
4141
The package has three major classes of NUFFT operation mode: table-based NUFFT
4242
interpolation, sparse matrix-based NUFFT interpolation, and forward/backward
4343
operators with Toeplitz-embedded FFTs
44-
[`3 <https://doi.org/10.1007/s002110050101>`_]. The Toeplitz method is always the
45-
fastest for forward/backward NUFFTs. Depending on the problem, either the table
46-
or sparse matrix NUFFTs can be faster in other cases. It is generally best to
47-
start with Table interpolation and then experiment with the other modes for
48-
your problem.
44+
[`3 <https://doi.org/10.1007/s002110050101>`_]. Table interpolation is the
45+
standard operation mode, whereas the Toeplitz method is always the
46+
fastest for forward/backward NUFFTs. For some problems, sparse matrices may be
47+
fast. It is generally best to start with Table interpolation and then experiment
48+
with the other modes for your problem.
4949

5050
Sensitivity maps can be incorporated by passing them into a
5151
:py:class:`~torchkbnufft.KbNufft` or :py:class:`~torchkbnufft.KbNufftAdjoint`

notebooks/Basic Example.ipynb

Lines changed: 10 additions & 10 deletions
Large diffs are not rendered by default.

notebooks/SENSE Example.ipynb

Lines changed: 9 additions & 9 deletions
Large diffs are not rendered by default.

notebooks/Sparse Matrix Example.ipynb

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

notebooks/Toeplitz Example.ipynb

Lines changed: 10 additions & 10 deletions
Large diffs are not rendered by default.

torchkbnufft/_nufft/dcomp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def calc_density_compensation_function(
2121
"""Numerical density compensation estimation.
2222
2323
This function has optional parameters for initializing a NUFFT object. See
24-
:py:meth:`~torchkbnufft.KbInterp` for details.
24+
:py:class:`~torchkbnufft.KbInterp` for details.
2525
2626
* :attr:`ktraj` should be of size ``(len(im_size), klength)``,
2727
where ``klength`` is the length of the k-space trajectory.

torchkbnufft/_nufft/spmat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def calc_tensor_spmatrix(
2424
table interpolation.
2525
2626
This function has optional parameters for initializing a NUFFT object. See
27-
:py:meth:`~torchkbnufft.KbNufft` for details.
27+
:py:class:`~torchkbnufft.KbNufft` for details.
2828
2929
* :attr:`omega` should be of size ``(len(im_size), klength)``,
3030
where ``klength`` is the length of the k-space trajectory.

torchkbnufft/_nufft/toep.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ def calc_toeplitz_kernel(
3434
<https://link.springer.com/article/10.1007/s002110050101>`_.
3535
3636
This function has optional parameters for initializing a NUFFT object. See
37-
:py:meth:`~torchkbnufft.KbNufftAdjoint` for details.
37+
:py:class:`~torchkbnufft.KbNufftAdjoint` for details.
38+
39+
Note:
40+
41+
This function is intended to be used in conjunction with
42+
:py:class:`~torchkbnufft.ToepNufft` for forward operations.
3843
3944
* :attr:`omega` should be of size ``(len(im_size), klength)``,
4045
where ``klength`` is the length of the k-space trajectory.

torchkbnufft/modules/kbinterp.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,11 @@ def forward(
108108
) -> Tensor:
109109
"""Interpolate from gridded data to scattered data.
110110
111-
Input tensors should be of shape ``(N, C) + im_size``, where ``N`` is
111+
Input tensors should be of shape ``(N, C) + grid_size``, where ``N`` is
112112
the batch size and ``C`` is the number of sensitivity coils. ``omega``,
113-
the k-space trajectory, should be of size ``(len(im_size), klength)``,
114-
where ``klength`` is the length of the k-space trajectory.
113+
the k-space trajectory, should be of size
114+
``(len(grid_size), klength)``, where ``klength`` is the length of the
115+
k-space trajectory.
115116
116117
If your tensors are real-valued, ensure that 2 is the size of the last
117118
dimension.
@@ -256,7 +257,7 @@ def forward(
256257
interpolation).
257258
258259
Returns:
259-
``data`` transformed to the image domain.
260+
``data`` interpolated to the grid.
260261
"""
261262
is_complex = True
262263
if not data.is_complex():

0 commit comments

Comments
 (0)