|
| 1 | +import os |
| 2 | +import json |
| 3 | +from flamingo_tools.extract_block_util import extract_block |
| 4 | + |
| 5 | + |
| 6 | +blocks_to_annotate = [ |
| 7 | + "[1157.0001356895104,1758.4586038866773,994.1494008046312]", |
| 8 | + "[1257.4854619519856,1712.418054399143,942.993234707371]", |
| 9 | + "[1329.892068232878,1421.8487165158099,712.9291398862247]", |
| 10 | + "[1035.3286672774282,1844.919679510697,826.5595378176982]" |
| 11 | +] |
| 12 | + |
| 13 | +empty_blocks = [ |
| 14 | + "[1066.8140315229548,1654.678601097876,994.1494008046308]", |
| 15 | + "[1372.9314226188667,1698.1843589090392,805.5965454893357]", |
| 16 | + "[1079.515087933512,1425.90033123735,1006.1353228190363]", |
| 17 | + "[825.208612674945,565.9088211207202,1170.995860154057]", |
| 18 | +] |
| 19 | + |
| 20 | + |
| 21 | +input_path = "G_EK_000233_L/images/ome-zarr/Vglut3.ome.zarr" |
| 22 | +input_key = "s0" |
| 23 | +output_key = None |
| 24 | +resolution = 0.38 |
| 25 | + |
| 26 | +output_folder = "./G_EK_000233_L_VGlut3" |
| 27 | +os.makedirs(output_folder, exist_ok=True) |
| 28 | +for coords in blocks_to_annotate: |
| 29 | + halo = [196, 196, 48] |
| 30 | + coords = json.loads(coords) |
| 31 | + extract_block( |
| 32 | + input_path, coords, output_folder, input_key, output_key, resolution, halo, |
| 33 | + tif=True, s3=True, |
| 34 | + ) |
| 35 | + |
| 36 | +output_folder = "./G_EK_000233_L_VGlut3_empty" |
| 37 | +os.makedirs(output_folder, exist_ok=True) |
| 38 | +for coords in empty_blocks: |
| 39 | + coords = json.loads(coords) |
| 40 | + extract_block( |
| 41 | + input_path, coords, output_folder, input_key, output_key, resolution, halo, |
| 42 | + tif=True, s3=True, |
| 43 | + ) |
0 commit comments