objects.py 文件源码

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

项目:prysm 作者: brandondube 项目源码 文件源码
def from_file(path, scale):
        ''' Reads a file into a new Image instance, always monochrome

        Args:
            path (`string`): path to a file.

            scale (`float`): pixel scale, in microns.

        Returns:
            `Image`: a new image object.

        Notes:
            TODO: proper handling of images with more than 8bpp.
        '''
        imgarr = imread(path, flatten=True, mode='F')

        return Image(data=np.flip(imgarr, axis=0) / 255, sample_spacing=scale, synthetic=False)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号