Did I find the right examples for you? yes no

All Samples(12)  |  Call(9)  |  Derive(0)  |  Import(3)

src/p/y/pypreprocess-HEAD/pypreprocess/coreg.py   pypreprocess(Download)
                       save_vols
                       )
from .kernel_smooth import (fwhm2sigma,
                            centered_smoothing_kernel
                            )
    else:
        # smooth the jh with a gaussian filter of given fwhm
        jh = gaussian_filter(jh, sigma=fwhm2sigma(fwhm[:2]), mode='wrap')
 
    # compute marginal histograms
            target = nibabel.Nifti1Image(
                gaussian_filter(target.get_data(),
                                              fwhm2sigma(fwhmg)),
                target.get_affine())
 
                    [0, 0, 0])) / vxf
            source = nibabel.Nifti1Image(gaussian_filter(
                source.get_data(), fwhm2sigma(fwhmf)),
                                      source.get_affine())
 

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_fwhm2sigma():
    fwhm = [1, 2, 3]
 
    for _fwhm in fwhm:
        numpy.testing.assert_array_equal(fwhm2sigma(_fwhm),
    for j in xrange(3):
        _fwhm = fwhm[j:]
        numpy.testing.assert_array_equal(fwhm2sigma(_fwhm),
                                         np.array(
                _fwhm) / 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))