Did I find the right examples for you? yes no

All Samples(8)  |  Call(5)  |  Derive(0)  |  Import(3)

src/n/i/nipy-0.3.0/nipy/algorithms/registration/resample.py   nipy(Download)
                                        xyz_affine)
from .affine import inverse_affine, Affine
from ._registration import (_cspline_transform,
                            _cspline_sample3d,
                            _cspline_resample3d)
        coords = Tv.apply(coords).T
        if interp_order == 3:
            cbspline = _cspline_transform(data)
            output = np.zeros(ref_shape, dtype='double')
            output = _cspline_sample3d(output, cbspline, *coords)

src/n/i/nipy-0.3.0/nipy/algorithms/registration/groupwise_registration.py   nipy(Download)
from .optimizer import configure_optimizer, use_derivatives
from .affine import Rigid
from ._registration import (_cspline_transform,
                            _cspline_sample3d,
                            _cspline_sample4d)
        self.time_interp = time_interp
        if time_interp:
            self.cbspline = _cspline_transform(im4d.get_data())
        else:
            self.cbspline = np.zeros(self.dims, dtype='double')
            for t in range(self.dims[3]):
                self.cbspline[:, :, :, t] =\
                    _cspline_transform(im4d.get_data()[:, :, :, t])

src/n/i/nipy-0.3.0/nipy/algorithms/registration/tests/test_cubic_spline.py   nipy(Download)
import numpy as np
 
from .._registration import (_cspline_transform,
                             _cspline_sample1d,
                             _cspline_sample4d)
def test_sample1d():
    a = np.random.rand(100)
    c = _cspline_transform(a)
    x = np.arange(100)
    b = np.zeros(100)
def test_sample4d():
    a = np.random.rand(4, 5, 6, 7)
    c = _cspline_transform(a)
    x = np.mgrid[0:4, 0:5, 0:6, 0:7]
    b = np.zeros(a.shape)