Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
id06workflow
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
payno
id06workflow
Commits
da534c93
Commit
da534c93
authored
Nov 28, 2018
by
payno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[operation/gradient removal] deduce delta from the unique values
parent
7793e7cd
Pipeline
#6660
passed with stage
in 2 minutes and 30 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
id06workflow/core/operation/mapping.py
id06workflow/core/operation/mapping.py
+9
-11
No files found.
id06workflow/core/operation/mapping.py
View file @
da534c93
...
...
@@ -171,9 +171,6 @@ class GradientRemoval(_MappingBase):
raise
ValueError
(
'Not available for Gradient removal yet'
)
def
compute
(
self
):
# TODO: why delta = 0.567
delta
=
0.567
# TODO: for now we ask experiment for the intensity mapping if computed
mapping
=
self
.
_experiment
.
getOperation
(
IntensityMapping
.
KEY
)
if
mapping
is
None
:
...
...
@@ -182,21 +179,22 @@ class GradientRemoval(_MappingBase):
return
self
.
__dim
=
self
.
apply_gradient_correction
(
self
.
data_flatten
,
delta
=
delta
,
mapping
=
mapping
)
self
.
__intensity_map
=
mapping
.
intensity_map
self
.
registerOperation
()
@
staticmethod
def
apply_gradient_correction
(
data
,
delta
,
mapping
):
def
apply_gradient_correction
(
self
,
data
,
mapping
):
assert
isinstance
(
mapping
,
IntensityMapping
)
# TODO: number of element: for now only square matrices but if evolve ?
for
axis
,
dim
in
mapping
.
dims
.
items
():
unique_values
=
numpy
.
array
(
self
.
_experiment
.
dims
.
get
(
axis
).
unique_values
)
_delta
=
unique_values
.
max
()
-
unique_values
.
min
()
_logger
.
info
(
'delta for axis %s: %s'
%
(
axis
,
_delta
))
corr2
,
corr1
=
numpy
.
meshgrid
(
numpy
.
linspace
(
-
delta
,
delta
,
data
.
shape
[
2
]),
numpy
.
linspace
(
-
_delta
,
_
delta
,
data
.
shape
[
2
]),
numpy
.
linspace
(
0
,
0
,
data
.
shape
[
1
]))
_gradients
=
{}
for
axis
,
dim
in
mapping
.
dims
.
items
():
_mean
=
dim
.
mean
+
corr2
_variance
=
dim
.
variance
+
corr2
_skewness
=
dim
.
skewness
+
corr2
...
...
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