Skip to content

Commit

Permalink
BUG #1947: isofill does not handle out of bounds levels correctly.
Browse files Browse the repository at this point in the history
When smallest level is bigger than min scalar value or biggest level
is smaller than max scalar value isofill creates the wrong image.
  • Loading branch information
danlipsa committed Jun 12, 2016
1 parent cc0a870 commit 0c487ee
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Packages/vcs/vcs/vcsvtk/isofillpipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,17 @@ def _plotInternal(self):
lut.SetTableValue(j, 1., 1., 1., 0.)
luts.append([lut, [0, len(l) - 1, True]])
mapper.SetLookupTable(lut)
mapper.SetScalarRange(0, len(l) - 1)
minRange = 0
maxRange = len(l) - 1
if (i == 0 and self._scalarRange[0] < l[0]):
# band 0 is from self._scalarRange[0] to l[0]
# we don't show band 0
minRange += 1
if (i == len(tmpLevels) - 1 and self._scalarRange[1] > l[-1]):
# band len(l) - 1 is from l[-1] to self._scalarRange[1]
# we don't show band len(l) - 1
maxRange -= 1
mapper.SetScalarRange(minRange, maxRange)
mapper.SetScalarModeToUseCellData()
mappers.append(mapper)

Expand Down

0 comments on commit 0c487ee

Please sign in to comment.