Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the color to grey if one channel. #3140

Merged
merged 1 commit into from
Oct 28, 2014
Merged

Conversation

jburel
Copy link
Member

@jburel jburel commented Oct 27, 2014

To test this PR

  • Import an image with one channel e.g. DICOM
  • The channel should now be grey instead of red (see screenshot before and after)
    before
    singlechannel
    after
    singlechannelafter

@jburel jburel added the develop label Oct 27, 2014
@ghost
Copy link

ghost commented Oct 28, 2014

I'm not convinced of this being reasonable behaviour. If an image has a channel colour and a single channel, that channel colour should be used. Isn't the problem here the assignment of red as the channel colour in the absence of a channel colour? In the latter case defaulting to grey is reasonable, but for the former this is completely counter to expectations (and other software).

@jburel
Copy link
Member Author

jburel commented Oct 28, 2014

@rleigh-dundee: if the color is already set, we use it. We only default to grey if no color set. see commit

Integer alpha = getValue(channel.getAlpha());
RString name;
//color already set by Bio-formats
if (red != null && green != null && blue != null && alpha != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that if Bio-Formats set RGB then it would have also set α.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mtbc: it will yes

@mtbc
Copy link
Member

mtbc commented Oct 28, 2014

Works well, good to merge.

@jburel
Copy link
Member Author

jburel commented Oct 28, 2014

Merging

jburel added a commit that referenced this pull request Oct 28, 2014
Set the color to grey if one channel.
@jburel jburel merged commit 0206542 into ome:develop Oct 28, 2014
@jburel
Copy link
Member Author

jburel commented Oct 28, 2014

--no-rebase

@jburel jburel deleted the rnd-one-channel branch October 29, 2014 09:02
@sbesson sbesson added this to the 5.1.0-m2 milestone Nov 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants