From 028fe11515b72d9b81191af508a70e28afa6d87a Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sat, 20 Sep 2014 17:13:57 -0500 Subject: [PATCH] Use assert_nD in template.py --- skimage/feature/template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skimage/feature/template.py b/skimage/feature/template.py index fbf95866..d06e82df 100644 --- a/skimage/feature/template.py +++ b/skimage/feature/template.py @@ -2,6 +2,7 @@ import numpy as np from scipy.signal import fftconvolve from skimage.util import pad +from skimage._shared.utils impor assert_nD def _window_sum_2d(image, window_shape): @@ -102,9 +103,8 @@ def match_template(image, template, pad_input=False, mode='constant', [ 0. , 0. , 0. , 0.125, -1. , 0.125], [ 0. , 0. , 0. , 0.125, 0.125, 0.125]], dtype=float32) """ + assert_nD(ndim=(2, 3)) - if image.ndim not in (2, 3) or template.ndim not in (2, 3): - raise ValueError("Only 2- and 3-D images supported.") if image.ndim < template.ndim: raise ValueError("Dimensionality of template must be less than or " "equal to the dimensionality of image.")