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

Utilize TSAI tiler to crop out FOVs #20

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open

Utilize TSAI tiler to crop out FOVs #20

wants to merge 27 commits into from

Conversation

alex-l-kong
Copy link
Contributor

What is the purpose of this PR?

Closes #12.

How did you implement your changes

Using the .imzml file, and combined with the output from TSAI:

  1. Assign each scanned coordinate on the slide to their respective core, as labeled by TSAI
  2. Use the coordinates to crop out the FOVs

Remaining issues

Currently, generate_glycan_mask segments out all of the cores at once. The result of map_coordinates_to_core_name, however, can be used to segment out individual cores. We still need to update generate_glycan_mask to handle individual core segmentation.

@alex-l-kong alex-l-kong self-assigned this Nov 16, 2023
@alex-l-kong alex-l-kong marked this pull request as draft November 16, 2023 23:23
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@alex-l-kong alex-l-kong marked this pull request as ready for review November 17, 2023 21:38
Copy link
Collaborator

@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.

Just one small aesthetic thing, and a question about "Z" coordinates.

conftest.py Outdated Show resolved Hide resolved
src/maldi_tools/extraction.py Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Nov 21, 2023

Pull Request Test Coverage Report for Build 9131611699

Details

  • 59 of 59 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.9%) to 97.753%

Totals Coverage Status
Change from base Build 6777233943: 0.9%
Covered Lines: 213
Relevant Lines: 214

💛 - Coveralls

Copy link
Collaborator

@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 to me!

@alex-l-kong
Copy link
Contributor Author

@kxleow ran into a case where multiple slides need to be supported. That is currently not the case, as we assume the user has only one poslog file per run. This will need to be added into the pipeline.

@alex-l-kong
Copy link
Contributor Author

Cropping now supports multiple poslog files.

@kxleow
Copy link

kxleow commented Aug 8, 2024

Alternative to using poslog and imzml for core cropping:

  1. After generating binary mask, use imageJ to segment/split up cores into individual binary masks
  2. Then use centroids in json to assign core name or positions to each mask
  3. Output table - a column with mask ids and a column with corresponding core names
    Please create a new branch, perhaps a separate notebook for this function. Thanks!

Sub-issue: Find nearest neighbours if centroid not found

  • Encountered a case where the centroid fell exactly on a point that was not acquired in a core region.
  • Would be helpful to consider these cases by testing for a few neighbouring points if the centroid is not found in any cores
  • to assist with troubleshooting, would also be useful to print which centroid the function failed to match

@kxleow
Copy link

kxleow commented Sep 17, 2024

Ran into a case with >4 TMAs combined and the order of TMAs did not follow a sequential order in the image (left-right or top-bottom). The order of TMAs were found in the warnings generated at the core cropping step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatic identification of RNCM position for TMA cores
4 participants