-
Notifications
You must be signed in to change notification settings - Fork 352
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
Scale flows to correct shape #775
Conversation
Codecov Report
@@ Coverage Diff @@
## main #775 +/- ##
==========================================
+ Coverage 63.39% 63.41% +0.02%
==========================================
Files 14 14
Lines 2964 2966 +2
==========================================
+ Hits 1879 1881 +2
Misses 1085 1085
|
technically the correct thing to do is to leave them in the unresized form, so let's return a resized array if cellpix is none |
I think I see, my solution works but it shouldn't because compute_masks should respect the Here's the data in case I didn't describe it well enough before. This is the state 5 loops through the iterator on line 655 in _run_cp() The input dP being processed has a shape of (2, 59, 77, 77) after tiling: >>>[dPi.shape for dPi in dP[0][0:5]]
[(77, 77), (77, 77), (77, 77), (77, 77), (77, 77)]
>>>[dPi.shape for dPi in dP[1][0:5]]
[(77, 77), (77, 77), (77, 77), (77, 77), (77, 77)] And the output masks are reshaped because of this line: >>>[m.shape for m in masks]
[(232, 232), (232, 232), (232, 232), (232, 232), (232, 232)] But the >>>[pi.shape for pi in p]
[(2, 232, 232), (2, 232, 232), (2, 77, 77), (2, 232, 232), (2, 77, 77)] So, I have two thoughts, (1) should the resize be the opposite here to be |
Okay new solution refactors |
Per #774, when
resize
is notNone
, masks get resized but the flows don't indynamics.compute_masks()
. This isn't immediately an issue, except that if no putative cellpix are found (here), zero-filled arrays of the original size are returned.The result is that, depending on if putative cellpix are found, iterating through the images (here) produces a list of inconsistent np array shapes. Finally, trying to convert the list-of-arrays into a stack of arrays fails at line 663.
This fix reshapes the flows to the correct shape.
Should we think about tests that address this?