Skip to content

Commit 8f13def

Browse files
Merge pull request #1149 from silx-kit/fix_white_black_nan_rgbcorrelator
Fix whitening of 'nan' in RGBcorrelator for green and blue colors
2 parents cc75c7f + 0f239f7 commit 8f13def

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/PyMca5/PyMcaGui/pymca/RGBCorrelatorWidget.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,12 @@ def __recolor(self, color=None):
548548
and self.currentNanColor == 'white'
549549
):
550550
colorlist = ["r", "g", "b"]
551-
nan_indices = numpy.where(numpy.isnan(self.__redImageData))
551+
# if any element of R or G or B map is nan it will become white
552+
nan_indices = numpy.where(
553+
numpy.isnan(self.__redImageData) |
554+
numpy.isnan(self.__greenImageData) |
555+
numpy.isnan(self.__blueImageData)
556+
)
552557
redImageData = numpy.copy(self.__redImageData)
553558
greenImageData = numpy.copy(self.__greenImageData)
554559
blueImageData = numpy.copy(self.__blueImageData)

0 commit comments

Comments
 (0)