def compute(self) -> PIMOResult:
        """Compute PIMO curves from accumulated data.

        Returns:
            PIMOResult: Container with curve data and metadata.

        Raises:
            RuntimeError: If no data has been added via update()
        """
        if self._is_empty:
            msg = "No anomaly maps and masks have been added yet. Please call `update()` first."
            raise RuntimeError(msg)
        anomaly_maps = torch.concat(self.anomaly_maps, dim=0)
        masks = torch.concat(self.masks, dim=0)

        thresholds, shared_fpr, per_image_tprs, _ = functional.pimo_curves(
            anomaly_maps,
            masks,
            self.num_thresholds,
        )
        return PIMOResult(
            thresholds=thresholds,
            shared_fpr=shared_fpr,
            per_image_tprs=per_image_tprs,
        )
Compute PIMO curves from accumulated data.

        Returns:
            PIMOResult: Container with curve data and metadata.

        Raises:
            RuntimeError: If no data has been added via update()
        
src/anomalib/metrics/pimo/pimo.py