View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013082ParaView(No Category)public2012-04-10 20:182013-11-01 13:18
ReporterAlan Scott 
Assigned ToUtkarsh Ayachit 
PriorityhighSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.14 
Target Version4.0Fixed in Version4.1 
Summary0013082: Log scaling some color tables is wrong
DescriptionWhen you log scale some of the color tables, it is incorrect. See the Desaturated one.

3.14.0, local server, Linux.
Wavelet, apply, surface. Color by RTData.
Color Editor - Choose Preset, Cool to Warm. Apply. Notice the color. Use Log Scale. Apply. Notice the color shift.

Now, do the same, but change to the Preset Rainbow Desaturated. Log and non log look pretty much the same. this is a bug.
TagsColorMap
ProjectSandia
Topic Name13082_fix_log_lut
Typeincorrect functionality
Attached Filespng file icon screenshot.png [^] (20,577 bytes) 2012-08-13 18:43

 Relationships

  Notes
(0028697)
Alan Scott (manager)
2012-06-14 18:07

Another way of saying it comes from one of my users:


I mentioned a while back that log scaling doesn’t work correctly for the new color scales recently added to ParaView. I LOVE the new color scales, but I very frequently need log scaling to make any sense of what I’m plotting – in fact, almost every time I use ParaView I need log scaling. The following color scales do not do the log scaling correctly:

Rainbow Desaturated
Rainbow Blended White
Rainbow Blended Grey
Cold and Hot
Black, Orange and White
Black, Blue and White
Black-Body Radiation

The others do have it right:

Blue to Yellow
X Ray
Grayscale
Red to Blue Rainbow
Blue to Red Rainbow
Cool to Warm

What’s happening that is wrong is that in the “Color Scale Editor,” if I click “Use Logarithmic Scale,” the points on the colored scale at the top of the window do not move for the new color scales (Rainbow Desaturated, etc), but they do move for the older color scales (Blue to Yellow, etc.). When the points don’t move, the plotted colors only vary significantly for values that are on the same order of magnitude as the maximum value, leaving those that are 2, 3, or more orders of magnitude smaller all plotted at nearly the same shade, which is useless.

I think you understand all this, but I wanted to make sure that someone on the ParaView and/or Kitware team is planning to fix this. Is it on the to-do list?
(0028997)
Alan Scott (manager)
2012-08-13 17:41

I have come up with a partial solution to this bug. This colors for log correctly, but is not right with different paths through the code.

Correct behavior:
* Open disk_out_ref.exo. All vars on, apply.
* +Y
* Paint by GlobalElementId.
* Turn on a color legend.
* Color editor
** Choose Preset.
** Cold and Hot. OK.
** Use Logarithmic Scale. Apply.
<< This is correct, I believe >>

Incorrect weirdness:
* Open disk_out_ref.exo. All vars on, apply.
* +Y
* Paint by GlobalElementId.
* Turn on a color legend.
* Color editor
** Use Logarithmic Scale.
** Choose Preset.
** Cold and Hot. OK. Apply.


Patch that partially works:

diff --git a/Rendering/Core/vtkColorTransferFunction.cxx b/Rendering/Core/vtkCol
index e56e6ce..c743214 100644
--- a/Rendering/Core/vtkColorTransferFunction.cxx
+++ b/Rendering/Core/vtkColorTransferFunction.cxx
@@ -753,9 +753,12 @@ void vtkColorTransferFunction::GetTable( double xStart, dou
         }
       }
 
+ // wascott - Added the test for log
     // Do we need to move to the next node?
     while ( idx < numNodes &&
- x > this->Internal->Nodes[idx]->X )
+ ((x > this->Internal->Nodes[idx]->X && !usingLogScale ) ||
+ (logX/logEnd >= (this->Internal->Nodes[idx]->X/xEnd) && usingLogSc
+ //while ( idx < numNodes && x > this->Internal->Nodes[idx]->X)
       {
       idx++;
       // If we are at a valid point index, fill in
@@ -764,12 +767,18 @@ void vtkColorTransferFunction::GetTable( double xStart, do
       // idx cannot be 0 since we just incremented it.
       if ( idx < numNodes )
         {
- x1 = this->Internal->Nodes[idx-1]->X;
- x2 = this->Internal->Nodes[idx ]->X;
- if(usingLogScale)
+ // wascott - changed log to be a ratio, rather than just a log calcuati
+ if(!usingLogScale)
           {
- x1 = log10(x1);
- x2 = log10(x2);
+ x1 = this->Internal->Nodes[idx-1]->X;
+ x2 = this->Internal->Nodes[idx ]->X;
+ }
+ else
+ {
+ x1 = logEnd*(this->Internal->Nodes[idx-1]->X / xEnd);
+ x2 = logEnd*(this->Internal->Nodes[idx ]->X / xEnd);
+ //x1 = log10(this->Internal->Nodes[idx-1]->X);
+ //x2 = log10(this->Internal->Nodes[idx ]->X);
           }
 
         rgb1[0] = this->Internal->Nodes[idx-1]->R;
(0028998)
Alan Scott (manager)
2012-08-13 18:44

Adding a screenshot of what we want for log scales of Cold to Hot.
(0029530)
Sebastien Jourdain (manager)
2012-10-26 15:16

Applied the patch, tested and get the same image in both scenario.
(0029545)
Utkarsh Ayachit (administrator)
2012-10-29 10:50

merged into master, if applicable.
(0029581)
Alan Scott (manager)
2012-10-29 16:51

Seb,
This fix is incorrect. I showed Utkarsh what I think should happen at a GUI/user level, but don't know what should happen in the code.

Utkarsh and I would like to roll this bug back out of the code base for the 3.98 release. The previous functionality is correct, if the user uses a color table without center points. This is the vast majority of the cases, thus we will release without this fix.
(0029594)
Sebastien Jourdain (manager)
2012-10-30 10:37

For now I've reverted here: 13082_log_scaling_issue_REVERT
(0031345)
Utkarsh Ayachit (administrator)
2013-07-26 16:13

Color Map Editor has now been redesigned to better support converting to and from log-scale mapping. Note, however, that the opacity mapping function doesn't support log-mapping hence when one enter log-space, that widget is still in linear space and hence one will see the color-map not line up as expected between the opacity widget and the color widget.
(0031369)
Utkarsh Ayachit (administrator)
2013-07-30 10:55

SUMMARY
---------------------------------------------
Topics merged into master:
(VTK) 13082_fix_log_lut
        14190_pythonprogrammablefilter_pass_request
        14191_particle_streaming


---------------------------------------------
(0031417)
Alan Scott (manager)
2013-08-09 19:23

Yep, that fixed it. Sweet!

Tested Linux, master, remote server.

 Issue History
Date Modified Username Field Change
2012-04-10 20:18 Alan Scott New Issue
2012-06-14 18:07 Alan Scott Priority normal => high
2012-06-14 18:07 Alan Scott Note Added: 0028697
2012-06-14 18:29 Utkarsh Ayachit Assigned To => Utkarsh Ayachit
2012-06-14 18:29 Utkarsh Ayachit Status backlog => todo
2012-06-14 18:29 Utkarsh Ayachit Assigned To Utkarsh Ayachit =>
2012-06-14 18:29 Utkarsh Ayachit Target Version => 4.0
2012-08-13 17:41 Alan Scott Note Added: 0028997
2012-08-13 18:43 Alan Scott File Added: screenshot.png
2012-08-13 18:44 Alan Scott Note Added: 0028998
2012-08-14 09:27 Utkarsh Ayachit Assigned To => Kyle Lutz
2012-10-26 14:46 Sebastien Jourdain Status todo => active development
2012-10-26 14:46 Sebastien Jourdain Assigned To Kyle Lutz => Sebastien Jourdain
2012-10-26 15:16 Sebastien Jourdain Topic Name => 13082_log_scaling_issue
2012-10-26 15:16 Sebastien Jourdain Note Added: 0029530
2012-10-26 15:16 Sebastien Jourdain Status active development => gatekeeper review
2012-10-26 15:16 Sebastien Jourdain Resolution open => fixed
2012-10-29 10:50 Utkarsh Ayachit Fixed in Version => git-master
2012-10-29 10:50 Utkarsh Ayachit Status gatekeeper review => customer review
2012-10-29 10:50 Utkarsh Ayachit Note Added: 0029545
2012-10-29 16:48 Alan Scott Assigned To Sebastien Jourdain => Alan Scott
2012-10-29 16:51 Alan Scott Note Added: 0029581
2012-10-29 16:51 Alan Scott Assigned To Alan Scott => Sebastien Jourdain
2012-10-29 16:51 Alan Scott Status customer review => todo
2012-10-29 17:04 Utkarsh Ayachit Fixed in Version git-master => 3.98.0
2012-10-30 10:37 Sebastien Jourdain Note Added: 0029594
2013-07-08 14:58 Utkarsh Ayachit Assigned To Sebastien Jourdain => Utkarsh Ayachit
2013-07-08 14:58 Utkarsh Ayachit Status todo => active development
2013-07-26 12:39 Utkarsh Ayachit Tag Attached: ColorMap
2013-07-26 16:13 Utkarsh Ayachit Topic Name 13082_log_scaling_issue => 13082_fix_log_lut
2013-07-26 16:13 Utkarsh Ayachit Note Added: 0031345
2013-07-26 16:13 Utkarsh Ayachit Status active development => gatekeeper review
2013-07-26 16:13 Utkarsh Ayachit Fixed in Version 3.98.0 => git-next
2013-07-30 10:54 Utkarsh Ayachit Fixed in Version git-next => git-master
2013-07-30 10:55 Utkarsh Ayachit Status gatekeeper review => customer review
2013-07-30 10:55 Utkarsh Ayachit Note Added: 0031369
2013-08-09 19:23 Alan Scott Note Added: 0031417
2013-08-09 19:23 Alan Scott Status customer review => closed
2013-11-01 13:18 Utkarsh Ayachit Fixed in Version git-master => 4.1


Copyright © 2000 - 2018 MantisBT Team