-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add check/fix for incomplete final frame
- Loading branch information
Lachlan Whitehead
committed
Sep 3, 2024
1 parent
34ffc20
commit 317eb5a
Showing
1 changed file
with
9 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,6 +192,15 @@ def read_image(cls, values: dict): | |
# If the image was convertible to AICSImage, we should use the metadata from there | ||
if aics: | ||
values["input_image"] = aics.xarray_dask_data | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
DrLachie
Contributor
|
||
#check if final frame is complte. If not, get rid of it | ||
final_frame = values["input_image"][-1] | ||
try: | ||
final_frame.compute() | ||
except ValueError as e: | ||
print("Final frame is borked. Acquisition probably stopped prematurely. Removing final frame.") | ||
values["input_image"] = values["input_image"][0:-1] | ||
|
||
# Take pixel sizes from the image metadata, but only if they're defined | ||
# and only if we don't already have them | ||
if all(size is not None for size in aics.physical_pixel_sizes) and values.get("physical_pixel_sizes") is None: | ||
|
Two things:
final_frame.compute()
, the try except only checks if its corrupted or not.. Is this what usually happens? I was under the impression you get an array of a different shape and that was the issue.