def load_raw(path, prompt_info=None):
try:
info = load_info(path)
except FileNotFoundError as error:
if prompt_info is None:
raise error
else:
result = prompt_info()
if result is None:
return
else:
info, save = result
info = [info]
if save:
base, ext = _ospath.splitext(path)
info_path = base + '.yaml'
save_info(info_path, info)
dtype = _np.dtype(info[0]['Data Type'])
shape = (info[0]['Frames'], info[0]['Height'], info[0]['Width'])
movie = _np.memmap(path, dtype, 'r', shape=shape)
if info[0]['Byte Order'] != '<':
movie = movie.byteswap()
info[0]['Byte Order'] = '<'
return movie, info
评论列表
文章目录