Macroscopic Specimen Photography
Photographing a gross specimen next to a ruler and then rescaling the image so a fixed number of pixels always means one millimetre — which turns a pile of phone photos into a measurable series.
What it is
A macroscopic photograph has no inherent scale. The same specimen shot from 40 cm and 60 cm produces two images in which the same tumour is a different number of pixels across, so nothing can be measured or compared until the scale is recovered. Putting a ruler in the frame supplies the missing reference, exactly as a calibrant slide does for colour in Colour Calibration — a known quantity in the image, solved for the unknown transform.
The group’s macroCalibrate tool implements the direct version of this. For each image the operator clicks two points spanning a known distance on the ruler; the tool computes pixels-per-millimetre from the click separation, then resizes the entire image so that the output lands on a fixed target scale, and logs the result to scale_factors.csv with the before-and-after dimensions and the scale factor applied.
The design decision worth noticing is that it resamples rather than merely records. It would have been easier to store pixels-per-mm as metadata and leave the image alone. Instead every output image is rendered at the same physical scale, so a downstream measurement can be taken in pixels on any image in the series and mean the same thing. That is the right choice for building a comparable archive, and it costs one resampling step — irreversible, and worth keeping the originals for.
Why it matters for my work
Gross measurement feeds staging directly — tumour size, distance to margin — and it is currently done with a ruler at the cut-up bench and written down once. A calibrated photographic series makes those measurements re-checkable after the fact, which is the part that matters for audit and for teaching. It also makes macroscopic images usable as data rather than illustration.
The trap is what else is in the frame. In the group’s own sample images the cassette identifier and institution are legible next to the ruler, because both were placed there for the same reason — to make the photograph self-documenting at the bench. That is good practice in the lab and a problem the moment the images leave it. Nothing in the calibration tool touches this: it resizes the whole frame, identifier included, and writes it out. De-identification treats a legible accession or cassette number as an identifier in its own right, so a calibrated archive built this way is an identified archive unless the crop is handled deliberately. The fix is procedural rather than technical — frame or crop so the label is outside the measured region — and it has to be decided before the photographs are taken, not after.
Practical notes from the implementation
- The known distance is a hardcoded convention, not a checked one. The tool assumes the two clicks span a fixed physical length. An operator who clicks two centimetres instead of one gets a silently wrong scale with no warning — the single most likely error in routine use, and the cheapest to guard against by having the operator state the distance.
- Phone photographs carry EXIF orientation that OpenCV ignores. Images loaded with
cv2.imreaddo not have the rotation flag applied, so a portrait-held phone shot can be processed sideways. It does not affect the scale factor, but it affects everything after. - Input and output paths are both entered by hand and the output keeps the input filename, so entering the same path for both would overwrite the originals in place — and the originals are the only unresampled copy. Worth a separate output directory as a rule.
- Skipped and unprocessed images leave no row in the log, so the CSV records what was done rather than what was seen; it cannot be used on its own to confirm a series is complete.
How it connects
Colour Calibration — the same principle, a known reference in the frame, applied to colour instead of distance; the two calibrations are independent and a photograph can have one without the other. De-identification — the identifiers that share the frame with the ruler; this is the binding constraint on ever publishing or sharing such a series. Whole Slide Imaging — the microscopic counterpart, where scale arrives as metadata from the scanner instead of having to be reconstructed from the image. Synoptic Reporting — gross measurements are among the fields a synoptic report requires, so a re-checkable measurement has direct reporting value.
Open questions
- Is a photographed-and-rescaled measurement as good as a bench ruler measurement? Nobody here has compared them. Parallax, specimen curvature and the ruler not lying in the specimen’s plane all bias a photographic measurement in ways a physical ruler does not, and the size of that error is unknown.
[unverified]— a small paired study against bench measurements would settle it and would be worth doing before the method is relied on for anything staged. - Whether the archive should keep originals, calibrated copies, or both, has not been decided — and the resampling is irreversible, so the decision is time-sensitive.