Commit 0db38286 authored by payno's avatar payno
Browse files

[utils][change_image_key_control] handle slices provided as "120:"

parent de9aa31e
Pipeline #38167 passed with stages
in 4 minutes and 31 seconds
......@@ -689,11 +689,13 @@ def change_image_key_control(
image_keys_control = h5py_read_dataset(node[image_keys_control_path])
# filter frame indexes
if isinstance(frames_indexes, slice):
frames_indexes = list(
range(
frames_indexes.start, frames_indexes.stop, frames_indexes.step or 1
)
)
step = frames_indexes.step
if step is None:
step = 1
stop = frames_indexes.stop
if stop is None:
stop = len(image_keys)
frames_indexes = list(range(frames_indexes.start, stop, step))
frames_indexes = list(
filter(lambda x: 0 <= x <= len(image_keys_control), frames_indexes)
)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment