Skip to content

Reverse intensity (Insight)#4850

Merged
jburel merged 13 commits intoome:developfrom
dominikl:reverse_intensity_2
Nov 7, 2016
Merged

Reverse intensity (Insight)#4850
jburel merged 13 commits intoome:developfrom
dominikl:reverse_intensity_2

Conversation

@dominikl
Copy link
Copy Markdown
Member

@dominikl dominikl commented Sep 19, 2016

What this PR does

Adds the reverse intensity functionality to Insight.

Testing this PR

In preview and full viewer: Open the color picker for a channel, reverse the intensity by ticking the checkbox in the upper right corner of the color picker.

@jburel jburel added the develop label Sep 19, 2016
@dominikl
Copy link
Copy Markdown
Member Author

By the way, I can move the checkbox/button somewhere else, if needed, not much hassle. Couldn't check how it looks like in OMERO.web, as #4839 apparently isn't in the build.

@gusferguson
Copy link
Copy Markdown

Tested using OMERO.insight-5.3.0-m4-253-43428df-ice36-b434-win eel user-3 read-only-1 image ID 24763

Location of checkbox appears fine.
Clicking the reverse intensity checkbox in the color picker appears to have the desired effect for both LUTs and plain colours and Preview and Accept buttons function as expected.

But:

Open image in Full Viewer - open Rendering Setting panes

  • as expected most of time - intermittently getting black user settings thumbnail in Full Viewer Rendering Settings pane - thumbnails in centre pane and Preview pane as expected - can’t reproduce reliably - may be after a number of channel colour changes and saves - see screenshot 1

Open image with imported settings in Full Viewer - open Rendering Settings pane

  • thumbnails and Preview as expected
  • use color picker on 3rd channel to select LUT - Green fire blue - click accept
  • thumbnail in FV RS pane user settings remains unchanged
  • thumbnail in Preview pane user settings - black
  • thumbnail in centre pane - unchanged
  • click save - no changes - screenshot 2
  • close FV - click refresh in Data Tree - still no update of thumbnails in centre pane or user settings in Preview pane

Re-open same image in FV - open RS pane

  • select color picker on same third channel - select reverse intensity - click accept
  • FV image reflects reversed intensity - Save button does not enable
  • Preview pane does not change
  • click on main window to get focus - Preview pane updates to show reverse intensity - save not enabled
  • close full viewer - select another image - go back to previous image - reverse intensity setting has not been saved
  • screenshots 3 and 4

Log out and log back in - LUT (not reversed intensity) showing in Preview pane and FV but all thumbnails in centre pane and user settings still show import settings - screenshot 5.

parallels desktop

parallels desktop

parallels desktop

parallels desktop

parallels desktop

@dominikl
Copy link
Copy Markdown
Member Author

Fixed:

  • Reverse intensity change wasn't recognized as rendering settings modification, that's why the save button wasn't enabled.
  • Various issues with the color picker when used in full image viewer.

Still don't know where the black thumbnail issues come from, couldn't replicate them either.

@jburel
Copy link
Copy Markdown
Member

jburel commented Sep 20, 2016

@dominikl: few more commits pushed to #4823

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I assume it's okay that the message mentions LOADING_RENDERING_CONTROL but the switch doesn't.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's a good point. There are actually quite a lot similar cases where the message of the exception is not really correct. Guess that just slipped in with copy/pastes. Might be worth a separate general clean-up PR. Wouldn't add it to this PR, already rather long and reviewed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's fine with me if you prefer to fix these in a separate PR, just pop it on a 5.3 card.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is more legacy, I will handle it in a separate PR

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@jburel
Copy link
Copy Markdown
Member

jburel commented Sep 21, 2016

issue noticed this evening while looking at the black thumbnail problem.
I start with an image with 2 channels: first is green, second red

  • Change first to a lut, save etc.
  • close the viewer
  • re-open the viewer
  • try to reset the color to green. Click accept in the color picker.
  • The image does not get updated. Colors are compared and are the same but in that case a lut was applied. So the "isSameSettings" needs to be reviewed.

@jburel
Copy link
Copy Markdown
Member

jburel commented Sep 21, 2016

Since the reverse intensity box is in the color picker
When selected, we should probably change the color of the button to match what is happening (i.e. "reverse color")
Thoughts? cc @will-moore @gusferguson

@gusferguson
Copy link
Copy Markdown

Since the reverse intensity box is in the color picker when selected, we should probably change the color of the button to match what is happening (i.e. "reverse color")

Not sure about this - does the button represent the LUT selected and the reverse intensity is something else - or is the reverse intensity the equivalent of a different LUT?

@dominikl
Copy link
Copy Markdown
Member Author

Yes, can replicate the problem #4850 (comment) . Thanks for the workflow.

RE #4850 (comment) : Was thinking about that, too. I'd also suggest to reverse/flip the color icon in the channel button (and slider?).

@jburel
Copy link
Copy Markdown
Member

jburel commented Sep 22, 2016

@gusferguson
the reverse intensity does new_value = 255-value e.g. 10 will become 245. So yes it can be seen as a different color/lut

@gusferguson
Copy link
Copy Markdown

@dominikl
Tested using OMERO.insight-5.3.0-m4-389-2cbfd1a-ice35-b438-mac eel user-3
Sorry I misunderstood the comment!
Yes the bug-fix has worked - last commit behaves as expected.

@dominikl
Copy link
Copy Markdown
Member Author

Thanks @gusferguson . Yes, the bug was switching from color to lut and back didn't work. I guess the black thumbnail problem is still there, still a bit a mystery to me.

@jburel
Copy link
Copy Markdown
Member

jburel commented Oct 6, 2016

@dominikl: black thumbnail could be due to a race condition.
Anything in the logs?

@jburel
Copy link
Copy Markdown
Member

jburel commented Oct 10, 2016

discussed with @dominikl: optimistic lock reported previously see https://trello.com/c/9iAe3Sg9/95-lut-support

Anything more @gusferguson?

@jburel
Copy link
Copy Markdown
Member

jburel commented Oct 12, 2016

@pwalczysko: could you do a final round of review on this PR and the corresponding Web one i.e. #4839?
server has been merged, and it will be good to wrap up this work

@pwalczysko
Copy link
Copy Markdown
Member

Bug:

  • Open an image in Full viewer.
  • Go to another image from the same Dataset. Open Preview.
  • In Preview, open a channel and check the "Inverse" checkbox, do not save
  • Copy the Rnd settings
  • go to another (third) image in Preview, paste the Rnd settings, then Save the Rnd settings
  • Still on the third image, click Save to All -> okay the dialog and observe that
  • all the thumbs in central pane change as expected, excelpt for the image whose full viewer is open

@pwalczysko
Copy link
Copy Markdown
Member

pwalczysko commented Oct 12, 2016

The default size of thumbs in central pane after you open Insight has changed (became bigger).
screen shot 2016-10-12 at 14 01 22

This comment is linke to the SPW PR as this is the culprit.

@jburel
Copy link
Copy Markdown
Member

jburel commented Oct 12, 2016

@dominikl: note that the backend PR has now been merged.

@jburel
Copy link
Copy Markdown
Member

jburel commented Oct 12, 2016

larger thumbnail has been introduced by 926479f see PR #4874

@pwalczysko
Copy link
Copy Markdown
Member

@jburel Okay, ta, made a comment on the SPW PR.

@pwalczysko
Copy link
Copy Markdown
Member

In summary, one Bug detected #4850 (comment). @dominikl is telling me this is hard to fix, the Bug, although repeatable is a slightly edge workflow case, so not a blocker if cannot be debugged.

Otherwise than that it works nicely.

@jburel
Copy link
Copy Markdown
Member

jburel commented Oct 12, 2016

Is this edge case also in the release version?

@pwalczysko
Copy link
Copy Markdown
Member

pwalczysko commented Oct 12, 2016

@jburel Yes, the edge case (=bug) is present in 5.2.5 release insight (connected to demo).

@jburel
Copy link
Copy Markdown
Member

jburel commented Oct 14, 2016

@dominikl dominikl force-pushed the reverse_intensity_2 branch from e5bb0a4 to c16c91c Compare October 14, 2016 09:14
@dominikl
Copy link
Copy Markdown
Member Author

Rebased to develop, after #4823 has been merged. Probably a quick re-review necessary.

@dominikl dominikl closed this Oct 14, 2016
@dominikl
Copy link
Copy Markdown
Member Author

dominikl commented Nov 2, 2016

Spotted (and fixed) another bug. If the channel color is changed from a lookup table to a color, it wasn't set this color but it was set to the color which was specified before the lookup table has been set. I don't think both are related to this PR, but makes sense to fix them here.

