Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scikit-surgerycore
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WEISS
Software Repositories
SNAPPY
scikit-surgerycore
Commits
c3390b06
Commit
c3390b06
authored
Feb 28, 2019
by
Mian Asbat Ahmad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#14
: Test case added, imports corrected
Test case added to check function with empty data.
parent
ab5215db
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
sksurgerycore/algorithms/errors.py
sksurgerycore/algorithms/errors.py
+2
-2
sksurgerycore/algorithms/procrustes.py
sksurgerycore/algorithms/procrustes.py
+2
-2
tests/algorithms/test_errors.py
tests/algorithms/test_errors.py
+7
-1
No files found.
sksurgerycore/algorithms/errors.py
View file @
c3390b06
...
...
@@ -3,7 +3,7 @@
"""Functions for point based registration using Orthogonal Procrustes."""
import
numpy
as
np
from
sksurgerycore.algorithms.procrustes
import
validate_procrustes_inputs
import
sksurgerycore.algorithms.procrustes
as
p
def
compute_fre
(
fixed
,
moving
,
rotation
,
translation
):
...
...
@@ -19,7 +19,7 @@ def compute_fre(fixed, moving, rotation, translation):
"""
# pylint: disable=assignment-from-no-return
validate_procrustes_inputs
(
fixed
,
moving
)
p
.
validate_procrustes_inputs
(
fixed
,
moving
)
transformed_moving
=
np
.
matmul
(
rotation
,
moving
.
transpose
())
+
translation
squared_error_elementwise
=
np
.
square
(
fixed
...
...
sksurgerycore/algorithms/procrustes.py
View file @
c3390b06
...
...
@@ -3,7 +3,7 @@
"""Functions for point based registration using Orthogonal Procrustes."""
import
numpy
as
np
from
sksurgerycore.algorithms.errors
import
compute_fr
e
import
sksurgerycore.algorithms.errors
as
e
def
validate_procrustes_inputs
(
fixed
,
moving
):
...
...
@@ -116,6 +116,6 @@ def orthogonal_procrustes(fixed, moving):
T
[
0
][
0
]
=
tmp
[
0
]
T
[
1
][
0
]
=
tmp
[
1
]
T
[
2
][
0
]
=
tmp
[
2
]
fre
=
compute_fre
(
fixed
,
moving
,
R
,
T
)
fre
=
e
.
compute_fre
(
fixed
,
moving
,
R
,
T
)
return
R
,
T
,
fre
tests/algorithms/test_errors.py
View file @
c3390b06
...
...
@@ -3,6 +3,12 @@
import
six
import
numpy
as
np
import
pytest
import
sksurgerycore.algorithms.procrustes
as
p
import
sksurgerycore.algorithms.errors
as
e
def
test_empty_fixed
():
with
pytest
.
raises
(
TypeError
):
e
.
compute_fre
(
None
,
None
,
np
.
ones
(
1
,
3
),
np
.
ones
(
3
,
3
))
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