当前位置: 首页>>代码示例>>Python>>正文


Python Utility.write_freesurfer_curvature方法代码示例

本文整理汇总了Python中utility.Utility.write_freesurfer_curvature方法的典型用法代码示例。如果您正苦于以下问题:Python Utility.write_freesurfer_curvature方法的具体用法?Python Utility.write_freesurfer_curvature怎么用?Python Utility.write_freesurfer_curvature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在utility.Utility的用法示例。


在下文中一共展示了Utility.write_freesurfer_curvature方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: close_file

# 需要导入模块: from utility import Utility [as 别名]
# 或者: from utility.Utility import write_freesurfer_curvature [as 别名]
  def close_file(self, left_hemi_file, right_hemi_file, left_curvature_output_file, right_curvature_output_file):
    '''
    '''
    m = numpy.ctypeslib.as_array(self.__matrix.get_obj())
    m = m.reshape(self.__shape)
    
    
    #here
    lh_vertices, lh_faces = nibabel.freesurfer.read_geometry( left_hemi_file )
    rh_vertices, rh_faces = nibabel.freesurfer.read_geometry( right_hemi_file )
    
    sum_vector = numpy.sum( m, axis=0 )

    import sys, os
    sys.path.append(os.path.join( os.path.dirname( __file__ ),'../'))
    from utility import Utility

    # write curvature files
    Utility.write_freesurfer_curvature( left_curvature_output_file, sum_vector[0:len( lh_vertices )] )
    Utility.write_freesurfer_curvature( right_curvature_output_file, sum_vector[len( lh_vertices ):] )  # here we start with the offset
    # end here
    print 'crv written!!! FTW!'
    
    numpy.save( self.__matrix_file, m)
    
    print 'stored matrix'
开发者ID:FNNDSC,项目名称:F3000,代码行数:28,代码来源:fy_super_surface_map_action.py

示例2: create_curvature_files

# 需要导入模块: from utility import Utility [as 别名]
# 或者: from utility.Utility import write_freesurfer_curvature [as 别名]
  def create_curvature_files( matrix_file, left_hemi_file, right_hemi_file, left_curvature_output_file, right_curvature_output_file, manual=False ):
    '''
    '''

    # load the surfaces to compute the offsets correctly
    # as a reminder: the offset for the right hemisphere is the number of vertices in the left hemisphere
    # else-wise the vertex indices for right would start at 0 again
    lh_vertices, lh_faces = nibabel.freesurfer.read_geometry( left_hemi_file )
    rh_vertices, rh_faces = nibabel.freesurfer.read_geometry( right_hemi_file )

    # load the connectivity matrix
    #m = numpy.loadtxt( matrix_file, dtype=numpy.uint16 )
    m = numpy.load(matrix_file)

    sum_vector = numpy.sum( m, axis=0 )

    # write curvature files
    Utility.write_freesurfer_curvature( left_curvature_output_file, sum_vector[0:len( lh_vertices )] )
    Utility.write_freesurfer_curvature( right_curvature_output_file, sum_vector[len( lh_vertices ):] )  # here we start with the offset
开发者ID:FNNDSC,项目名称:F3000,代码行数:21,代码来源:surfaceconnectivity.py


注:本文中的utility.Utility.write_freesurfer_curvature方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。