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

Using ScoreTiler with two different masks produces identical results. #395

Open
PinkEyeSurvivor opened this issue Apr 17, 2022 · 3 comments
Assignees
Labels
bug Something isn't working waiting-for-author

Comments

@PinkEyeSurvivor
Copy link

PinkEyeSurvivor commented Apr 17, 2022

Describe the bug

When using two different extraction masks (over two very different WSI regions) the output csv from ScoreTiler and the tiles extracted are the same when clearly the slide coordinates at a minimum should be different (and in this case the Nuclear score is anticipated to be different. Interestingly, the locate tiles function shows these tiles to be located in the correct positions and in the right numbers. Is there a file that is being leaked between class instances?

Here are my examples:

scored_tiles_extractor2 = ScoreTiler(
    scorer = NucleiScorer(),
    tile_size=(512, 512),
    n_tiles=20,
    level=0,
    check_tissue=True,
    tissue_percent=80.0,
    pixel_overlap=0, # default
    prefix="CA2scored/", # save tiles in the "scored" subdirectory of slide's processed_path
    suffix=".png" # default
) 

scored_tiles_extractor2.locate_tiles(
    slide=test_slide,
    extraction_mask=ca_2_poly_custom_mask,
) 

scored_tiles_extractor3 = ScoreTiler(
    scorer = NucleiScorer(),
    tile_size=(512, 512),
    n_tiles=20,
    level=0,
    check_tissue=True,
    tissue_percent=80.0,
    pixel_overlap=0, # default
    prefix="CA1scored/", # save tiles in the "scored" subdirectory of slide's processed_path
    suffix=".png" # default
)

scored_tiles_extractor3.locate_tiles(
    slide=test_slide,
    extraction_mask=poly_custom_mask,
)

Expected behavior
I would expect that given two different extraction masks I should at least pull tiles with different coordinates between masks and in cases where appropriate produce differing nuclear scores.

Some copy/paste from the .csv:

[from CA1]
CA1scored/tile_0_level0_13501-26400-14013-26912.png,0.7599788363195672,1.0
CA1scored/tile_1_level0_14013-25888-14525-26400.png,0.7598940221993982,0.999888185646619
CA1scored/tile_2_level0_12989-16672-13501-17184.png,0.7506675064022765,0.987724445743891
CA1scored/tile_3_level0_11965-16160-12477-16672.png,0.7480076281028041,0.9842178059115734
CA1scored/tile_4_level0_12477-16160-12989-16672.png,0.7333986936009114,0.9649581760096282
CA1scored/tile_5_level0_11965-15648-12477-16160.png,0.7279953669776805,0.9578347221404039
[truncated but 20 results reported]

[from CA2]
CA2scored/tile_0_level0_13501-26400-14013-26912.png,0.7599788363195672,1.0
CA2scored/tile_1_level0_14013-25888-14525-26400.png,0.7598940221993982,0.999888185646619
CA2scored/tile_2_level0_12989-16672-13501-17184.png,0.7506675064022765,0.987724445743891
CA2scored/tile_3_level0_11965-16160-12477-16672.png,0.7480076281028041,0.9842178059115734
CA2scored/tile_4_level0_12477-16160-12989-16672.png,0.7333986936009114,0.9649581760096282
CA2scored/tile_5_level0_11965-15648-12477-16160.png,0.7279953669776805,0.9578347221404039
[truncated but 20 results reported]

Screenshots showing correct tile positions:

Screen Shot 2022-04-17 at 12 55 27 AM

Screen Shot 2022-04-17 at 12 55 17 AM

@PinkEyeSurvivor PinkEyeSurvivor added the bug Something isn't working label Apr 17, 2022
@ernestoarbitrio
Copy link
Member

Thanks for reporting it and sorry for the late reply. We're on it :D we will keep you posted

@alessiamarcolini
Copy link
Collaborator

Dear @PinkEyeSurvivor, would it be possible for you to share the WSI used for the example?

@alessiamarcolini alessiamarcolini self-assigned this May 5, 2022
@alessiamarcolini
Copy link
Collaborator

@PinkEyeSurvivor Also, I think the important missing information is: how do you call the extract method? Are you correctly passing the extraction_mask?
If left to default, the tiler will use the BiggestTissueBoxMask, therefore explaining why you get the same tiles :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting-for-author
Projects
None yet
Development

No branches or pull requests

3 participants