io.py 文件源码

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

项目:pisap 作者: neurospin 项目源码 文件源码
def load(path, dtype=numpy.single):
    """ Load an image.

    Parameters
    ----------
    path: str
        the path to the data to be loaded.
    dtype: str
       type to which the data will be cast. Passing 'None' will not cast.

    Returns
    -------
    image: Image
        the loaded image.
    """
    # Load the image
    loader = get_loader(path)
    image = loader.load(path)

    # Cast the image if requested
    if dtype:
        image.data = image.data.astype(dtype)

    return image
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号