ants.label.image_to_cluster_images

image_to_cluster_images(image, min_cluster_size=50, min_thresh=1e-06, max_thresh=1)[source]

Converts an image to several independent images.

Produces a unique image for each connected component 1 through N of size > min_cluster_size

ANTsR function: image2ClusterImages

Parameters:
  • image (ants.core.ANTsImage) – input image

  • min_cluster_size (int) – throw away clusters smaller than this value

  • min_thresh (scalar) – threshold to a statistical map

  • max_thresh (scalar) – threshold to a statistical map

Return type:

list of ANTsImage types

Example

>>> import ants
>>> image = ants.image_read(ants.get_ants_data('r16'))
>>> image = ants.threshold_image(image, 1, 1e15)
>>> image_cluster_list = ants.image_to_cluster_images(image)