Skip to content

Stain extraction: use a less strict condition across channels when thresholding - #316

Merged
rapids-bot[bot] merged 1 commit into
rapidsai:branch-22.08from
grlee77:stain-norm-fixes
Jul 28, 2022
Merged

rapids-bot[bot] merged 1 commit into
rapidsai:branch-22.08from
grlee77:stain-norm-fixes

Conversation

@grlee77

@grlee77 grlee77 commented Jun 23, 2022

Copy link
Copy Markdown
Contributor

I think we want to allow pixels with substantial attenuation in any of the channels rather than requiring substantial attenuation in all channels. The Macenko et. al. reference does not actually explain how the threshold was applied (min, max or mean across channels). However, qualitatively, results looked closer to expected with the any condition proposed here when I was working on a pending stain normalization example/demo.

I have also seen third party implementations where there is an RGB->LUV conversion and thresholding is done on the L channel rather than in luminance space. That seems reasonable and perhaps is more intuitive in choice of the threshold number (easier to think in fraction of brightness rather than absorbance units). However, making that change would be a bigger deviation from the publication and would involve some small additional overhead of the RGB->luminance conversion.

I have marked this as breaking as it will affect the estimated stain vectors produced by stain_extraction_pca.

I think we want to allow pixels with substantial attenuation in only a subset of channels.
@grlee77 grlee77 added breaking Introduces a breaking change bug Something isn't working labels Jun 23, 2022
@grlee77
grlee77 requested a review from a team as a code owner June 23, 2022 16:44

@gigony gigony left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me!

@jakirkham

Copy link
Copy Markdown
Member

@gpucibot merge

@rapids-bot
rapids-bot Bot merged commit 19741b7 into rapidsai:branch-22.08 Jul 28, 2022
@jakirkham

Copy link
Copy Markdown
Member

Thanks Greg for the PR and Gigon for the review! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Introduces a breaking change bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants