def _transform(persistence_diagram):
    """Transform persistence diagram for persistence image calculation."""
    persistence_diagram[:, 1] -= persistence_diagram[:, 0]
    return persistence_diagram