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)
评论列表
文章目录