darsia.HeterogeneousModel#

class HeterogeneousModel(obj, labels, ignore_labels=None, masks=None)[source]#

Bases: Model

Apply a different Model per region of a labelled image.

Methods

calibrate()

Calibration routine of model.

color_path_labels(shape)

Labels to evaluate in one compiled pass, if the model allows it.

keys()

update_model_parameters(parameters[, dofs])

Update routine of model parameters.

Attributes

masks

Masks for each label in the image (masks, if given, of the same labels).

ignore_labels

Labels to ignore for signals.

obj

Dictionary of models for each label.

color_path_labels(shape)[source]#

Labels to evaluate in one compiled pass, if the model allows it.

This requires an image of colors of the shape of the labels, integer labels and a color path interpolation for each label which is not ignored. The type of the image is the business of the caller (see color_path_kernels.image_scale).

Parameters:
shapetuple

Shape of the image of colors.

Returns:
list or None

The labels which are not ignored; None if the model does not allow it.

ignore_labels#

Labels to ignore for signals.

masks#

Masks for each label in the image (masks, if given, of the same labels).

obj#

Dictionary of models for each label.