Reverse intensity (Insight)#4850
Conversation
|
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. |
|
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. But: Open image in Full Viewer - open Rendering Setting panes
Open image with imported settings in Full Viewer - open Rendering Settings pane
Re-open same image in FV - open RS pane
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. |
|
Fixed:
Still don't know where the black thumbnail issues come from, couldn't replicate them either. |
There was a problem hiding this comment.
I assume it's okay that the message mentions LOADING_RENDERING_CONTROL but the switch doesn't.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
It's fine with me if you prefer to fix these in a separate PR, just pop it on a 5.3 card.
There was a problem hiding this comment.
This is more legacy, I will handle it in a separate PR
There was a problem hiding this comment.
Just for reference: Trello card - Insight code cleanup
|
issue noticed this evening while looking at the black thumbnail problem.
|
|
Since the reverse intensity box is in the color picker |
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? |
|
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?). |
f61a0c7 to
e5bb0a4
Compare
|
@gusferguson |
|
@dominikl |
|
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. |
|
@dominikl: black thumbnail could be due to a race condition. |
|
discussed with @dominikl: optimistic lock reported previously see https://trello.com/c/9iAe3Sg9/95-lut-support Anything more @gusferguson? |
|
@pwalczysko: could you do a final round of review on this PR and the corresponding Web one i.e. #4839? |
|
Bug:
|
|
@dominikl: note that the backend PR has now been merged. |
|
@jburel Okay, ta, made a comment on the SPW PR. |
|
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. |
|
Is this edge case also in the release version? |
|
@jburel Yes, the edge case (=bug) is present in 5.2.5 release insight (connected to demo). |
|
card for bug https://trello.com/c/X3pLD781/131-bug-insight |
e5bb0a4 to
c16c91c
Compare
|
Rebased to develop, after #4823 has been merged. Probably a quick re-review necessary. |
|
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:
|
|
Tested the last 2 commits, both problems are now fixed |
|
cf. RFE #4850 (comment) One small problem noticed: |
| */ | ||
| 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) { |
|
|
||
| cb.setReverseIntensity(false); | ||
| List<CodomainMapContext> cdctx = c.copySpatialDomainEnhancement(); | ||
| for(CodomainMapContext cd : cdctx) { |
There was a problem hiding this comment.
usually we have space between for/if and bracket
| * The channel index | ||
| * @return See above | ||
| */ | ||
| boolean getReverseIntensity(int w); |
There was a problem hiding this comment.
maybe use index as in the other method
| * @param revInt | ||
| * The reverse intensity flag | ||
| */ | ||
| void setReverseIntensity(int w, boolean revInt) |
There was a problem hiding this comment.
maybe use index as in the other method
| /** | ||
| * Implemented as specified by {@link RenderingControl}. | ||
| * | ||
| * @see RenderingControl#getReverseIntensity(int) |
| /** | ||
| * Implemented as specified by {@link RenderingControl}. | ||
| * | ||
| * @see RenderingControl#setReverseIntensity(int, boolean) |
| package org.openmicroscopy.shoola.util.ui.colourpicker; | ||
|
|
||
|
|
||
| //Java imports |
There was a problem hiding this comment.
remove //java imports and the other 2
| newColor.lut = model.getLUT(); | ||
| oldColor.lut = model.getOriginalLUT(); | ||
|
|
||
| newColor.revInt = model.getReversetIntensity(); |
There was a problem hiding this comment.
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) |
| String text = fieldDescription.getText(); | ||
| if (text == null) return null; | ||
| return text.trim(); | ||
| text = text.trim(); |
There was a problem hiding this comment.
StringUtils.isBlank will handle null and length=0
|
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) { |
| * @param w The channel | ||
| * @param index The channel | ||
| * @return See above. | ||
| * @throws RenderingServiceException If an error occurred while getting |
There was a problem hiding this comment.
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?
| * Returns the list of the levels. | ||
| * | ||
| * @return See above. | ||
| * @throws RenderingServiceException If an error occurred while getting |
| //Third-party libraries | ||
|
|
||
|
|
||
| import org.apache.commons.lang.StringUtils; |
There was a problem hiding this comment.
same here could remove //Third-party etc.
| if(text.length()==0) | ||
| if (StringUtils.isBlank(text)) | ||
| return null; | ||
| return text; |
|
Last commit is javadoc only, no functional implication, so testing can still go ahead today if needed. |
|
Problem noticed has been fixed and changes in doc done. |






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.