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
e7390bf9
Commit
e7390bf9
authored
6 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
TEST: Fix dicom tests (were using deprecated methods)
parent
dbde2fca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_dicom.py
+16
-12
16 additions, 12 deletions
tests/test_dicom.py
with
16 additions
and
12 deletions
tests/test_dicom.py
+
16
−
12
View file @
e7390bf9
...
@@ -47,9 +47,13 @@ def test_enabled():
...
@@ -47,9 +47,13 @@ def test_enabled():
side_effect
=
Exception
()):
side_effect
=
Exception
()):
assert
not
fsldcm
.
enabled
()
assert
not
fsldcm
.
enabled
()
# test presence of different versions
# test presence of different versions
tests
=
[(
b
'
version v2.1.20191212
'
,
True
),
tests
=
[(
b
'
version v2.1.20191212
'
,
True
),
(
b
'
version v1.0.20160930
'
,
True
),
(
b
'
version v1.0.20171216
'
,
True
),
(
b
'
version v1.0.20171215
'
,
True
),
(
b
'
version v1.0.20171214
'
,
False
),
(
b
'
version v1.0.20160930
'
,
False
),
(
b
'
version v1.0.20160929
'
,
False
),
(
b
'
version v1.0.20160929
'
,
False
),
(
b
'
version v0.0.00000000
'
,
False
),
(
b
'
version v0.0.00000000
'
,
False
),
(
b
'
version blurgh
'
,
False
)]
(
b
'
version blurgh
'
,
False
)]
...
@@ -76,7 +80,7 @@ def test_scanDir():
...
@@ -76,7 +80,7 @@ def test_scanDir():
f
.
extractall
()
f
.
extractall
()
series
=
fsldcm
.
scanDir
(
td
)
series
=
fsldcm
.
scanDir
(
td
)
assert
len
(
series
)
==
2
assert
len
(
series
)
==
3
for
s
in
series
:
for
s
in
series
:
assert
(
s
[
'
PatientName
'
]
==
'
MCCARTHY_PAUL
'
or
assert
(
s
[
'
PatientName
'
]
==
'
MCCARTHY_PAUL
'
or
...
@@ -104,13 +108,13 @@ def test_loadSeries():
...
@@ -104,13 +108,13 @@ def test_loadSeries():
for
img
in
imgs
:
for
img
in
imgs
:
assert
img
.
dicomDir
==
td
assert
img
.
dicomDir
==
td
assert
img
.
shape
==
expShape
assert
img
.
shape
==
expShape
assert
img
[:].
shape
==
expShape
assert
img
[:].
shape
==
expShape
assert
img
.
get
(
'
PatientName
'
)
==
'
MCCARTHY_PAUL
'
or
\
assert
img
.
get
Meta
(
'
PatientName
'
)
==
'
MCCARTHY_PAUL
'
or
\
img
.
get
(
'
PatientName
'
)
==
'
MCCARTHY_PAUL_2
'
img
.
get
Meta
(
'
PatientName
'
)
==
'
MCCARTHY_PAUL_2
'
assert
'
PatientName
'
in
img
.
k
eys
()
assert
'
PatientName
'
in
img
.
metaK
eys
()
assert
'
MCCARTHY_PAUL
'
in
img
.
v
alues
()
or
\
assert
'
MCCARTHY_PAUL
'
in
img
.
metaV
alues
()
or
\
'
MCCARTHY_PAUL_2
'
in
img
.
v
alues
()
'
MCCARTHY_PAUL_2
'
in
img
.
metaV
alues
()
assert
(
'
PatientName
'
,
'
MCCARTHY_PAUL
'
)
in
img
.
i
tems
()
or
\
assert
(
'
PatientName
'
,
'
MCCARTHY_PAUL
'
)
in
img
.
metaI
tems
()
or
\
(
'
PatientName
'
,
'
MCCARTHY_PAUL_2
'
)
in
img
.
i
tems
()
(
'
PatientName
'
,
'
MCCARTHY_PAUL_2
'
)
in
img
.
metaI
tems
()
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