Skip to content
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

ROI tests #18

Closed
tcompa opened this issue Jul 22, 2022 · 2 comments
Closed

ROI tests #18

tcompa opened this issue Jul 22, 2022 · 2 comments
Assignees
Labels
Tables AnnData and ROI/feature tables

Comments

@tcompa
Copy link
Collaborator

tcompa commented Jul 22, 2022

After closing #23 and #22, we should add some tests (especially for the functions in lib_regions_of_interest.py), and fix the illumination-correction unit test (currently marked as xfail in pytest).

@tcompa tcompa self-assigned this Jul 22, 2022
tcompa referenced this issue in fractal-analytics-platform/fractal-client Jul 22, 2022
tcompa referenced this issue in fractal-analytics-platform/fractal-client Jul 22, 2022
tcompa referenced this issue in fractal-analytics-platform/fractal-client Jul 29, 2022
@tcompa
Copy link
Collaborator Author

tcompa commented Aug 3, 2022

Basic tests of functions in lib_regions_of_interest are in-place. The relevant test (below) is iterated for level=0,1,2 and coarsening_xy=2,3,7 (where 7 is an extreme case).
https://github.com/fractal-analytics-platform/fractal/blob/a1f86060bcc897ca3a99c78937f2633d5a8550ae/tests/test_unit_ROI_indices.py#L78-L130

In the output indices, we only check some basic properties, like:

  • Verify that there are no "holes" (pixels which are not part of any ROI);
  • Verify that ROIs' shapes only differ by a number of pixels <coarsening_xy.

The full output is

Original shape: (4, 4320, 5120)
coarsening_xy=2, level=0
Expected shape: (4, 4320, 5120)
FOV-ROI indices:
[0, 4, 0, 2160, 0, 2560]
[0, 4, 0, 2160, 2560, 5120]
[0, 4, 2160, 4320, 0, 2560]
[0, 4, 2160, 4320, 2560, 5120]

.
Original shape: (4, 4320, 2560)
coarsening_xy=2, level=1
Expected shape: (4, 2160, 2560)
FOV-ROI indices:
[0, 4, 0, 1080, 0, 1280]
[0, 4, 0, 1080, 1280, 2560]
[0, 4, 1080, 2160, 0, 1280]
[0, 4, 1080, 2160, 1280, 2560]

.
Original shape: (4, 4320, 1280)
coarsening_xy=2, level=2
Expected shape: (4, 1080, 1280)
FOV-ROI indices:
[0, 4, 0, 540, 0, 640]
[0, 4, 0, 540, 640, 1280]
[0, 4, 540, 1080, 0, 640]
[0, 4, 540, 1080, 640, 1280]

.
Original shape: (4, 4320, 640)
coarsening_xy=2, level=3
Expected shape: (4, 540, 640)
FOV-ROI indices:
[0, 4, 0, 270, 0, 320]
[0, 4, 0, 270, 320, 640]
[0, 4, 270, 540, 0, 320]
[0, 4, 270, 540, 320, 640]

.
Original shape: (4, 4320, 5120)
coarsening_xy=3, level=0
Expected shape: (4, 4320, 5120)
FOV-ROI indices:
[0, 4, 0, 2160, 0, 2560]
[0, 4, 0, 2160, 2560, 5120]
[0, 4, 2160, 4320, 0, 2560]
[0, 4, 2160, 4320, 2560, 5120]

.
Original shape: (4, 4320, 1706)
coarsening_xy=3, level=1
Expected shape: (4, 1440, 1706)
FOV-ROI indices:
[0, 4, 0, 719, 0, 853]
[0, 4, 0, 719, 853, 1706]
[0, 4, 719, 1439, 0, 853]
[0, 4, 719, 1439, 853, 1706]

.
Original shape: (4, 4320, 568)
coarsening_xy=3, level=2
Expected shape: (4, 480, 568)
FOV-ROI indices:
[0, 4, 0, 239, 0, 284]
[0, 4, 0, 239, 284, 568]
[0, 4, 239, 479, 0, 284]
[0, 4, 239, 479, 284, 568]

.
Original shape: (4, 4320, 189)
coarsening_xy=3, level=3
Expected shape: (4, 160, 189)
FOV-ROI indices:
[0, 4, 0, 80, 0, 94]
[0, 4, 0, 80, 94, 189]
[0, 4, 80, 160, 0, 94]
[0, 4, 80, 160, 94, 189]

.
Original shape: (4, 4320, 5120)
coarsening_xy=7, level=0
Expected shape: (4, 4320, 5120)
FOV-ROI indices:
[0, 4, 0, 2160, 0, 2560]
[0, 4, 0, 2160, 2560, 5120]
[0, 4, 2160, 4320, 0, 2560]
[0, 4, 2160, 4320, 2560, 5120]

.
Original shape: (4, 4320, 731)
coarsening_xy=7, level=1
Expected shape: (4, 617, 731)
FOV-ROI indices:
[0, 4, 0, 308, 0, 365]
[0, 4, 0, 308, 365, 731]
[0, 4, 308, 617, 0, 365]
[0, 4, 308, 617, 365, 731]

.
Original shape: (4, 4320, 104)
coarsening_xy=7, level=2
Expected shape: (4, 88, 104)
FOV-ROI indices:
[0, 4, 0, 44, 0, 52]
[0, 4, 0, 44, 52, 104]
[0, 4, 44, 88, 0, 52]
[0, 4, 44, 88, 52, 104]

@tcompa
Copy link
Collaborator Author

tcompa commented Aug 3, 2022

I'm closing this now, but feel free to re-open to suggest other (more thorough) checks on the FOV-ROI indices.

@tcompa tcompa closed this as completed Aug 3, 2022
@jluethi jluethi transferred this issue from fractal-analytics-platform/fractal-client Sep 2, 2022
@jluethi jluethi moved this from Done to Done Archive in Fractal Project Management Oct 5, 2022
@tcompa tcompa added the Tables AnnData and ROI/feature tables label Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tables AnnData and ROI/feature tables
Projects
None yet
Development

No branches or pull requests

2 participants