def regionprops(label_image, intensity_image=None, cache=True):
 label_image = np.squeeze(label_image)
 if (label_image.ndim not in (2, 3)):
  raise TypeError('Only 2-D and 3-D images supported.')
 if (not np.issubdtype(label_image.dtype, np.integer)):
  raise TypeError('Label image must be of integral type.')
 regions = []
 objects = ndi.find_objects(label_image)
 for (i, sl) in enumerate(objects):
  if (sl is None):
   continue
  label = (i + 1)
  props = _RegionProperties(sl, label, label_image, intensity_image, cache)
  regions.append(props)
 return regions

def regionprops ( label_image , intensity_image = None , cache = True ) : label_image = np . squeeze ( label_image ) if ( label_image . ndim not in ( 2 , 3 ) ) : raise TypeError ( 'Only 2-D and 3-D images supported.' ) if ( not np . issubdtype ( label_image . dtype , np . integer ) ) : raise TypeError ( 'Label image must be of integral type.' ) regions = [ ] objects = ndi . find_objects ( label_image ) for ( i , sl ) in enumerate ( objects ) : if ( sl is None ) : continue label = ( i + 1 ) props = _RegionProperties ( sl , label , label_image , intensity_image , cache ) regions . append ( props ) return regions
measure properties of labeled image regions .