def get_new_idx(self) -> int:
        """Get index of the next sample based on maximum minimum distance.

        Returns:
            int: Index of the selected sample.

        Raises:
            TypeError: If `self.min_distances` is not a torch.Tensor.
        """
        if isinstance(self.min_distances, torch.Tensor):
            idx = int(torch.argmax(self.min_distances).item())
        else:
            msg = f"self.min_distances must be of type Tensor. Got {type(self.min_distances)}"
            raise TypeError(msg)

        return idx
Get index of the next sample based on maximum minimum distance.

        Returns:
            int: Index of the selected sample.

        Raises:
            TypeError: If `self.min_distances` is not a torch.Tensor.
        
src/anomalib/models/components/sampling/k_center_greedy.py