Skip to content

Commit

Permalink
MAINT: Style fixes to parallel_beam_geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
adler-j committed Jan 2, 2017
1 parent 7ed4b4a commit 93497c7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
4 changes: 2 additions & 2 deletions examples/tomo/filtered_backprojection_parallel_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

"""
Example creating a filtered back-projection in 2d using the ray transform and a
ramp filter. The ramp filter is implemented in fourier space.
ramp filter. The ramp filter is implemented in Fourier space.
See https://en.wikipedia.org/wiki/Radon_transform#Inversion_formulas for
more information.
Also note that ODL has a utility function, `fbp_op` that can be used to perform
filtered back-projection, and that this example is intended to show how this
could be implemented in ODL.
could be implemented by hand using ODL.
"""

import numpy as np
Expand Down
25 changes: 14 additions & 11 deletions odl/tomo/geometry/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,13 +428,14 @@ def __repr__(self):


def parallel_beam_geometry(space, angles=None, det_shape=None):
"""Create default parallel beam geometry from space.
This default geometry gives a fully sampled sinogram according to the
nyquist criterion. In general this gives a very large number of samples.
"""Create default parallel beam geometry from ``space``.
This is intended for simple test cases where users do not need the full
flexibility of the geometries, but simply want a geomoetry that works.
flexibility of the geometries, but simply want a geometry that works.
This default geometry gives a fully sampled sinogram according to the
nyquist criterion, which in general results in a very large number of
samples.
Parameters
----------
Expand Down Expand Up @@ -468,18 +469,18 @@ def parallel_beam_geometry(space, angles=None, det_shape=None):
Notes
-----
According to `Mathematical Methods in Image Reconstruction`_ (page 72), for
a function :math:`f : \\mathbb{R}^2 \\to \\mathbb{R}`, that has compact
a function :math:`f : \\mathbb{R}^2 \\to \\mathbb{R}` that has compact
support
.. math::
\| x \| > \\rho \implies f(x) = 0,
and that is bandlimited in some appropriate sense
and is essentially bandlimited
.. math::
\| \\xi \| > \\Omega \implies \\hat{f}(\\xi) = 0.
\| \\xi \| > \\Omega \implies \\hat{f}(\\xi) \\approx 0,
Then, in order to fully reconstruct the function from a parallel beam ray
then, in order to fully reconstruct the function from a parallel beam ray
transform the function should be sampled at an angular interval
:math:`\\Delta \psi` such that
Expand All @@ -494,7 +495,7 @@ def parallel_beam_geometry(space, angles=None, det_shape=None):
The geometry returned by this function satisfies these conditions exactly.
If the domain is 3 dimensional, the geometry is "separable", in that each
If the domain is 3-dimensional, the geometry is "separable", in that each
slice along the z-dimension of the data is treated as independed 2d data.
References
Expand All @@ -506,7 +507,7 @@ def parallel_beam_geometry(space, angles=None, det_shape=None):
corners = space.domain.corners()[:, :2]
rho = np.max(np.linalg.norm(corners, axis=1))

# Find default values according to nyquist criterion
# Find default values according to Nyquist criterion
min_side = min(space.partition.cell_sides[:2])
omega = 2 * np.pi / min_side

Expand Down Expand Up @@ -535,6 +536,8 @@ def parallel_beam_geometry(space, angles=None, det_shape=None):
[rho, max_h],
det_shape)
return Parallel3dAxisGeometry(angle_partition, det_partition)
else:
raise ValueError('``space.ndim`` must be 2 or 3.')


if __name__ == '__main__':
Expand Down

0 comments on commit 93497c7

Please sign in to comment.