Did I find the right examples for you? yes no

All Samples(18)  |  Call(12)  |  Derive(2)  |  Import(4)

src/p/y/pypreprocess-HEAD/pypreprocess/external/nipy_labs/datasets/volumes/volume_img.py   pypreprocess(Download)
from ..transforms.transform import CompositionError
 
from .volume_grid import VolumeGrid
 
################################################################################
# class `VolumeImg`
################################################################################
 
class VolumeImg(VolumeGrid):
                                     interpolation=self.interpolation)
        else:
            new_img = VolumeGrid(self.get_data(),
                                transform=new_v2w_transform,
                                metadata=self.metadata,

src/n/i/nipy-0.3.0/nipy/labs/datasets/volumes/volume_img.py   nipy(Download)
from ..transforms.transform import CompositionError
 
from .volume_grid import VolumeGrid
 
################################################################################
# class `VolumeImg`
################################################################################
 
class VolumeImg(VolumeGrid):
                                     interpolation=self.interpolation)
        else:
            new_img = VolumeGrid(self.get_data(),
                                transform=new_v2w_transform,
                                metadata=self.metadata,

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
def test_volume_grid():
    """ Sanity testing of the VolumeGrid class.
    """
    transform = Transform('voxels', 'world', mapping)
    img = VolumeGrid(data=np.random.random((10, 10, 10)),
    identity = Transform('voxels', 'world', id, id)
    data = np.random.random((N, N, N))
    img = VolumeGrid(data=data,
                    transform=identity,
                    )
    identity  = Transform('world1', 'world2', id, id) 
    data = np.random.random((N, N, N))
    img1 = VolumeGrid(data=data,
                     transform=v2w_mapping,
                     )
    volume_image = VolumeImg(data, np.eye(4), 'world')
    identity  = Transform('voxels', 'world', id, id) 
    image = VolumeGrid(data, identity)
    image2 = image.resampled_to_img(volume_image)
    yield nose.tools.assert_true, isinstance(image2, VolumeImg)

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
def test_volume_grid():
    """ Sanity testing of the VolumeGrid class.
    """
    transform = Transform('voxels', 'world', mapping)
    img = VolumeGrid(data=np.random.random((10, 10, 10)),
    identity = Transform('voxels', 'world', id, id)
    data = np.random.random((N, N, N))
    img = VolumeGrid(data=data,
                    transform=identity,
                    )
    identity  = Transform('world1', 'world2', id, id) 
    data = np.random.random((N, N, N))
    img1 = VolumeGrid(data=data,
                     transform=v2w_mapping,
                     )
    volume_image = VolumeImg(data, np.eye(4), 'world')
    identity  = Transform('voxels', 'world', id, id) 
    image = VolumeGrid(data, identity)
    image2 = image.resampled_to_img(volume_image)
    yield nose.tools.assert_true, isinstance(image2, VolumeImg)