blimp.processing.quantify.quantify

blimp.processing.quantify.quantify(intensity_image, label_image, measure_objects=None, parent_object=None, aggregate=False, timepoint=None, intensity_channels=None, texture_channels=None, texture_objects=None, texture_scales=[1, 3], point_objects=None)[source]

Quantify features for objects in an image.

Parameters:
  • intensity_image (AICSImage) – The intensity image containing the data.

  • label_image (AICSImage) – The labeled image where objects are represented by unique integer labels.

  • measure_objects (Union[int, str, List[Union[int, str]], None]) – The objects to be measured, by default all channels.

  • parent_object (Union[int, str, None]) – The parent object to which the measured objects are associated, by default None.

  • aggregate (bool) – Whether to aggregate the features, by default False.

  • timepoint (Optional[int]) – The timepoint at which to measure the objects, by default None.

  • intensity_channels (Union[int, str, List[Union[int, str]], None]) – The channels to be used for intensity measurements, by default None.

  • texture_channels (Union[int, str, List[Union[int, str]], None]) – The channels to be used for texture calculations, by default None.

  • texture_objects (Union[int, str, List[Union[int, str]], None]) – The objects to be used for texture calculations, by default None.

  • texture_scales (list) – The scales to be used for texture calculations, by default [1, 3].

  • point_objects (Union[int, str, List[Union[int, str]], None]) – Objects that should be treated as point objects (each pixel/voxel as a separate object). Provide as indices or names. Supported for both 2D and 3D quantification. When aggregating to a parent, uses optimized vectorized computation.

Returns:

A DataFrame or a list of DataFrames containing the quantified features.

Return type:

Union[pd.DataFrame, List[pd.DataFrame]]

Notes

  • If aggregate is True, the function will attempt to aggregate features across multiple objects. In this case, the parent_object must be specified to provide context for the aggregation. If parent_object is not specified, a ValueError will be raised.

  • If aggregate is False, the function will quantify features for individual objects without aggregation and return a list if there are multiple objects in measure_objects. In this case, specifying a parent_object is optional and will be ignored if provided.

  • If measure_objects contains fewer than two objects, aggregation cannot proceed, and a warning will be logged. The aggregate flag will be set to False.