Skip to content

Commit 6b8146e

Browse files
Enable specifying resolution in S3 block extraction script
1 parent 857b171 commit 6b8146e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/extract_block_from_s3.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
def extract_block_from_s3(args):
1212
os.makedirs(args.output_folder, exist_ok=True)
1313

14-
resolution = 0.38 * (2 ** args.scale)
14+
resolution = [res * (2 ** args.scale) for res in args.resolution]
1515
center = json.loads(args.position)
16-
center = [int(ce / resolution) for ce in center[::-1]]
16+
center = [int(ce / res) for ce, res in zip(center[::-1], resolution)]
1717

1818
for source in args.sources:
1919
print("Extracting source:", source, "from", args.cochlea)
@@ -73,6 +73,7 @@ def main():
7373
parser.add_argument("--scale", type=int, default=0)
7474
parser.add_argument("--as_float", action="store_true")
7575
parser.add_argument("--component_ids", type=int, nargs="+")
76+
parser.add_argument("--resolution", type=float, nargs="+", default=[0.38] * 3)
7677
parser.add_argument("--mask_column")
7778
args = parser.parse_args()
7879

0 commit comments

Comments
 (0)