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
e4c1f899
"doc/git@git.fmrib.ox.ac.uk:ndcn0236/fslpy.git" did not exist on "e7341f6503e353201217ba845aa842da8a1877ea"
Commit
e4c1f899
authored
8 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Expansion on empty coverage did not contain padding/volume dimensions.
parent
962d7c0c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fsl/data/imagewrapper.py
+15
-8
15 additions, 8 deletions
fsl/data/imagewrapper.py
with
15 additions
and
8 deletions
fsl/data/imagewrapper.py
+
15
−
8
View file @
e4c1f899
...
@@ -427,13 +427,25 @@ def calcExpansion(slices, coverage):
...
@@ -427,13 +427,25 @@ def calcExpansion(slices, coverage):
expansions
=
[]
expansions
=
[]
volumes
=
[]
volumes
=
[]
# Finish off an expansion by
# adding indices for the vector/
# slice/volume dimension, and for
# 'padding' dimensions of size 1.
def
finishExpansion
(
exp
,
vol
):
exp
.
append
((
vol
,
vol
+
1
))
for
i
in
range
(
padDims
):
exp
.
append
((
0
,
1
))
return
exp
for
vol
in
range
(
lowVol
,
highVol
):
for
vol
in
range
(
lowVol
,
highVol
):
# No coverage of this volume -
# No coverage of this volume -
# we need the whole slice.
# we need the whole slice.
if
np
.
any
(
np
.
isnan
(
coverage
[:,
:,
vol
])):
if
np
.
any
(
np
.
isnan
(
coverage
[:,
:,
vol
])):
exp
=
[(
s
[
0
],
s
[
1
])
for
s
in
slices
[:
numDims
]]
exp
=
finishExpansion
(
exp
,
vol
)
volumes
.
append
(
vol
)
volumes
.
append
(
vol
)
expansions
.
append
(
[(
s
[
0
],
s
[
1
])
for
s
in
slices
[:
numDims
]]
)
expansions
.
append
(
exp
)
continue
continue
# First we'll figure out the index
# First we'll figure out the index
...
@@ -492,13 +504,8 @@ def calcExpansion(slices, coverage):
...
@@ -492,13 +504,8 @@ def calcExpansion(slices, coverage):
expansion
[
dimy
][
0
]
=
expLow
expansion
[
dimy
][
0
]
=
expLow
expansion
[
dimy
][
1
]
=
expHigh
expansion
[
dimy
][
1
]
=
expHigh
# Finish off this expansion by
# Finish off this expansion
# adding indices for the vector/
expansion
=
finishExpansion
(
expansion
,
vol
)
# slice/volume dimension, and for
# 'padding' dimensions of size 1.
expansion
.
append
((
vol
,
vol
+
1
))
for
i
in
range
(
padDims
):
expansion
.
append
((
0
,
1
))
volumes
.
append
(
vol
)
volumes
.
append
(
vol
)
volExpansions
.
append
(
expansion
)
volExpansions
.
append
(
expansion
)
...
...
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