peal.data.dataset_generators.StainingConfounderGenerator¶
- class peal.data.dataset_generators.StainingConfounderGenerator[source]¶
Bases:
objectBuild a histology dataset whose confounder is the hematoxylin staining.
Converts the
MUSandSTRtissue classes of a raw NCT-CRC style folder to PNG, estimates the stain vectors of every image (Macenko-style OD/PCA estimation), measures the 99th-percentile intensity of hematoxylin-dominated pixels and splits at the median into weak/strong staining. Then 16000 samples are drawn so that class (Cancer: STR=1) andConfounder(strong staining) follow a fixed 2x2 pattern.- Parameters:
Methods
Convert the images, estimate staining and write
data.csv.