@classmethod
    def from_fsl(cls, xfm, func_nii, anat_nii):
        ## -- Adapted from dipy.external.fsl.flirt2aff -- ##
        import nibabel
        import numpy.linalg as npl
        inv = npl.inv

        # Load transform from text file, if string is provided
        if isinstance(xfm,(str,unicode)):
            with open(xfm,'r') as fid:
                L = fid.readlines()
            xfm  = np.array([[np.float(s) for s in ll.split() if s] for ll in L])

        # Internally, pycortex computes the OPPOSITE transform: from anatomical volume to functional volume. 
        # Thus, assign anat to "infile" (starting point for transform)
        infile = anat_nii
        # Assign func to "reffile" (end point for transform)
        reffile = func_nii
        # and invert the usual direction (change from func>anat to anat>func)
        xfm = inv(xfm)

        try:
            inIm = nibabel.load(infile)
        except AttributeError:
            inIm = infile
        
        refIm = nibabel.load(reffile)
        in_hdr = inIm.get_header()
        ref_hdr = refIm.get_header()
        # get_zooms gets the positive voxel sizes as returned in the header
        inspace = np.diag(in_hdr.get_zooms()[:3] + (1,))
        refspace = np.diag(ref_hdr.get_zooms()[:3] + (1,))
        # Since FSL does not use the full transform info in the nifti header, 
        # determine whether the transform indicates that the X axis should be 
        # flipped; if so, flip the X axis (for both infile and reffile)
        if npl.det(in_hdr.get_best_affine())>=0:
            inspace = np.dot(inspace, _x_flipper(in_hdr.get_data_shape()[0]))
        if npl.det(ref_hdr.get_best_affine())>=0:
            refspace = np.dot(refspace, _x_flipper(ref_hdr.get_data_shape()[0]))

        inAffine = inIm.get_affine()
        
        coord = np.dot(inv(refspace),np.dot(xfm,np.dot(inspace,inv(inAffine))))
        return cls(coord, refIm)
Delete the specified dns entry.
dataset/ETHPy150Open gallantlab/pycortex/cortex/xfm.py/Transform.from_fsl--crossover with--dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/network/api.py/API.delete_dns_entry