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
XRD
darfix
Commits
48670484
Commit
48670484
authored
Aug 10, 2021
by
Julia Garriga Ferrer
Browse files
[core][dataset][transformation] Add parameter for kind
parent
1b0d6401
Changes
1
Hide whitespace changes
Inline
Side-by-side
darfix/core/dataset.py
View file @
48670484
...
@@ -1298,11 +1298,11 @@ class Dataset():
...
@@ -1298,11 +1298,11 @@ class Dataset():
data
=
Data
(
new_urls
.
reshape
(
self
.
data
.
urls
.
shape
),
self
.
data
.
metadata
,
in_memory
=
True
)
# to modify
data
=
Data
(
new_urls
.
reshape
(
self
.
data
.
urls
.
shape
),
self
.
data
.
metadata
,
in_memory
=
True
)
# to modify
return
Dataset
(
_dir
=
_dir
,
data
=
data
,
dims
=
self
.
__dims
,
transformation
=
self
.
transformation
,
in_memory
=
True
)
return
Dataset
(
_dir
=
_dir
,
data
=
data
,
dims
=
self
.
__dims
,
transformation
=
self
.
transformation
,
in_memory
=
True
)
def
compute_transformation
(
self
,
d
,
rotate
=
False
):
def
compute_transformation
(
self
,
d
,
kind
=
"magnification"
,
rotate
=
False
):
H
,
W
=
self
.
get_data
(
0
).
shape
H
,
W
=
self
.
get_data
(
0
).
shape
if
self
.
dims
.
ndim
==
1
:
if
self
.
dims
.
ndim
==
1
and
kind
==
"rsm"
:
ffz
=
self
.
get_metadata_values
(
POSITIONER_METADATA
,
"ffz"
)[
0
]
ffz
=
self
.
get_metadata_values
(
POSITIONER_METADATA
,
"ffz"
)[
0
]
mainx
=
-
self
.
get_metadata_values
(
POSITIONER_METADATA
,
"mainx"
)[
0
]
mainx
=
-
self
.
get_metadata_values
(
POSITIONER_METADATA
,
"mainx"
)[
0
]
self
.
transformation
=
compute_rsm
(
H
,
W
,
d
,
ffz
,
mainx
)
self
.
transformation
=
compute_rsm
(
H
,
W
,
d
,
ffz
,
mainx
)
...
...
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