File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1374,6 +1374,10 @@ def update_plot(self):
13741374 self .img .setLevels (self .saturation [0 ][self .currentZ ])
13751375 elif self .color == 4 :
13761376 if self .nchan > 1 :
1377+ # exclude channels with no data:
1378+ ranges = np .ptp (image , tuple (range (image .ndim - 1 )))
1379+ range_mask = ranges > 1e-5
1380+ image = image [..., range_mask ]
13771381 image = image .mean (axis = - 1 )
13781382 self .img .setImage (image , autoLevels = False , lut = None )
13791383 self .img .setLevels (self .saturation [0 ][self .currentZ ])
Original file line number Diff line number Diff line change @@ -486,6 +486,10 @@ def update_ortho(self):
486486 self .saturation [0 ][self .currentZ ])
487487 elif self .color == 4 :
488488 if image .ndim > 2 :
489+ # exclude blank channels:
490+ ranges = np .ptp (image , tuple (range (image .ndim - 1 )))
491+ range_mask = ranges > 1e-5
492+ image = image [..., range_mask ]
489493 image = image .astype ("float32" ).mean (axis = 2 ).astype ("uint8" )
490494 self .imgOrtho [j ].setImage (image , autoLevels = False , lut = None )
491495 self .imgOrtho [j ].setLevels (self .saturation [0 ][self .currentZ ])
You can’t perform that action at this time.
0 commit comments