utils.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:niworkflows 作者: poldracklab 项目源码 文件源码
def _3d_in_file(in_file):
    ''' if self.inputs.in_file is 3d, return it.
    if 4d, pick an arbitrary volume and return that.

    if in_file is a list of files, return an arbitrary file from
    the list, and an arbitrary volume from that file
    '''

    in_file = filemanip.filename_to_list(in_file)[0]

    try:
        in_file = nb.load(in_file)
    except AttributeError:
        in_file = in_file

    if in_file.get_data().ndim == 3:
        return in_file

    return nlimage.index_img(in_file, 0)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号