ccseg.py 文件源码

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

项目:IntroToDeepLearning 作者: robb-brown 项目源码 文件源码
def getSlices(self,paths):
        image,truth = paths
        image = nib.load(image).get_data(); truth = nib.load(truth).get_data()
        slicesWithValues = [unique(s) for s in where(truth>0)]
        sliceAxis = argmin([len(s) for s in slicesWithValues])
        slicesWithValues = slicesWithValues[sliceAxis]
        slc = repeat(-1,3); slc[sliceAxis] = slicesWithValues[0]
        if not self.padding is None:
            image, truth = [padImage(im,self.padding) for im in (image[slc][0],truth[slc][0])]
        else:
            image, truth = (image[slc][0],truth[slc][0])
        return (image,truth)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号