I.e. to test last two commits:

  • Follow @will-moore 's workflow Reverse intensity (Insight) #4850 (comment) ; make sure it's fixed now.
  • Set a channel to a specific color (remember that color); save rendering settings; set channel to a lookup table; save; now set channel to a different color from the previous one; make sure the channel is set to this color and not the one from the initial step.

@jburel
Copy link
Copy Markdown
Member

jburel commented Nov 3, 2016

Tested the last 2 commits, both problems are now fixed

@jburel
Copy link
Copy Markdown
Member

jburel commented Nov 3, 2016

cf. RFE #4850 (comment)
this is something to probably discuss as a follow. I will add it to the card i.e. https://trello.com/c/SrcTVbw3/135-lut-improvements

One small problem noticed:
In color picker, if a color is selected, it is displayed at the "top", as soon as I tick/untick reverse intensity it becomes white. This is not the case when I select a lut.

*/
private void handleColorPicker(boolean reset, boolean preview, int index,
Color newColor, Color oldColor, String newLut, String oldLut) {
Color newColor, Color oldColor, String newLut, String oldLut, boolean revInt) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

new parameter to add to javadoc


cb.setReverseIntensity(false);
List<CodomainMapContext> cdctx = c.copySpatialDomainEnhancement();
for(CodomainMapContext cd : cdctx) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

usually we have space between for/if and bracket

* The channel index
* @return See above
*/
boolean getReverseIntensity(int w);
Copy link
Copy Markdown
Member

@jburel jburel Nov 3, 2016

Choose a reason for hiding this comment

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

maybe use index as in the other method

* @param revInt
* The reverse intensity flag
*/
void setReverseIntensity(int w, boolean revInt)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe use index as in the other method

/**
* Implemented as specified by {@link RenderingControl}.
*
* @see RenderingControl#getReverseIntensity(int)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same index

/**
* Implemented as specified by {@link RenderingControl}.
*
* @see RenderingControl#setReverseIntensity(int, boolean)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same

package org.openmicroscopy.shoola.util.ui.colourpicker;


//Java imports
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

remove //java imports and the other 2

newColor.lut = model.getLUT();
oldColor.lut = model.getOriginalLUT();

newColor.revInt = model.getReversetIntensity();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

method name has an extra t. The method name needs to be fixed.

* @param selectedLUT The selected lookup table
*/
public ColourPicker(JFrame owner, Color color, Collection<String> luts, String selectedLUT)
public ColourPicker(JFrame owner, Color color, Collection<String> luts, String selectedLUT, boolean revInt)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

javadoc missing new param

String text = fieldDescription.getText();
if (text == null) return null;
return text.trim();
text = text.trim();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

StringUtils.isBlank will handle null and length=0

@dominikl
Copy link
Copy Markdown
Member Author

dominikl commented Nov 3, 2016

Thanks @jburel . All issues should be fixed now. Will add it to re-review tomorrow.

List<CodomainMapContext> cdctx = c.copySpatialDomainEnhancement();
for(CodomainMapContext cd : cdctx) {
for (CodomainMapContext cd : cdctx) {
if(cd instanceof ReverseIntensityContext) {
Copy link
Copy Markdown
Member

@jburel jburel Nov 3, 2016

Choose a reason for hiding this comment

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

space before if

* @param w The channel
* @param index The channel
* @return See above.
* @throws RenderingServiceException If an error occurred while getting
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

while retrieving the contexts

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Would it make sense to just say 'If an error occurred', the 'while ...' part basically just repeats what is said in the method description anyway?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

makes sense

* Returns the list of the levels.
*
* @return See above.
* @throws RenderingServiceException If an error occurred while getting
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

while retrieving the values

//Third-party libraries


import org.apache.commons.lang.StringUtils;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same here could remove //Third-party etc.

if(text.length()==0)
if (StringUtils.isBlank(text))
return null;
return text;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I will still return text.trim()

@dominikl
Copy link
Copy Markdown
Member Author

dominikl commented Nov 4, 2016

Last commit is javadoc only, no functional implication, so testing can still go ahead today if needed.

@dominikl dominikl closed this Nov 4, 2016
@dominikl dominikl reopened this Nov 4, 2016
@jburel
Copy link
Copy Markdown
Member

jburel commented Nov 7, 2016

Problem noticed has been fixed and changes in doc done.
Merging Thanks

@jburel jburel merged commit 378fd3a into ome:develop Nov 7, 2016
@jburel jburel added this to the 5.3.0 milestone Mar 29, 2017
@dominikl dominikl deleted the reverse_intensity_2 branch May 3, 2017 09:28
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.

6 participants