From 228bf8f7ba633dc39bf76e864206502098d3d3c1 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Fri, 19 Jul 2013 00:32:38 +0200 Subject: [PATCH] Adapted if statement to grid_shape=None --- skimage/util/montage.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/skimage/util/montage.py b/skimage/util/montage.py index cd87a078..bdafe6ed 100644 --- a/skimage/util/montage.py +++ b/skimage/util/montage.py @@ -87,10 +87,10 @@ def montage2d(arr_in, fill='mean', rescale_intensity=False, grid_shape=None): arr_in[i] = exposure.rescale_intensity(arr_in[i]) # -- determine alpha - if grid_shape == (0, 0): - alpha_y = alpha_x = int(np.ceil(np.sqrt(n_images))) - else: + if grid_shape: alpha_y, alpha_x = grid_shape + else: + alpha_y = alpha_x = int(np.ceil(np.sqrt(n_images))) # -- fill missing patches if fill == 'mean':