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
69ad3ffb
Commit
69ad3ffb
authored
7 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Fixes to dcmstack to make it work with python3 and pydicom:master
parent
aa4a73bd
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
fsl/data/dcmstack/dcmstack.py
+8
-3
8 additions, 3 deletions
fsl/data/dcmstack/dcmstack.py
fsl/data/dcmstack/extract.py
+1
-0
1 addition, 0 deletions
fsl/data/dcmstack/extract.py
with
9 additions
and
3 deletions
fsl/data/dcmstack/dcmstack.py
+
8
−
3
View file @
69ad3ffb
...
@@ -4,6 +4,8 @@ into the package namespace.
...
@@ -4,6 +4,8 @@ into the package namespace.
"""
"""
import
warnings
,
re
,
dicom
import
warnings
,
re
,
dicom
from
copy
import
deepcopy
from
copy
import
deepcopy
from
collections
import
MutableSequence
import
six
import
nibabel
as
nb
import
nibabel
as
nb
from
nibabel.nifti1
import
Nifti1Extensions
from
nibabel.nifti1
import
Nifti1Extensions
from
nibabel.spatialimages
import
HeaderDataError
from
nibabel.spatialimages
import
HeaderDataError
...
@@ -1091,18 +1093,21 @@ def parse_and_group(src_paths, group_by=default_group_keys, extractor=None,
...
@@ -1091,18 +1093,21 @@ def parse_and_group(src_paths, group_by=default_group_keys, extractor=None,
# Unpack sub results, using the canonical value for the close keys
# Unpack sub results, using the canonical value for the close keys
full_results
=
{}
full_results
=
{}
for
eq_key
,
sub_res_list
in
results
.
iter
items
():
for
eq_key
,
sub_res_list
in
results
.
items
():
for
close_key
,
sub_res
in
sub_res_list
:
for
close_key
,
sub_res
in
sub_res_list
:
full_key
=
[]
full_key
=
[]
eq_idx
=
0
eq_idx
=
0
close_idx
=
0
close_idx
=
0
for
grp_key
in
group_by
:
for
grp_key
in
group_by
:
if
grp_key
in
close_tests
:
if
grp_key
in
close_tests
:
full_key
.
append
(
close_key
[
close_idx
]
)
val
=
close_key
[
close_idx
]
close_idx
+=
1
close_idx
+=
1
else
:
else
:
full_key
.
append
(
eq_key
[
eq_idx
]
)
val
=
eq_key
[
eq_idx
]
eq_idx
+=
1
eq_idx
+=
1
if
isinstance
(
val
,
MutableSequence
):
val
=
tuple
(
val
)
full_key
.
append
(
val
)
full_key
=
tuple
(
full_key
)
full_key
=
tuple
(
full_key
)
full_results
[
full_key
]
=
sub_res
full_results
[
full_key
]
=
sub_res
...
...
This diff is collapsed.
Click to expand it.
fsl/data/dcmstack/extract.py
+
1
−
0
View file @
69ad3ffb
"""
"""
Extract meta data from a DICOM data set.
Extract meta data from a DICOM data set.
"""
"""
import
sys
import
struct
,
warnings
import
struct
,
warnings
from
collections
import
namedtuple
,
defaultdict
from
collections
import
namedtuple
,
defaultdict
import
dicom
import
dicom
...
...
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