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

Check for partially generated fovs #416

Merged
merged 15 commits into from
Aug 23, 2023
Merged

Check for partially generated fovs #416

merged 15 commits into from
Aug 23, 2023

Conversation

camisowers
Copy link
Contributor

@camisowers camisowers commented Aug 17, 2023

If you haven't already, please read through our contributing guidelines before opening your PR

What is the purpose of this PR?

Closes #400. Checks for incomplete FOV images which are missing data.

How did you implement your changes

Since scanning during a run starts at the top of the FOV, if something goes wrong we see this resulting in mostly 0 signal values at the bottom of the image. To be thorough, we check a specified number of images (default 5), and if the amount of non-zero pixels in that last 10 rows is less than 2%, we can identify this as a partial FOV.

Remaining issues

  • test for true positives and false positives on SPAIN data
  • implement in watcher and extraction notebooks

@camisowers camisowers self-assigned this Aug 17, 2023
@camisowers camisowers added the enhancement New feature or request label Aug 17, 2023
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@camisowers camisowers marked this pull request as ready for review August 21, 2023 21:29
Copy link
Contributor

@srivarra srivarra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

src/toffy/bin_extraction.py Show resolved Hide resolved
@camisowers camisowers requested a review from ngreenwald August 22, 2023 17:22
Copy link
Member

@ngreenwald ngreenwald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one tweak


# get fov and channel info
fovs = io_utils.list_folders(extraction_dir, "fov")
channels = io_utils.list_files(os.path.join(extraction_dir, fovs[0]), ".tiff")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should always have the gold channel as one of these. Will you confirm that this doesn't materially change the false positive/false negative rate on the recent data once you update?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just re-ran it and got the same result.

@camisowers camisowers requested a review from ngreenwald August 23, 2023 16:31
@ngreenwald ngreenwald merged commit 13bc9fa into main Aug 23, 2023
@ngreenwald ngreenwald deleted the incomplete_fov_check branch August 23, 2023 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check for partially generated FOVs
4 participants