Skip to content

Commit bdcdb7e

Browse files
committed
Skip convolution when sigma = 0
1 parent 43ef5a3 commit bdcdb7e

File tree

6 files changed

+13
-2
lines changed

6 files changed

+13
-2
lines changed

IMED.egg-info/PKG-INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: IMED
3-
Version: 0.0.1.6a0
3+
Version: 0.0.1.6b0
44
Summary: Image Euclidean Distance and Standardizing Transforms
55
Home-page: https://github.com/jfelding/IMED
66
Author: Jacob Felding

build/lib/IMED/standardizingTrans_ndim.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ def ST_ndim_DCT(imgs,sigma,eps=0.,inverse=False):
2626

2727
# do convolution, axis by axis
2828
for d in range(dims):
29+
if sigma[d]==0:
30+
#convolution has no effect
31+
continue
32+
2933
if shape[d]<2:
3034
#cant do convolution along this axis
3135
continue
@@ -73,6 +77,9 @@ def ST_ndim_DCT_by_FFT(imgs, sigma, eps=0.,inverse=False):
7377
sigma = np.ones(dims)*sigma
7478

7579
for d in range(dims):
80+
if sigma[d]==0:
81+
#convolution has no effect
82+
continue
7683
if orig_shape[d]<3:
7784
print(f'Skipping dimension d={d} with size {orig_shape[d]}')
7885
#cant do convolution along this axis
@@ -138,6 +145,10 @@ def ST_ndim_FFT(imgs, sigma, eps=0.,inverse=False):
138145
sigma = np.ones(dims)*sigma
139146

140147
for d in range(dims):
148+
if sigma[d]==0:
149+
#convolution has no effect
150+
continue
151+
141152
if orig_shape[d]<2:
142153
#cant do convolution along this axis
143154
continue

dist/IMED-0.0.1.6a0.tar.gz

-9.4 KB
Binary file not shown.

dist/IMED-0.0.1.6b0.tar.gz

9.42 KB
Binary file not shown.

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[metadata]
22
# replace with your username:
33
name = IMED
4-
version = 0.0.1.6-a
4+
version = 0.0.1.6-b
55
author = Jacob Felding
66
author_email = [email protected]
77
description = Image Euclidean Distance and Standardizing Transforms

0 commit comments

Comments
 (0)