Skip to content
Snippets Groups Projects
Commit e4c1f899 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

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
...@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment