Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
payno
id06workflow
Commits
07b80b3b
Commit
07b80b3b
authored
Oct 18, 2018
by
payno
Browse files
[noisereduction] fix getBackground
parent
e386d0ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
id06workflow/core/Dataset/__init__.py
View file @
07b80b3b
...
...
@@ -146,5 +146,9 @@ class Dataset(object):
# TODO: add information if the number of frame is fixed...
if
len
(
files_list
)
is
0
:
return
None
series
=
FileSeries
(
files_list
)
return
self
.
_loadSeries
(
series
)
res
=
[]
series
=
FileSeries
(
filenames
=
files_list
,
single_frame
=
True
)
for
iframe
in
range
(
series
.
nframes
):
res
.
append
(
series
.
getframe
(
iframe
).
data
)
return
numpy
.
asarray
(
res
)
id06workflow/core/experiment/__init__.py
View file @
07b80b3b
...
...
@@ -209,18 +209,22 @@ class Experiment(object):
steps
=
(
1
,
1
,
1
)
else
:
if
len
(
reductionStep
)
is
1
:
steps
=
reductionStep
[
0
]
steps
=
reductionStep
[
0
]
.
steps
else
:
raise
NotImplementedError
(
'cannot manage several reduction steps for the moment'
)
# first apply data reduction because roi is applied after data
# reduction
background_img
=
numpy
.
median
(
background
,
axis
=
0
)
background_img
=
background_img
[::
steps
[
1
],
::
steps
[
0
]]
if
self
.
roi
is
None
:
return
background_img
[::
steps
[
1
],
::
steps
[
2
]]
return
background_img
else
:
origin
,
size
=
self
.
roi
ymin
,
ymax
=
int
(
origin
[
1
]),
int
(
origin
[
1
]
+
size
[
1
])
xmin
,
xmax
=
int
(
origin
[
0
]),
int
(
origin
[
0
]
+
size
[
0
])
return
background_img
[
ymin
:
ymax
:
steps
[
1
]
,
xmin
:
xmax
:
steps
[
2
]
]
return
background_img
[
ymin
:
ymax
,
xmin
:
xmax
]
def
addOperation
(
self
,
operation
):
"""Add the operation to the stack of operations"""
...
...
@@ -250,7 +254,9 @@ class Experiment(object):
def
_getDataReductionOperations
(
self
):
"""
:return: the list of roi operation
:return: the list of roi operation.
..note: reduction steps are defined as tuple(x, y, z)
"""
return
self
.
_data_reduction_operations
...
...
Write
Preview
Supports
Markdown
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