brain_pipeline.py 文件源码

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

项目:BRATS 作者: e271141 项目源码 文件源码
def save_labels(fns):
    '''
    INPUT list 'fns': filepaths to all labels
    '''
    progress.currval = 0 
    slices=np.zeros((240,240)) 

    label=glob(fns+'/*OT.nii.gz')

    print 'len of label:',len(label)
    print 'type of label:',type(label)

    s =  ni.load_image(label[0])
    print s.shape
    print "=========="
    label_idx=0
    for slice_idx in xrange(1):
        slices=np.asarray(s[:,:,slice_idx])
        print slices.shape
        io.imsave(ORI_PATH+'Labels/{}_{}L.png'.format(label_idx, slice_idx), slices)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号