-
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
Errors when final frame is incomplete #80
Comments
Thanks, this is a helpful description. Pradeep's existing code for checking this is in the repo here: napari_lattice/core/lls_core/models/lattice_data.py Lines 332 to 348 in f2c4824
However, I need some guidance on when to use it. Conceptually it would be great as a pydantic validation, but that isn't a good idea if it's compute intensive. If it is, then maybe it could become part of the |
Ahh, I think there is a logic error in the code.. I think if the latticedata has a variable that stores the shape of the first image slice (i.e, time=0 and ch=0), we can then access that here to verify. |
We will have to check shape after compute though.. as its possible that as a dask array it may store a different shape. |
Well after the other validators have run, we're guaranteed to have it as an xarray. I think I can pull out the first and last slice without loading anything else from disk. It depends how "first" and "last" are defined though: which channel, for instance? |
Actually, is this function (check_incomplete_acquisition) being accessed anywhere?
first would be time 0 and channel 0 last could be max timepoint and max channel for now. |
No, the function is currently unused. |
Ahh, ok. So, we need to run this when processing
Essentially, this function will
Is it easy to implement this only for last timepoint in save_image functions? |
Correct me if I'm wrong but that function computes the entire raw (non-deskewed/processed) volume? I just gave this a shot and it's computationally expensive. A simpler check is just to attempt to compute the final timepoint of the raw, this raises a value error if it's an incomplete acquisition. My proposal is to run this test when first accessing the image (which I believe happens in lls_core.models.deskew.read_image, if the value error is raised, then log an error and redefine the raw data omitting the final timepoint. Testing this now |
You are right it does, but I'm thinking we put this function while processing the data, i.e., when running the saving/workflow processing..
I don't think this will be computationaly expensive as its just checking the shape. The added advantage is if there are any other acquisition issues in any frame (not only last timepoint), we can catch that as well. Your idea works too, but we are omitting the last frame from processing as a solution. |
I think it's unlikely there's an issue (of this type) in anything but the last frame, and if there is it's probably a more pressing one that should be dealt with differently. I like the idea of running the test up front as it at least throws the error/warning immediately. The problem I was having with debugging is everything looked like it was working unitl the final timepoint and then failed. My inelegant (but working) solution is here: napari_lattice/core/lls_core/models/deskew.py Line 196 in 317eb5a
|
Could you create a pull request for this? |
Often (relatively) a user will stop an acquisition mid frame, this results in the final timepoing being incomplete.
If we draw rois and are decvonvolving (I haven't tested just cropping yet) we get three cases.
napari_lattice/core/lls_core/deconvolution.py
Line 145 in f57b489
napari_lattice/core/lls_core/deconvolution.py
Line 210 in f57b489
I think we have a few options for dealing with this:
I think my preference would be number 2
The text was updated successfully, but these errors were encountered: