A pathology slide is cut into tiles, and for each tile a machine answered yes or no. Paint those answers and you have a TIL map.
Shave a thin slice of cancer tissue onto a glass slide, stain it with
haematoxylin and eosin (H&E), and the nuclei come out purple and the
cytoplasm pink. A pathologist looks at that slide down a microscope and makes
a diagnosis.
What is in the picture is not only cancer cells.
Lymphocytes — the immune cells the body sent to attack the tumour — are
in there too. Small, dark, round nuclei packed close together: that is them.
How many of those lymphocytes have arrived has been an important marker
for a long time. Tumours with more of them have been reported to do better, in
several cancer types. But how do you count "how many"?
The map has only three colours.
Colour
RGB
Meaning
black
(0, 0, 0)
no tissue — bare glass
blue
(0, 0, 255)
tissue, but no lymphocyte
red
(255, 0, 0)
this tile has a lymphocyte
So this file is not a photograph. It is a table of verdicts painted in colour.
One pixel corresponds to one 50 µm tile of tissue.
Three colours and nothing else. No in-between shades — because this picture is already decided.
PythonRuns in your browser
Turning the three colours into 0 · 1 · 2 makes them easier to handle.
That is all the read_map() of the til package we use
throughout this course does.
One cell is 50 × 50 µm, so 25,197 tissue cells is roughly 63 mm².
PythonRuns in your browser
Put the two side by side and you can see at a glance why this number matters.
PythonRuns in your browser
Open the eight maps that ship with the course. The tile counts and the infiltration rate come with them.
Loading…
🤔 Check yourself
What does one pixel of a TIL map mean?
Answer The map was made by cutting the slide on a 50 µm grid and getting a verdict per tile. The unit is a tile, not a cell. How much that unit matters is lesson 4.
🤔 Check yourself
Why are there no intermediate colours (say, pale pink) in this map?
Answer What the CNN produces is a probability between 0 and 1. Someone cut it at a threshold to make it 0/1 and then painted it. That decision to draw a line is the subject of lesson 3.