Example #1
0
 def __getitem__(self, slices):
     data = self._data[slices]
     toworld = subgrid_affine(self._toworld, slices)
     res = GridTransform((data.shape[:-2], toworld), data, self._affine)
     res._param[:] = self._param[:]
     res._free_param_idx = self._free_param_idx
     return res
Example #2
0
 def __getitem__(self, slices):
     toworld = subgrid_affine(self._toworld, slices)
     fake_data = np.ones(self._shape, dtype='bool')[slices]
     res = SplineTransform((fake_data.shape, toworld), 
                           self._control_points, self._sigma,
                           grid_coords=False, affine=self._affine)
     res._param[:] = self._param[:]
     res._free_param_idx = self._free_param_idx
     return res