-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Final frame fix #82
Merged
Merged
Final frame fix #82
Changes from 9 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f378a3b
unify command line args with config file args
9f2cea7
update test
a2106dd
Merge remote-tracking branch 'origin/master' into unify_param_names
0d93f9e
update test_arg_parser
629cadc
update test_batch_deskew using time-range
34ffc20
fix help strings
317eb5a
add check/fix for incomplete final frame
78dadb8
move final frame fix to model validator
02dc13f
move help to models
b014a00
Use warning rather than warn; use drop_isel to drop incomplete frames
multimeric 74106c7
Remove old incomplete acquisition code
multimeric 951105b
fix to not remove channel when final frame is incomplete
50f35b6
Merge branch 'master' into final_frame_fix
e3da612
update psf_num_iter to decon_num_iter
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
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 | ||||
---|---|---|---|---|---|---|
|
@@ -59,6 +59,7 @@ def read_image(cls, values: dict): | |||||
from lls_core.types import is_pathlike | ||||||
from pathlib import Path | ||||||
input_image = values.get("input_image") | ||||||
logger.info(f"Processing File {input_image}") # this is handy for debugging | ||||||
if is_pathlike(input_image): | ||||||
if values.get("save_name") is None: | ||||||
values["save_name"] = Path(values["input_image"]).stem | ||||||
|
@@ -74,6 +75,21 @@ def read_image(cls, values: dict): | |||||
# Use the Deskew version of this validator, to do the actual image loading | ||||||
return super().read_image(values) | ||||||
|
||||||
@validator("input_image", pre=True, always=True) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
def incomplete_final_frame(cls, v: DataArray) -> Any: | ||||||
""" | ||||||
Check final frame, if acquisition is stopped halfway through it causes failures | ||||||
This validator will remove a bad final frame | ||||||
""" | ||||||
final_frame = v.isel(T=-1,C=-1) | ||||||
try: | ||||||
final_frame.compute() | ||||||
except ValueError as e: | ||||||
logger.warn("Final frame is borked. Acquisition probably stopped prematurely. Removing final frame.") | ||||||
v = v[0:-1] | ||||||
multimeric marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
return v | ||||||
|
||||||
|
||||||
@validator("workflow", pre=True) | ||||||
def parse_workflow(cls, v: Any): | ||||||
# Load the workflow from disk if it was provided as a path | ||||||
|
@@ -345,7 +361,7 @@ def _process_crop(self) -> Iterable[ImageSlice]: | |||||
deconv_args: dict[Any, Any] = {} | ||||||
if self.deconvolution is not None: | ||||||
deconv_args = dict( | ||||||
num_iter = self.deconvolution.psf_num_iter, | ||||||
num_iter = self.deconvolution.decon_num_iter, | ||||||
psf = self.deconvolution.psf[slice.channel].to_numpy(), | ||||||
decon_processing=self.deconvolution.decon_processing | ||||||
) | ||||||
|
@@ -390,13 +406,13 @@ def _process_non_crop(self) -> Iterable[ImageSlice]: | |||||
dxdata=self.dx, | ||||||
dzpsf=self.dz, | ||||||
dxpsf=self.dx, | ||||||
num_iter=self.deconvolution.psf_num_iter | ||||||
num_iter=self.deconvolution.decon_num_iter | ||||||
) | ||||||
else: | ||||||
data = skimage_decon( | ||||||
vol_zyx=data, | ||||||
psf=self.deconvolution.psf[slice.channel].to_numpy(), | ||||||
num_iter=self.deconvolution.psf_num_iter, | ||||||
num_iter=self.deconvolution.decon_num_iter, | ||||||
clip=False, | ||||||
filter_epsilon=0, | ||||||
boundary='nearest' | ||||||
|
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.