sunkit_image.granule.segment(smap, *, skimage_method='li', mark_dim_centers=False, bp_min_flux=None)[source]#

Segment an optical image of the solar photosphere into tri-value maps with:

  • 0 as intergranule

  • 1 as granule

  • 2 as brightpoint

If mark_dim_centers is set to True, an additional label, 3, will be assigned to dim granule centers.

  • smap (GenericMap) – GenericMap containing data to segment. Must have square pixels.

  • skimage_method ({ "li", "otsu", "isodata", "mean", "minimum", "yen", "triangle" }, optional) – scikit-image thresholding method, defaults to “li”. Depending on input data, one or more of these methods may be significantly better or worse than the others. Typically, ‘li’, ‘otsu’, ‘mean’, and ‘isodata’ are good choices, ‘yen’ and ‘triangle’ over- identify intergranule material, and ‘minimum’ over identifies granules.

  • mark_dim_centers (bool, optional) – Whether to mark dim granule centers as a separate category for future exploration.

  • bp_min_flux (float, optional) – Minimum flux per pixel for a region to be considered a brightpoint. Default is None which will use data mean + 0.5 * sigma.


segmented_map (GenericMap) – GenericMap containing a segmented image (with the original header).