Did I find the right examples for you? yes no

All Samples(34)  |  Call(28)  |  Derive(0)  |  Import(6)

src/p/y/pypreprocess-HEAD/pypreprocess/external/nipy_labs/datasets/volumes/volume_grid.py   pypreprocess(Download)
        values = self.values_in_world(x, y, z)
        # We import late to avoid circular import
        from .volume_img import VolumeImg
        return VolumeImg(values, affine, 
                           self.world_space, metadata=self.metadata,

src/n/i/nipy-0.3.0/nipy/labs/datasets/volumes/volume_grid.py   nipy(Download)
        values = self.values_in_world(x, y, z)
        # We import late to avoid circular import
        from .volume_img import VolumeImg
        return VolumeImg(values, affine, 
                           self.world_space, metadata=self.metadata,

src/p/y/pypreprocess-HEAD/pypreprocess/external/nipy_labs/datasets/volumes/tests/test_volume_img.py   pypreprocess(Download)
from ...transforms.affine_transform import AffineTransform
from ...transforms.transform import Transform
from ..volume_img import VolumeImg, CompositionError
 
from nose.tools import assert_true
    affine = np.eye(4)
    affine[:3, -1] = 0.5*np.array(shape[:3])
    ref_im = VolumeImg(data, affine, 'mine')
    rot_im = ref_im.as_volume_img(affine, interpolation='nearest')
    yield np.testing.assert_almost_equal, data, rot_im.get_data()
    data = np.random.random(shape)
    affine = np.eye(4)
    ref_im = VolumeImg(data, affine, 'mine')
    rot_im = ref_im.as_volume_img(2*affine, interpolation='nearest')
    downsampled = data[::2, ::2, ::2, ...]
    prng = np.random.RandomState(10)
    data = prng.randint(4, size=(1, 4, 4))
    img = VolumeImg(data, np.eye(4), 'mine', interpolation='nearest')
    for angle in (0, np.pi, np.pi/2, np.pi/4, np.pi/3):
        rot = rotation(0, angle)
    affine = np.eye(4)
    affine[:3, -1] = 0.5*np.array(shape[:3])
    ref_im = VolumeImg(data, affine, 'mine')
    # Test with purely positive matrices and compare to a rotation
    for theta, phi in np.random.randint(4, size=(5, 2)):

src/n/i/nipy-0.3.0/nipy/labs/datasets/volumes/tests/test_volume_img.py   nipy(Download)
from ...transforms.affine_transform import AffineTransform
from ...transforms.transform import Transform
from ..volume_img import VolumeImg, CompositionError
 
from nose.tools import assert_true
    affine = np.eye(4)
    affine[:3, -1] = 0.5*np.array(shape[:3])
    ref_im = VolumeImg(data, affine, 'mine')
    rot_im = ref_im.as_volume_img(affine, interpolation='nearest')
    yield np.testing.assert_almost_equal, data, rot_im.get_data()
    data = np.random.random(shape)
    affine = np.eye(4)
    ref_im = VolumeImg(data, affine, 'mine')
    rot_im = ref_im.as_volume_img(2*affine, interpolation='nearest')
    downsampled = data[::2, ::2, ::2, ...]
    prng = np.random.RandomState(10)
    data = prng.randint(4, size=(1, 4, 4))
    img = VolumeImg(data, np.eye(4), 'mine', interpolation='nearest')
    for angle in (0, np.pi, np.pi/2, np.pi/4, np.pi/3):
        rot = rotation(0, angle)
    affine = np.eye(4)
    affine[:3, -1] = 0.5*np.array(shape[:3])
    ref_im = VolumeImg(data, affine, 'mine')
    # Test with purely positive matrices and compare to a rotation
    for theta, phi in np.random.randint(4, size=(5, 2)):

src/p/y/pypreprocess-HEAD/pypreprocess/external/nipy_labs/datasets/volumes/tests/test_volume_grid.py   pypreprocess(Download)
# Local imports
from ..volume_grid import VolumeGrid
from ..volume_img import VolumeImg
from ...transforms.transform import Transform, CompositionError
 
    # Check that if I 'resampled_to_img' on an VolumeImg, I get an
    # VolumeImg, and vice versa 
    volume_image = VolumeImg(data, np.eye(4), 'world')
    identity  = Transform('voxels', 'world', id, id) 
    image = VolumeGrid(data, identity)

src/n/i/nipy-0.3.0/nipy/labs/datasets/volumes/tests/test_volume_grid.py   nipy(Download)
# Local imports
from ..volume_grid import VolumeGrid
from ..volume_img import VolumeImg
from ...transforms.transform import Transform, CompositionError
 
    # Check that if I 'resampled_to_img' on an VolumeImg, I get an
    # VolumeImg, and vice versa 
    volume_image = VolumeImg(data, np.eye(4), 'world')
    identity  = Transform('voxels', 'world', id, id) 
    image = VolumeGrid(data, identity)