The most powerful tools of image algebra in terms of image processing are image-template operations. An image-template operation can be classified as a local operation or a nonlocal operation. For local image-template operations, we have an efficient parallel implementation. However, there seems to be no efficient way to map general nonlocal image-template operations onto parallel architectures, since the communication patterns involved with nonlocal operations are very complex in general. A practical way is to classify nonlocal image-template operations into several commonly used classes and develop efficient implementation for each class. In this paper, we define a special class of image-template operations with nonlocal templates and develop a general efficient algorithm for this class of image-template operations. We then demonstrate how to use this class of image-template operations to compute geometric properties of image components such as area, perimeter, compactness, height, width, diameter, moments, and centroid.