Esempio n. 1
0
def derenzo_sources(space):
    """Create the PET/SPECT Derenzo sources phantom.

    The Derenzo phantom contains a series of circles of decreasing size.

    In 3d the phantom is simply the 2d phantom extended in the z direction as
    cylinders.
    """
    if space.ndim == 2:
        return ellipse_phantom(space, _derenzo_sources_2d())
    if space.ndim == 3:
        return ellipse_phantom(
            space, cylinders_from_ellipses(_derenzo_sources_2d()))
    else:
        raise ValueError('dimension not 2, no phantom available')
Esempio n. 2
0
def shepp_logan(space, modified=False):
    """Standard `Shepp-Logan phantom`_ in 2 or 3 dimensions.

    Parameters
    ----------
    space : `DiscreteLp`
        Space in which the phantom is created, must be 2- or 3-dimensional.
        If ``space.shape`` is 1 in an axis, a corresponding slice of the
        phantom is created.
    modified : `bool`, optional
        True if the modified Shepp-Logan phantom should be given.
        The modified phantom has greatly amplified contrast to aid
        visualization.

    See Also
    --------
    forbild : Similar phantom but with more complexity. Only supports 2d.
    odl.phantom.geometric.defrise : Geometry test phantom
    shepp_logan_ellipses : Get the parameters that define this phantom
    odl.phantom.geometric.ellipse_phantom :
        Function for creating arbitrary ellipse phantoms

    References
    ----------
    .. _Shepp-Logan phantom: en.wikipedia.org/wiki/Shepp–Logan_phantom
    """
    ellipses = shepp_logan_ellipses(space.ndim, modified)

    return ellipse_phantom(space, ellipses)