def generate_n5_format(compressors=pyn5.CompressionType): here = Path(__file__).resolve().parent data_dir = here.parent / "data" path = data_dir / "pyn5.n5" im = imread(data_dir / "reference_image.png") f = pyn5.File(path, pyn5.Mode.CREATE_TRUNCATE) for compressor in compressors: name = str(compressor) f.create_dataset(name, data=im, chunks=CHUNKS, compression=compressor)
def read_with_pyn5(fpath, ds_name, nested): import pyn5 return pyn5.File(fpath)[ds_name][:]
def file_(tmp_path): f = pyn5.File(tmp_path / "test.n5") yield f