ants.label.label_image_centroids
- label_image_centroids(image, physical=False, convex=True, verbose=False)[source]
Converts a label image to coordinates summarizing their positions
ANTsR function: labelImageCentroids
- Parameters:
- Returns:
- labels1D-ndarray
array of label values
- verticespd.DataFrame
coordinates of label centroids
- Return type:
dictionary w/ following key-value pairs
Example
>>> import ants >>> import numpy as np >>> image = ants.from_numpy(np.asarray([[[0,2],[1,3]],[[4,6],[5,7]]]).astype('float32')) >>> labels = ants.label_image_centroids(image)