View Issue Details

IDProjectCategoryView StatusLast Update
0003115Slicer4Module Editorpublic2017-06-07 23:27
Reporterlassoan Assigned Tonicole  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version 
Target VersionSlicer 4.4.0Fixed in VersionSlicer 4.4.0 
Summary0003115: Editor module does not draw with the selected color
Description

When a custom colormap is used (with a lookup range that is not exactly 0.00 - NumberOfColors-1) then the drawing tools don't draw on the image with the selected color.

How to reproduce:

  • Load MRHead sample
  • Go to Colors module and duplicate the current (GenericColors) colormap
  • Set the number of colors to 50
  • Set the opacity of the first color to 0.0 (just to keep the MRHead volume visible, see 0003114)
  • Go to editor, select the new UserGenerated/GenericColorsCopy labelmap
  • Select the PaintEffect (keep the default label: 1 = green)
  • Draw on the MRHead image
    => ERROR: nothing appears on the image!
  • Select label: 10 = dark brown and
  • Draw on the MRHead image
    => ERROR: painting appears in green (instead of the expected dark brown)

Workaround: set the lookup range in the colors module for the custom colormap to 0.00 - (NumberOfColors-1)

TagsNo tags attached.

Relationships

related to 0003586 closednicole Volume color table nodes have incorrect TableRange 

Activities

pieper

pieper

2013-05-13 12:33

administrator   ~0008631

I think the editor is doing the right thing, but there is an issue with the color nodes and/or label map display node. It seem to me that the label scalar range should probably be clamped to be 0 to numcolors-1 for a discrete color table.

lassoan

lassoan

2013-05-13 14:34

developer   ~0008632

I'm not sure if there is any distinction between discrete and continuous color tables. For me, as a user, all colormaps seems to work the same way now.

The problem is that the Editor assumes that the LUT function is identity (f(x)=x), which is not always the case. It's not even the case for many of the built-in colormaps.

The Editor module should do one of the followings:
A. refuse the selection of a colormap with a non-identity LUT (this could be an issue, as the LUT can change, etc.)
B. set LUT to identity in the selected labelmap (can be problematic for built-in colormaps that are read-only)
C. allow selection from the same set of colors as those listed in the color module for the selected colormap => in this case the actual drawing color should be computed using the LUT (you cannot use the color index as drawing color)
D. allow selection of a drawing color from the lookup range and use that value for drawing => in this case you may show the name of the closest color (that you determine by using the LUT)
E. Having "discrete" colormaps with enforced identity LUT. The Editor would only allow selection of discrete colormaps.
...others?

I would probably prefer E. If that's not doable then maybe C.

nicole

nicole

2013-05-14 11:03

administrator   ~0008638

The Colors module only allows editing for discrete color tables, the number of colors entry box etc are disabled when continous ones are chosen. The colors in the table for continuous nodes are a sampling to try and show a bit of what the color node provides.

I was able to update the color table range when the number of colors is modified in the Colors module, and the steps in the Description above work with that change (not checked in yet).

It's still a problem that if the range on the vtkLookupTable doesn't match the number of colors in the table, the Editor module draws with a different color than comes up in the color chooser. This could be avoided for discrete color nodes by disabling the range slider in the Color module, at least until a more intuitive user experience can be crafted in the Editor module.

From the lettered list: definitely don't do B.
E is probably the safest path for now (and my changes would help enforce it from a copy node perspective), but would require some book keeping if we allow users to change the scalar range on color nodes (we'd have to keep track of when the number of color and/or look up table range are changed).

In the larger picture, the range setting on a look up table is mostly useful for continuous ones (I'm thinking of the heat or PET LUTs), can we come up with a use case where it would make sense on a discrete color table? For me, it's not easily intuitive how the mapping from integer to colour values change as I change the range. If we're going to support it, I'd like to see some changing icon hints like the ones that Julien puts in the drop down menu. Also: verifying that the scalar bar widget properly reflects the range and number of colors.

nicole

nicole

2013-05-14 13:37

administrator   ~0008644

svn 21993[1] updates the table range and also only updates the number of colors when finished editing on the spin box (press enter or it loses the mouse focus)

[1] http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=21993

nicole

nicole

2014-03-06 05:04

administrator   ~0010896

I tested the steps to reproduce it, seems like this was fixed as a side effect of my work on the color look up table ranges in bug 3586.

jcfr

jcfr

2014-09-17 23:01

administrator   ~0012574

Closing resolved issues that have not been updated in more than 3 months.

Related Changesets

Slicer: 2145-support-for-installing-extension-from-file 5427f71a

2013-05-14 17:36:03

naucoin

Details Diff
BUG: Set the color range when changing number of colors

When copying a color table node and reducing the number
of colors in it, the color table range wasn't updated.
This led to problems in the Editor module when the selected
drawing integer wasn't matched up to the expected color.
Now when the number of colors is set on a user editable
color node, the range is set on the color look up table
and on the GUI slider at the same time.
Also updated the number of colors spin box to only trigger
a reset of the number of colors on the node on the editingFinished signal
as othewise cutting down a table from 300 to 50 colors could
empty out the table and refill it with black rather than
creating a subset of the original table.

Issue 0003115



git-svn-id: http://svn.slicer.org/Slicer4/trunk@21993 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Modules/Loadable/Colors/qSlicerColorsModuleWidget.cxx Diff File
mod - Modules/Loadable/Colors/qSlicerColorsModuleWidget.h Diff File

Slicer: 2145-support-for-installing-extension-from-file 6365c74f

2013-05-15 15:29:15

naucoin

Details Diff
BUG: set LUT range widget to trigger setting range on LUT

Updating the GUI element will trigger a signal to update the look up table
on the color node.
Renamed a method from setNumberOfColors to updateNumberOfColors as it wasn't
taking an argument.
TODO: set up an observation on the look up table on the color node

Issue 0003115



git-svn-id: http://svn.slicer.org/Slicer4/trunk@21999 3bd1e089-480b-0410-8dfb-8563597acbee
mod - Modules/Loadable/Colors/qSlicerColorsModuleWidget.cxx Diff File
mod - Modules/Loadable/Colors/qSlicerColorsModuleWidget.h Diff File

Issue History

Date Modified Username Field Change
2013-05-13 12:18 lassoan New Issue
2013-05-13 12:18 lassoan Status new => assigned
2013-05-13 12:18 lassoan Assigned To => pieper
2013-05-13 12:32 pieper Assigned To pieper => lassoan
2013-05-13 12:32 pieper Assigned To lassoan => nicole
2013-05-13 12:33 pieper Note Added: 0008631
2013-05-13 14:34 lassoan Note Added: 0008632
2013-05-14 11:03 nicole Note Added: 0008638
2013-05-14 13:37 nicole Note Added: 0008644
2013-09-03 12:22 nicole Target Version => Slicer 4.4.0
2014-03-06 04:59 nicole Relationship added related to 0003586
2014-03-06 05:04 nicole Note Added: 0010896
2014-03-06 05:04 nicole Status assigned => resolved
2014-03-06 05:04 nicole Fixed in Version => Slicer 4.4.0
2014-03-06 05:04 nicole Resolution open => fixed
2014-03-06 05:23 jcfr Status resolved => closed
2014-03-06 05:32 jcfr Status closed => resolved
2014-09-17 22:59 jcfr Status resolved => closed
2014-09-17 23:01 jcfr Note Added: 0012574
2017-06-07 23:27 Changeset attached => Slicer 2145-support-for-installing-extension-from-file 6365c74f
2017-06-07 23:27 Changeset attached => Slicer 2145-support-for-installing-extension-from-file 5427f71a