Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fslpy
Commits
9dfd2a7c
Commit
9dfd2a7c
authored
5 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TEST: Regression test for gifti bug, fix error in image test
parent
fdfdd403
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/test_gifti.py
+11
-3
11 additions, 3 deletions
tests/test_gifti.py
tests/test_image.py
+1
-1
1 addition, 1 deletion
tests/test_image.py
with
12 additions
and
4 deletions
tests/test_gifti.py
+
11
−
3
View file @
9dfd2a7c
...
...
@@ -288,12 +288,18 @@ def test_GiftiMesh_multiple_vertices():
verts1
=
TEST_VERT_ARRAY
verts2
=
nib
.
gifti
.
GiftiDataArray
(
TEST_VERTS
*
5
,
intent
=
'
NIFTI_INTENT_POINTSET
'
)
verts3
=
nib
.
gifti
.
GiftiDataArray
(
TEST_VERTS
*
10
,
intent
=
'
NIFTI_INTENT_POINTSET
'
)
gimg
=
nib
.
gifti
.
GiftiImage
(
darrays
=
[
verts1
,
verts2
,
tris
])
gimg2
=
nib
.
gifti
.
GiftiImage
(
darrays
=
[
verts3
])
with
tempdir
():
fname
=
op
.
abspath
(
'
test.gii
'
)
gimg
.
to_filename
(
fname
)
fname
=
op
.
abspath
(
'
test.gii
'
)
fname2
=
op
.
abspath
(
'
test2.gii
'
)
gimg
.
to_filename
(
fname
)
gimg2
.
to_filename
(
fname2
)
surf
=
gifti
.
GiftiMesh
(
fname
)
expvsets
=
[
fname
,
...
...
@@ -304,9 +310,11 @@ def test_GiftiMesh_multiple_vertices():
assert
surf
.
vertexSets
()
==
expvsets
surf
.
vertices
=
expvsets
[
1
]
assert
np
.
all
(
surf
.
vertices
==
TEST_VERTS
*
5
)
surf
.
loadVertices
(
fname2
,
select
=
True
)
assert
np
.
all
(
surf
.
vertices
==
TEST_VERTS
*
10
)
def
test_GiftiMesh_needsFixing
():
from
.
import
test_mesh
...
...
This diff is collapsed.
Click to expand it.
tests/test_image.py
+
1
−
1
View file @
9dfd2a7c
...
...
@@ -306,7 +306,7 @@ def _test_Image_atts(imgtype):
assert
tuple
(
i
.
nibImage
.
shape
)
==
tuple
(
dims
)
assert
tuple
(
i
.
nibImage
.
header
.
get_zooms
())
==
tuple
(
pixdims
)
asert
i
.
nvals
==
1
as
s
ert
i
.
nvals
==
1
assert
i
.
ndim
==
expndims
assert
i
.
dtype
==
dtype
assert
i
.
name
==
op
.
basename
(
path
)
...
...
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