def _get_high_intensity_peaks(image, mask, num_peaks):
 coord = np.nonzero(mask)
 intensities = image[coord]
 sorted_indices = np.argsort(intensities)[::(-1)]
 if (len(coord[0]) > num_peaks):
  sorted_indices = sorted_indices[:num_peaks]
 return np.transpose(coord)[sorted_indices]

def _get_high_intensity_peaks ( image , mask , num_peaks ) : coord = np . nonzero ( mask ) intensities = image [ coord ] sorted_indices = np . argsort ( intensities ) [ : : ( - 1 ) ] if ( len ( coord [ 0 ] ) > num_peaks ) : sorted_indices = sorted_indices [ : num_peaks ] return np . transpose ( coord ) [ sorted_indices ]
return the highest intensity peak coordinates .