Six steps turn a DICOM mammogram into a 1024 × 1024 × 3 image. Pick a step to see what it does.
A window (centre, width) decides which DICOM values are visible. The preprocessing uses breast_tissue: the 25th–95th percentiles of pixels > 0, with the width × 1.5. Try other methods or move the window by hand.
DICOM LINEAR VOI function. The band in the histogram is the window: anything to its left becomes black and anything to its right becomes white.
detect_breast_roi builds a mask and extracts its bounding rectangle. A 31 px circle fills the holes in fatty tissue (closing) and removes text and markers (opening). Change the circle size to see why 31 was chosen.
The preprocessing returns a transform dictionary recording each geometric step. With it, transform_boxes maps annotations onto the model image and inverse_transform_boxes maps predictions back to the DICOM, losslessly.