Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
empyre
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dieter Weber
empyre
Commits
9df761b4
Commit
9df761b4
authored
7 years ago
by
Jan Caron
Browse files
Options
Downloads
Patches
Plain Diff
fielddata: added order=1 as default to get rid of ripples for rotate().
environment.yml: upgraded to scipy=1.0
parent
62f23a80
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
environment.yml
+1
-1
1 addition, 1 deletion
environment.yml
pyramid/fielddata.py
+4
-3
4 additions, 3 deletions
pyramid/fielddata.py
with
5 additions
and
4 deletions
environment.yml
+
1
−
1
View file @
9df761b4
...
...
@@ -16,7 +16,7 @@ dependencies:
# Basic:
-
python=3.5
# TODO: upgrade to 3.6!
-
numpy=1.11
-
scipy=1.0
# TODO: upgrade to 1.0 (if channels exist...)!
-
scipy=1.0
-
tqdm=4.14
-
scikit-image=0.13
# Fast computation:
...
...
This diff is collapsed.
Click to expand it.
pyramid/fielddata.py
+
4
−
3
View file @
9df761b4
...
...
@@ -669,12 +669,13 @@ class VectorData(FieldData):
raise
ValueError
(
"
Wrong input!
'
x
'
,
'
y
'
,
'
z
'
allowed!
"
)
return
VectorData
(
self
.
a
,
field_flip
)
def
rotate
(
self
,
angle
,
axis
=
'
z
'
,
reshape
=
False
,
**
kwargs
):
def
rotate
(
self
,
angle
,
axis
=
'
z
'
,
reshape
=
False
,
order
=
1
,
**
kwargs
):
# TODO: Docstring!
# Define axes of rotation plane (axis 0 for vector component!) and rotate coord. system:
axes
=
{
'
x
'
:
(
1
,
2
),
'
y
'
:
(
1
,
3
),
'
z
'
:
(
2
,
3
)}[
axis
]
field_coord_rot
=
rotate
(
self
.
field
,
angle
,
axes
=
axes
,
reshape
=
reshape
,
**
kwargs
)
# Rotate vectors inside the voxels (- signs determined by scipy rotate axes in firt step):
field_coord_rot
=
rotate
(
self
.
field
,
angle
,
axes
=
axes
,
reshape
=
reshape
,
order
=
order
,
**
kwargs
)
# Rotate vectors inside the voxels (- signs determined by scipy rotate axes in first step):
vec_dict
=
{
'
x
'
:
(
-
1
,
0
,
0
),
'
y
'
:
(
0
,
1
,
0
),
'
z
'
:
(
0
,
0
,
-
1
)}
quat
=
Quaternion
.
from_axisangle
(
vec_dict
[
axis
],
np
.
deg2rad
(
angle
))
field_rot
=
quat
.
matrix
.
dot
(
field_coord_rot
.
reshape
(
3
,
-
1
)).
reshape
(
field_coord_rot
.
shape
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment