Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
pipelet
Pipelet
Commits
f80d8dfe
Commit
f80d8dfe
authored
Oct 06, 2010
by
Maude Le Jeune
Browse files
first seg of demo pipe
parent
547a9264
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
2 deletions
+40
-2
test/main.py
test/main.py
+2
-2
test/seg_mkgauss_code.py
test/seg_mkgauss_code.py
+38
-0
No files found.
test/main.py
View file @
f80d8dfe
...
...
@@ -6,8 +6,8 @@ import os.path as op
import
logging
import
sys
S
=
"""
first->second->fourth
third->fourth
getimg->fftimg->filter->ifftimg;
mkgauss->filter;
"""
#T.connect('second', ['third', 'fourth'], 'fourth')
#T.compute_hash()
...
...
test/seg_mkgauss_code.py
0 → 100644
View file @
f80d8dfe
""" Make a Gaussian Fourier filter
The Gaussian shape is set by the fwhm parameter (full width half height).
The amplitude is set to unity by default.
"""
lst_par
=
[
"fwhm"
,
"nx"
,
"ny"
,
"a"
]
lst_tag
=
[
"fwhm"
]
## Image dimension
nx
=
256
ny
=
256
## Gaussian full width half height
fwhm
=
50
## make a gaussian pattern
im
=
zeros
((
nx
,
ny
))
center_x
=
nx
/
2
center_y
=
ny
/
2
a
=
1
fact
=
-
log
(
2
)
/
(
0.25
*
fwhm
*
fwhm
)
for
i
in
range
(
nx
):
for
j
in
range
(
ny
):
dist
=
((
i
-
center_x
)
**
2
)
+
((
j
-
center_y
)
**
2
)
im
[
i
,
j
]
=
a
*
exp
(
dist
*
fact
)
## plot it
imshow
(
im
)
savefig
(
get_data_fn
(
"gaussian_pattern.png"
))
## compute its fft
im_fft
=
fft2
(
im
)
## save it to disk
save_products
(
get_data_fn
(
"fft.dat"
),
globals
(),
[
"im_fft"
])
seg_output
=
[
fwhm
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment