Did I find the right examples for you? yes no

All Samples(8)  |  Call(6)  |  Derive(0)  |  Import(2)

src/p/y/pypreprocess-HEAD/pypreprocess/tests/test_kernel_smooth.py   pypreprocess(Download)
import numpy.testing
from ..io_utils import load_specific_vol
from ..kernel_smooth import (
    fwhm2sigma,
    sigma2fwhm,
def test_sigma2sigma():
    sigma = [7, 2, 3]
 
    for _sigma in sigma:
        numpy.testing.assert_array_equal(sigma2fwhm(_sigma),
    for j in xrange(3):
        _sigma = sigma[j:]
        numpy.testing.assert_array_equal(sigma2fwhm(_sigma),
                                         np.array(
                _sigma) * np.sqrt(8. * np.log(2)))
def test_fwhm2sigma_and_sigma2fwhm_are_inverses():
    toto = [5, 7, 11.]
 
    numpy.testing.assert_array_equal(toto, sigma2fwhm(fwhm2sigma(toto)))
    numpy.testing.assert_array_almost_equal(toto, fwhm2sigma(sigma2fwhm(toto)))

src/n/i/nipy-0.3.0/nipy/algorithms/tests/test_kernel_smooth.py   nipy(Download)
 
from ... import load_image
from ..kernel_smooth import LinearFilter, sigma2fwhm, fwhm2sigma
from ...externals.transforms3d.taitbryan import euler2mat
from ...core.api import Image, compose, AffineTransform, drop_io_dim
def test_sigma_fwhm():
    # ensure that fwhm2sigma and sigma2fwhm are inverses of each other
    fwhm = np.arange(1.0, 5.0, 0.1)
    sigma = np.arange(1.0, 5.0, 0.1)
    assert_true(np.allclose(sigma2fwhm(fwhm2sigma(fwhm)), fwhm))
    assert_true(np.allclose(fwhm2sigma(sigma2fwhm(sigma)), sigma))