imicpe 1.0.0__py3-none-any.whl → 1.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- imicpe/_version.py +1 -1
- imicpe/cs/l1.py +9 -10
- imicpe/cs/operators.py +25 -16
- imicpe/cs/tikhonov.py +9 -10
- {imicpe-1.0.0.dist-info → imicpe-1.0.2.dist-info}/METADATA +1 -1
- {imicpe-1.0.0.dist-info → imicpe-1.0.2.dist-info}/RECORD +9 -9
- {imicpe-1.0.0.dist-info → imicpe-1.0.2.dist-info}/LICENSE +0 -0
- {imicpe-1.0.0.dist-info → imicpe-1.0.2.dist-info}/WHEEL +0 -0
- {imicpe-1.0.0.dist-info → imicpe-1.0.2.dist-info}/top_level.txt +0 -0
imicpe/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__="1.0.
|
|
1
|
+
__version__="1.0.2"
|
imicpe/cs/l1.py
CHANGED
|
@@ -32,16 +32,15 @@ def l1(opreg,A,At,z,x0,lam):
|
|
|
32
32
|
|
|
33
33
|
### init ###
|
|
34
34
|
dim = x0.ndim
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
Gt = Lt
|
|
35
|
+
if opreg == 'id':
|
|
36
|
+
G = Id
|
|
37
|
+
Gt = Id
|
|
38
|
+
elif opreg == 'gradient':
|
|
39
|
+
G = D
|
|
40
|
+
Gt = Dt
|
|
41
|
+
if opreg == 'laplacien':
|
|
42
|
+
G = L
|
|
43
|
+
Gt = Lt
|
|
45
44
|
|
|
46
45
|
# operator norms
|
|
47
46
|
lipA = opNorm(A,At,dim,x0)
|
imicpe/cs/operators.py
CHANGED
|
@@ -9,7 +9,7 @@ import pywt
|
|
|
9
9
|
############################################################
|
|
10
10
|
def Id(x):
|
|
11
11
|
"""
|
|
12
|
-
|
|
12
|
+
Opérateur identité
|
|
13
13
|
|
|
14
14
|
Args:
|
|
15
15
|
X (numpy.ndarray) signal 1D
|
|
@@ -28,7 +28,7 @@ def Id(x):
|
|
|
28
28
|
# gradient
|
|
29
29
|
def D(x):
|
|
30
30
|
"""
|
|
31
|
-
|
|
31
|
+
Calcule le gradient par différences finies à droite.
|
|
32
32
|
Autrement dit, D(x) calcule le produit matriciel Dx.
|
|
33
33
|
|
|
34
34
|
Args:
|
|
@@ -52,7 +52,7 @@ def D(x):
|
|
|
52
52
|
|
|
53
53
|
def Dt(x):
|
|
54
54
|
"""
|
|
55
|
-
|
|
55
|
+
Calcule l’adjoint gradient par différences finies à droite.
|
|
56
56
|
Autrement dit, Dt(x) calcule le produit matriciel D'x.
|
|
57
57
|
|
|
58
58
|
Args:
|
|
@@ -76,7 +76,7 @@ def Dt(x):
|
|
|
76
76
|
# laplacian
|
|
77
77
|
def L(x):
|
|
78
78
|
"""
|
|
79
|
-
|
|
79
|
+
Calcule la dérivée seconde d’un signal, ou le laplacien dans le cas d’une image.
|
|
80
80
|
Autrement dit, L(x) calcule le produit matriciel Lx.
|
|
81
81
|
|
|
82
82
|
Args:
|
|
@@ -99,7 +99,7 @@ def L(x):
|
|
|
99
99
|
|
|
100
100
|
def Lt(x):
|
|
101
101
|
"""
|
|
102
|
-
|
|
102
|
+
Calcule l’adjoint du laplacien.
|
|
103
103
|
Autrement dit, Lt(x) calcule le produit matriciel L'x.
|
|
104
104
|
|
|
105
105
|
Args:
|
|
@@ -126,7 +126,7 @@ def Lt(x):
|
|
|
126
126
|
############################################################
|
|
127
127
|
def fwt(x,wavelet,level):
|
|
128
128
|
"""
|
|
129
|
-
|
|
129
|
+
Calcule la transformée en ondelettes directe 1D.
|
|
130
130
|
|
|
131
131
|
Args:
|
|
132
132
|
x (numpy.ndarray) signal 1D
|
|
@@ -143,12 +143,14 @@ def fwt(x,wavelet,level):
|
|
|
143
143
|
return coeff_arr
|
|
144
144
|
|
|
145
145
|
|
|
146
|
-
def iwt(x,wavelet,level
|
|
146
|
+
def iwt(x,wavelet,level):
|
|
147
147
|
"""
|
|
148
|
-
|
|
148
|
+
Calcule la transformée en ondelettes inverse 1D.
|
|
149
149
|
|
|
150
150
|
Args:
|
|
151
|
-
x (numpy.ndarray) Vecteur des coefficients d'ondelettes
|
|
151
|
+
x (numpy.ndarray) Vecteur des coefficients d'ondelettes
|
|
152
|
+
wavelet (string) Nom de l'ondelette mère (voir la librairie pywt)
|
|
153
|
+
level (int) Niveau de décompisition
|
|
152
154
|
|
|
153
155
|
Returns:
|
|
154
156
|
(numpy.ndarray) Signal correspondant aux coefficients d'ondelettes donnés par x
|
|
@@ -156,6 +158,7 @@ def iwt(x,wavelet,level,coeffs_slices=None,coeffs_shapes=None,):
|
|
|
156
158
|
|
|
157
159
|
J = level
|
|
158
160
|
N = len(x)
|
|
161
|
+
_, coeffs_slices, coeffs_shapes = pywt.ravel_coeffs(pywt.wavedec(np.ones(N), wavelet=wavelet, level=J, mode='periodization'))
|
|
159
162
|
|
|
160
163
|
if coeffs_shapes is None:
|
|
161
164
|
# compute coeffs size at each level
|
|
@@ -178,10 +181,12 @@ def iwt(x,wavelet,level,coeffs_slices=None,coeffs_shapes=None,):
|
|
|
178
181
|
|
|
179
182
|
def fwt2(x,wavelet,level):
|
|
180
183
|
"""
|
|
181
|
-
|
|
184
|
+
Calcule la transformée en ondelettes directe 2D.
|
|
182
185
|
|
|
183
186
|
Args:
|
|
184
|
-
x (numpy.ndarray) image NON vectorisée 2D
|
|
187
|
+
x (numpy.ndarray) image NON vectorisée 2D
|
|
188
|
+
wavelet (string) Nom de l'ondelette mère (voir la librairie pywt)
|
|
189
|
+
level (int) Niveau de décompisition
|
|
185
190
|
|
|
186
191
|
Returns:
|
|
187
192
|
(numpy.ndarray) Vecteur des coefficients de la décomposition en ondelettes de x
|
|
@@ -192,12 +197,14 @@ def fwt2(x,wavelet,level):
|
|
|
192
197
|
|
|
193
198
|
return coeff_arr
|
|
194
199
|
|
|
195
|
-
def iwt2(x,wavelet,level
|
|
200
|
+
def iwt2(x,wavelet,level):
|
|
196
201
|
"""
|
|
197
|
-
|
|
202
|
+
Calcule la transformée en ondelettes inverse 2D.
|
|
198
203
|
|
|
199
204
|
Args:
|
|
200
|
-
x (numpy.ndarray) Vecteur des coefficients d'ondelettes
|
|
205
|
+
x (numpy.ndarray) Vecteur des coefficients d'ondelettes
|
|
206
|
+
wavelet (string) Nom de l'ondelette mère (voir la librairie pywt)
|
|
207
|
+
level (int) Niveau de décompisition
|
|
201
208
|
|
|
202
209
|
Returns:
|
|
203
210
|
(numpy.ndarray) Image correspondante aux coefficients d'ondelettes donnés par x
|
|
@@ -205,6 +212,8 @@ def iwt2(x,wavelet,level,coeffs_slices,coeffs_shapes):
|
|
|
205
212
|
|
|
206
213
|
J = level
|
|
207
214
|
N = len(x)
|
|
215
|
+
|
|
216
|
+
_, coeffs_slices, coeffs_shapes = pywt.ravel_coeffs(pywt.wavedec2(np.ones((int(np.sqrt(N)),int(np.sqrt(N)))), wavelet=wavelet, level=J, mode='periodization'))
|
|
208
217
|
|
|
209
218
|
coeffs = pywt.unravel_coeffs(x, coeffs_slices, coeffs_shapes,
|
|
210
219
|
output_format='wavedec2')
|
|
@@ -220,7 +229,7 @@ def iwt2(x,wavelet,level,coeffs_slices,coeffs_shapes):
|
|
|
220
229
|
############################################################
|
|
221
230
|
def opNorm(op,opt,dim,xn):
|
|
222
231
|
"""
|
|
223
|
-
|
|
232
|
+
Calcule la norme de l'opérateur OP, dont
|
|
224
233
|
l'opérateur transposé est OPT, en dimension DIM
|
|
225
234
|
|
|
226
235
|
Args:
|
|
@@ -264,7 +273,7 @@ def opNorm(op,opt,dim,xn):
|
|
|
264
273
|
|
|
265
274
|
def matNorm(M):
|
|
266
275
|
"""
|
|
267
|
-
|
|
276
|
+
Calcule la norme de la matrice M
|
|
268
277
|
|
|
269
278
|
Args:
|
|
270
279
|
M (numpy.ndarray) matrice dont on souhaite calculer la norme
|
imicpe/cs/tikhonov.py
CHANGED
|
@@ -29,16 +29,15 @@ def tikhonov(opreg,A,At,z,x0,lam):
|
|
|
29
29
|
|
|
30
30
|
### init ###
|
|
31
31
|
dim = x0.ndim
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
Gt = Lt
|
|
32
|
+
if opreg == 'id':
|
|
33
|
+
G = Id
|
|
34
|
+
Gt = Id
|
|
35
|
+
elif opreg == 'gradient':
|
|
36
|
+
G = D
|
|
37
|
+
Gt = Dt
|
|
38
|
+
if opreg == 'laplacien':
|
|
39
|
+
G = L
|
|
40
|
+
Gt = Lt
|
|
42
41
|
|
|
43
42
|
# operator norms
|
|
44
43
|
lipA = opNorm(A,At,dim,x0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: imicpe
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.2
|
|
4
4
|
Summary: Toolbox for Maths,Signal,Image Teaching @ CPE
|
|
5
5
|
Author-email: Marion Foare <marion.foare@cpe.fr>, Eric Van Reeth <eric.vanreeth@cpe.fr>, Arthur Gautheron <arthur.gautheron@cpe.fr>
|
|
6
6
|
License: MIT License
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
imicpe/__init__.py,sha256=WjDmvecyDIyJLYp4rCV9vsSYbQDc4L1EpYqORvEXliI,33
|
|
2
|
-
imicpe/_version.py,sha256=
|
|
2
|
+
imicpe/_version.py,sha256=Zy3VGxZ5T9ift8CxpyHfKfgeKxTkOc3xUXz-mAr9Yq8,20
|
|
3
3
|
imicpe/cs/__init__.py,sha256=fLe1o5jNvrB4qEVBE6amEV9i3NFwM3E_uGiiiHXrph0,339
|
|
4
|
-
imicpe/cs/l1.py,sha256=
|
|
4
|
+
imicpe/cs/l1.py,sha256=5bTNM8JG8J8srTamh-gl3ShhFoJjqCvVwlteN_M6Uak,3236
|
|
5
5
|
imicpe/cs/masks.py,sha256=5ehQ-QnYY4trBt7BIx0Pp8DUa3x5KApkc7TPp9LA9Pc,2030
|
|
6
6
|
imicpe/cs/metrics.py,sha256=DuUYpW7s1LkZTDV32D5K4wdSRXpH1Ymunjp2vq6kzfA,148
|
|
7
|
-
imicpe/cs/operators.py,sha256=
|
|
7
|
+
imicpe/cs/operators.py,sha256=pTA8gu_17yoBD4Hs7Cvg0PWUX4xrcMr6DJxyNYX9yBA,9028
|
|
8
8
|
imicpe/cs/shepp_logan_phantom.py,sha256=_RDHimZI6R8uyAwXNyB3BldYjCiNDRorDmPYoJR0T6Q,485
|
|
9
|
-
imicpe/cs/tikhonov.py,sha256=
|
|
9
|
+
imicpe/cs/tikhonov.py,sha256=NokBVdMsErWrf4pHZ3jWFwyRVaP7Z9z4qqujuisjyF4,2488
|
|
10
10
|
imicpe/optim/__init__.py,sha256=rkguPFq7gdmBgm_Xrry2yr1oquEIxE00On2emjRMgZE,344
|
|
11
11
|
imicpe/optim/metrics.py,sha256=AHqudKDch1_jc7X2_9hz30RamEqfQ132GXr3qW81VPY,187
|
|
12
12
|
imicpe/optim/operators.py,sha256=BbyqE9ARZF-q8EkxyDOv1V8Rlz52t9sbo2gI22zQAzA,10648
|
|
13
13
|
imicpe/optim/pnnDataset.py,sha256=PFh5u0SXx761O6N6vVfWfEDmzmCm87eYzAL7mWHBRrw,3971
|
|
14
14
|
imicpe/optim/pnnTrainer.py,sha256=3ygh9XwFJN7jMPsEG3LHLa8sgBbDd9Yu_QWg4ZtM_DM,4571
|
|
15
15
|
imicpe/optim/pnnUtils.py,sha256=LXU7wRfuEi6t-2VG2NStPAOzu19OKTxzNNnbHESpC2U,1523
|
|
16
|
-
imicpe-1.0.
|
|
17
|
-
imicpe-1.0.
|
|
18
|
-
imicpe-1.0.
|
|
19
|
-
imicpe-1.0.
|
|
20
|
-
imicpe-1.0.
|
|
16
|
+
imicpe-1.0.2.dist-info/LICENSE,sha256=ACwmltkrXIz5VsEQcrqljq-fat6ZXAMepjXGoe40KtE,1069
|
|
17
|
+
imicpe-1.0.2.dist-info/METADATA,sha256=sAYb5GOUk9hdw7Iffmc1tZjLfUbnZ_uIWbRTIUc_nLA,1317
|
|
18
|
+
imicpe-1.0.2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
19
|
+
imicpe-1.0.2.dist-info/top_level.txt,sha256=6_gSXCYolzjXHaIDeAsZ_M3nLXdqrMKt48XCz3reJc0,7
|
|
20
|
+
imicpe-1.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|