algorithm/vol_tools.py
def vox2vox(self, vxloc):
        """
        Compute connectivity between a voxel and the other voxels.
        ----------------------------------------------------
        Parameters:
            vxloc: seed voxel location. voxel coordinate.
        Output:
            corrmap: corr values map, rmap or zmap
            pmap: p values map
        Example:
            >>> corrmap, pmap = m.vox2vox(vxloc)
        """
        rmap = np.zeros(self._imgdata.shape[:3])
        pmap = np.zeros_like(rmap)
        vxseries = self._imgdata[vxloc[0], vxloc[1], vxloc[2], :]
        vxseries = np.expand_dims(vxseries, axis=1).T
        for i in range(self._imgdata.shape[0]):
            for j in range(self._imgdata.shape[1]):
                r_tmp, p_tmp = tools.pearsonr(vxseries, self._imgdata[i,j,...])
                rmap[i,j,:], pmap[i,j,:] = r_tmp.flatten(), p_tmp.flatten()
            print('{}% finished'.format(100.0*i/self._imgdata.shape[0]))
        # solve problems as output of nifti data
        # won't affect fdr corrected result
        rmap[np.isnan(rmap)] = 0
        pmap[pmap == 1] = 0
        if self._transform_z is False:
            corrmap = rmap
        else:
            print('Perform the Fisher r-to-z transformation')
            corrmap = tools.r2z(rmap)
        return corrmap, pmap

        Compute connectivity between a voxel and the other voxels.
        ----------------------------------------------------
        Parameters:
            vxloc: seed voxel location. voxel coordinate.
        Output:
            corrmap: corr values map, rmap or zmap
            pmap: p values map
        Example:
            >>> corrmap, pmap = m.vox2vox(vxloc)
        
Compute connectivity between a voxel and the other voxels.
Compute connectivity between a voxel and the other voxels .
def vox2vox(self, vxloc):
        rmap = np.zeros(self._imgdata.shape[:3])
        pmap = np.zeros_like(rmap)
        vxseries = self._imgdata[vxloc[0], vxloc[1], vxloc[2], :]
        vxseries = np.expand_dims(vxseries, axis=1).T
        for i in range(self._imgdata.shape[0]):
            for j in range(self._imgdata.shape[1]):
                r_tmp, p_tmp = tools.pearsonr(vxseries, self._imgdata[i,j,...])
                rmap[i,j,:], pmap[i,j,:] = r_tmp.flatten(), p_tmp.flatten()
            print('{}% finished'.format(100.0*i/self._imgdata.shape[0]))
        rmap[np.isnan(rmap)] = 0
        pmap[pmap == 1] = 0
        if self._transform_z is False:
            corrmap = rmap
        else:
            print('Perform the Fisher r-to-z transformation')
            corrmap = tools.r2z(rmap)
        return corrmap, pmap
def vox2vox ( self , vxloc ) : rmap = np . zeros ( self . _imgdata . shape [ : 3 ] ) pmap = np . zeros_like ( rmap ) vxseries = self . _imgdata [ vxloc [ 0 ] , vxloc [ 1 ] , vxloc [ 2 ] , : ] vxseries = np . expand_dims ( vxseries , axis = 1 ) . T for i in range ( self . _imgdata . shape [ 0 ] ) : for j in range ( self . _imgdata . shape [ 1 ] ) : r_tmp , p_tmp = tools . pearsonr ( vxseries , self . _imgdata [ i , j , ... ] ) rmap [ i , j , : ] , pmap [ i , j , : ] = r_tmp . flatten ( ) , p_tmp . flatten ( ) print ( '{}% finished' . format ( 100.0 * i / self . _imgdata . shape [ 0 ] ) ) rmap [ np . isnan ( rmap ) ] = 0 pmap [ pmap == 1 ] = 0 if self . _transform_z is False : corrmap = rmap else : print ( 'Perform the Fisher r-to-z transformation' ) corrmap = tools . r2z ( rmap ) return corrmap , pmap
Compute connectivity between a voxel and the other voxels.
Compute connectivity between a voxel and the other voxels .
"""
        Compute connectivity between a voxel and the other voxels.
        ----------------------------------------------------
        Parameters:
            vxloc: seed voxel location. voxel coordinate.
        Output:
            corrmap: corr values map, rmap or zmap
            pmap: p values map
        Example:
            >>> corrmap, pmap = m.vox2vox(vxloc)
        """ # solve problems as output of nifti data # won't affect fdr corrected result
self
vxloc
seed voxel location. voxel coordinate.
seed voxel location . voxel coordinate .
examples
>>> corrmap, pmap = m.vox2vox(vxloc)
>>> corrmap pmap = m . vox2vox ( vxloc )