image_groupby

gammapy.image.image_groupby(images, labels)[source]

Group pixel by labels.

This function is similar to scipy.ndimage.measurements.labeled_comprehension, but more general because it supports multiple input and output images.

Parameters:

images : list of ndarray

List of image objects.

labels : ndarray

Labels for pixel grouping.

Returns:

groups : list of ndarray

Grouped pixels acording to the labels.