Closed akiliyiu closed 1 year ago
The only method that needs to be adapted is:
def compute_fp_tp_probs(
probs: NdarrayOrTensor,
y_coord: NdarrayOrTensor,
x_coord: NdarrayOrTensor,
evaluation_mask: NdarrayOrTensor,
labels_to_exclude: list | None = None,
resolution_level: int = 0,
) -> tuple[NdarrayOrTensor, NdarrayOrTensor, int]:
And it seems impossible to introduce 3D support without breaking the API.
I could submit a PR if we agree on an API. E.g.:
def compute_fp_tp_probs(
probs: NdarrayOrTensor,
coords: NdarrayOrTensor,
evaluation_mask: NdarrayOrTensor,
labels_to_exclude: list | None = None,
resolution_level: int = 0,
) -> tuple[NdarrayOrTensor, NdarrayOrTensor, int]:
"""
Args:
probs: an array with shape (n,) that represents the probabilities of the detections.
Where, n is the number of predicted detections.
coords: an array with shape (n, n_dim) that represents the coordinates of the detections in the same order as in `evaluation_mask`.
evaluation_mask: the ground truth mask for evaluation (need to have same n_dim dimensions).
labels_to_exclude: labels in this list will not be counted for metric calculation.
resolution_level: the level at which the evaluation mask is made.
"""
this one would support arbitrary dimensions
thanks, for backward compatibility, we can create compute_fp_tp_nd
and then reimplement compute_fp_tp_probs
using compute_fp_tp_nd
. also I think resolution_level
should be remain in compute_fp_tp_probs
as that's not a generic ND concept.
Is your feature request related to a problem? Please describe. To be used on 3D data such as MRI, CT images
Additional context Notice that the current froc metrics only support 2d data, wonder if it is possible to extend it to 3d data? Thanks