(anatdata, subject, xfmname, order=1)
return affine_transform(anatdata.T, rotpart, offset=transpart, output_shape=target.shape[::-1], cval=np.nan, order=order).T
Resamples data from anatomical space into epi space
    
    Parameters
    ----------
    anatdata : ndarray
        data in anatomical space
    subject : str
        Name of subject
    xfmname : str
        Name of transform
    order : int
        Order of spline interpolation
        
    Returns
    -------
    epidata : ndarray
        data in EPI space
Resamples data from anatomical space into epi space
    
    Parameters
    ----------
    anatdata : ndarray
        data in anatomical space
    subject : str
        Name of subject
    xfmname : str
        Name of transform
    order : int
        Order of spline interpolation
        
    Returns
    -------
    epidata : ndarray
        data in EPI space
Resamples data from anatomical space into epi space Parameters ---------- anatdata : ndarray data in anatomical space subject : str Name of subject xfmname : str Name of transform order : int Order of spline interpolation Returns ------- epidata : ndarray data in EPI space
def anat2epispace(anatdata, subject, xfmname, order=1):
    """Resamples data from anatomical space into epi space
    
    Parameters
    ----------
    anatdata : ndarray
        data in anatomical space
    subject : str
        Name of subject
    xfmname : str
        Name of transform
    order : int
        Order of spline interpolation
        
    Returns
    -------
    epidata : ndarray
        data in EPI space
    """
    from scipy.ndimage.interpolation import affine_transform
    anatref = db.get_anat(subject)
    target = db.get_xfm(subject, xfmname, "coord")

    allxfm =  Transform(anatref.get_affine(), anatref.shape).inv * target.inv
    #allxfm = xfm * Transform(anat.get_affine(), anat.shape)

    rotpart = allxfm.xfm[:3, :3]
    transpart = allxfm.xfm[:3,-1]
    
    return affine_transform(anatdata.T, rotpart, offset=transpart, output_shape=target.shape[::-1], cval=np.nan, order=order).T
def anat2epispace ( anatdata , subject , xfmname , order = 1 ) : from scipy . ndimage . interpolation import affine_transform anatref = db . get_anat ( subject ) target = db . get_xfm ( subject , xfmname , "coord" ) allxfm = Transform ( anatref . get_affine ( ) , anatref . shape ) . inv * target . inv #allxfm = xfm * Transform(anat.get_affine(), anat.shape) rotpart = allxfm . xfm [ : 3 , : 3 ] transpart = allxfm . xfm [ : 3 , - 1 ] return affine_transform ( anatdata . T , rotpart , offset = transpart , output_shape = target . shape [ : : - 1 ] , cval = np . nan , order = order ) . T