trait ComputesAnnotationStatistics

Methods

array
getAnnotationStatistics(string $type, callable $restrict)

Compute the annotation statistics of image or video volumes.

Details

at line 22
protected array getAnnotationStatistics(string $type, callable $restrict)

Compute the annotation statistics of image or video volumes.

The statistics are derived from the same join of annotations, annotation labels and files. The join is computed only once (as materialized CTE) and all statistics are fetched with a single query.

Parameters

string $type

'image' or 'video'

callable $restrict

Receives the base query and restricts it to the volumes of the statistics (e.g. with a where on "{$type}s.volume_id").

Return Value

array