Did I find the right examples for you? yes no

All Samples(11)  |  Call(10)  |  Derive(0)  |  Import(1)

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_anat_smooth():
    anat = load_image(anatfile)
    smoother = LinearFilter(anat.coordmap, anat.shape)
    sanat = smoother.smooth(anat)
    assert_equal(sanat.shape, anat.shape)
    func_rot = Image(func.get_data(), compose(cmap_rot, cmap))
    func1 = func_rot[...,1] # 5x4 affine
    smoother = LinearFilter(func1.coordmap, func1.shape)
    sfunc1 = smoother.smooth(func1) # OK
    # And same as for 4x4 affine
    cmap3d = drop_io_dim(cmap, 't')
    func3d = Image(func1.get_data(), cmap3d)
    smoother = LinearFilter(func3d.coordmap, func3d.shape)
    # And same with no rotation
    func_fresh = func[...,1] # 5x4 affine, no rotation
    smoother = LinearFilter(func_fresh.coordmap, func_fresh.shape)
    sfunc_fresh = smoother.smooth(func_fresh)
    assert_equal(sfunc1.shape, sfunc_fresh.shape)