-
Notifications
You must be signed in to change notification settings - Fork 0
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
3D Feature Extraction debugging #122
Conversation
If ROI label stored as string of float, int() cannot convert and get error ValueError: invalid literal for int() with base 10: '1.0'
Load parent object segmentation and perform masking to select child objects belonging to parent. This fix now allows feature extraction of child objects (previously result was empty array). Also improved logging.
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #122 +/- ##
========================================
- Coverage 0.27% 0.26% -0.01%
========================================
Files 54 55 +1
Lines 4805 4942 +137
========================================
Hits 13 13
- Misses 4792 4929 +137 ☔ View full report in Codecov by Sentry. |
Ensures expanded labels do not cross into neighboring object.
Hey @nrepina This looks good, great to hear that it's working now. We now also have the linking dataset available in the test suite that you've added @nrepina (see https://zenodo.org/records/10683087). I'll work towards getting a test on that one running, because it actually contains nuclei & organoids => we can actually test for this case with the new test dataset :) The upsampling already seems nicely integrated, though testing this further should wait for ngio flexibility. Thus, I think the TODO list is:
|
Turns out, using the https://zenodo.org/records/10683087 dataset for this tests won't be trivial atm (until there is a better fix for fractal-analytics-platform/fractal-tasks-core#771). The test data contains organoids that have a lower resolution label image than the nuc. I'll give it a quick shot to generate a "psuedo-org" label image on-the-fly to be able to run those tests |
Hey @jluethi, great, sounds like a plan. It has been on my to-do list to update the Zenodo test dataset with an object segmentation that matches the child segmentation level. I will get to that in the coming days and this should resolve the testing case until Fractal has a better solution for upscaling :) Will ping you once it is updated. |
In the updated dataset, organoid and cell segmentation both performed on same zarr level 0, which allows for testing of cell feature extraction with masking. Expected test results values updated accordingly (only for integration tests) due to minor changes in segmentation.
@jluethi update of Zenodo dataset is finished! Now we should be able to cover the use case of masked single-cell feature extraction with a test dataset. I updated the scmpx integration tests, it's now ready for you to update the feature extraction tests and merge to main :) |
Hey @nrepina
=> the data calculated in the test is not what the test expects. I'll still have to update the tests for the measurement to actually test for the new behavior & use the new test data. |
@nrepina I now added a test to check for the new behavior. Before the fix, it only got 1 measurement from your very nice new test dataset. After the fix, it gets 20 measurements and they look reasonable. So I'd say it's working well! :) I also simplified the task logic a bit. I now load the Now something in the old test case appears to break with the new masking approach. I'll have to look into that a bit more early next week. I think it's related to handling of empty arrays or missing labels or such. Not 100% sure yet. Besides that, this PR now looks good and the scmultiplex measurements now make correct & tested masked measurement. The only thing missing to merge this is fixing the |
@nrepina I now fixed the one remaining issue coming from my refactoring. We also need to upscale the masking images, as we in principle support masking images of a lower res than the intensity image (just not when there is a non-integer upscaling factor). This is also added now. We can certainly refactor this test in the future, as it's somewhat slow (40s). Let's figure out what goes wrong with the Mesh measurements, then this should be ready to merge |
For the record: The remaining issue with the Mesh Measurement task comes down to a difference between VTK 9.3.1 vs. VTK 9.4.0. Let's see if we can figure out which version is "more correct" / what actually changed |
I've pinned VTK to 9.3.1 for the moment and will merge this. It will be important to look into this more (see #124) |
This PR addresses a few bug fixes in the Feature Extraction task:
@jluethi Please have a look and we can decide on the best approach for these fixes before merging into main.