Skip to content

[BUG] GUI image displays mean of zero channels plus data channel #1422

@mrariden

Description

@mrariden

Before you fill out this form:

Did you review the FAQ?

Did you look through previous (open AND closed) issues posted on GH?

Now fill this form out completely:

Describe the bug

Grayscale image is calculated across blank image channels in GUI, causing saturation to display incorrectly:

cellpose/cellpose/gui/gui.py

Lines 1375 to 1379 in 849ca11

elif self.color == 4:
if self.nchan > 1:
image = image.mean(axis=-1)
self.img.setImage(image, autoLevels=False, lut=None)
self.img.setLevels(self.saturation[0][self.currentZ])

To Reproduce

Compare cp3 to cp4 GUI displays for the same image.

Run log

N/A

Screenshots

CP3:
CP3

CP4 (incorrect):

CP4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions