diff --git a/fsl/data/fslimage.py b/fsl/data/fslimage.py index 394fbc30c25c3dc2155e2b258e4ac52c5fd00497..a8cd635a692123d6ea6cc7f1f9529befb9ce0103 100644 --- a/fsl/data/fslimage.py +++ b/fsl/data/fslimage.py @@ -412,11 +412,10 @@ class ImageDisplay(props.HasProperties): self.dataMax = image.data.max() dRangeLen = abs(self.dataMax - self.dataMin) - - self.displayRange.setLo( 0, self.dataMin) - self.displayRange.setHi( 0, self.dataMax) + self.displayRange.setMin(0, self.dataMin - 0.5 * dRangeLen) self.displayRange.setMax(0, self.dataMax + 0.5 * dRangeLen) + self.displayRange.setRange(0, self.dataMin, self.dataMax) # is this a 4D volume? if self.is4DImage(): diff --git a/fsl/props/properties_types.py b/fsl/props/properties_types.py index 8bd2721acf01d6e67d7cd8198cf1cf57e236abab..e41d0c55fa019c8d250e4cb1cb0864ad64848d95 100644 --- a/fsl/props/properties_types.py +++ b/fsl/props/properties_types.py @@ -428,9 +428,8 @@ class BoundsValueList(propvals.PropertyValueList): def setHi(self, axis, value): self[axis * 2 + 1] = value - def setRange(self, axis, values): - self.setMin(axis, values[0]) - self.setMax(axis, values[1]) + def setRange(self, axis, minval, maxval): + self[axis * 2:axis * 2 + 2] = [minval, maxval] def getMin(self, axis): return self.getPropertyValueList()[axis * 2].getAttribute('minval') diff --git a/fsl/props/properties_value.py b/fsl/props/properties_value.py index eb0a5c32475e11fe9425e5ac50f2805c2a23d7ff..464988b37c05f1c3f09b2301a5f29099b4ec7855 100644 --- a/fsl/props/properties_value.py +++ b/fsl/props/properties_value.py @@ -453,11 +453,6 @@ class PropertyValueList(PropertyValue): given item in a PropertyValue object. """ - # The only interesting thing here is the postNotifyFunc - - # whenever a PropertyValue in this list changes, the entire - # list is revalidated. This is primarily to ensure that - # list-listeners are notified of changes to individual list - # elements. if self._itemAttributes is None: itemAtts = {} else: itemAtts = self._itemAttributes