Skip to content

Commit 95be426

Browse files
committed
Auto-scale LUT range when data changes in properties panel
Remove explicit lut_range preservation in ImageObjPlotPyAdapter.update_item() to allow automatic LUT scaling when image data changes. User-adjusted LUT ranges are still preserved via zscalemin/zscalemax metadata. Fixes issue where modifying Creation/Processing tab parameters updated the image but kept the old colormap scale, preventing proper visualization.
1 parent 4302868 commit 95be426

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

datalab/adapters_plotpy/objects/image.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,11 @@ def update_item(self, item: MaskedXYImageItem, data_changed: bool = True) -> Non
133133
data_changed: if True, data has changed
134134
"""
135135
if data_changed:
136-
item.set_data(self.__viewable_data(), lut_range=[item.min, item.max])
136+
# When data changes, let set_data() auto-calculate the LUT range from the
137+
# new data (by not passing lut_range parameter). The subsequent call to
138+
# update_plot_item_parameters() will override it if zscalemin/zscalemax
139+
# are explicitly set in the object's metadata.
140+
item.set_data(self.__viewable_data())
137141
item.set_mask(self.obj.maskdata)
138142
item.param.label = self.obj.title
139143
self.update_plot_item_parameters(item)

0 commit comments

Comments
 (0)