Scalar field

Feel free to ask any question here
Ingsayyad
Posts: 97
Joined: Fri Oct 25, 2013 9:17 am

Scalar field

Post by Ingsayyad »

I want to fix the no of labels of scalar field e.g., 4. How can I do it.Please see attached figure.
I have marked place where values should appear. Max. and min. is controlled by CC. But I donot want to label 17 place but only (steps+1 =3+1=4).
Attachments
CCAsk_.JPG
CCAsk_.JPG (50.25 KiB) Viewed 12913 times
Last edited by Ingsayyad on Wed Oct 30, 2013 12:05 pm, edited 3 times in total.
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Scalar field

Post by daniel »

You can set the number of steps of the current displayed color scale in the scalar field 'properties'.

Just click on the entity, scroll down its properties list (bottom-left part of the application window) and find the 'Steps' spinbox in the 'Color scale' part.
Daniel, CloudCompare admin
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Scalar field

Post by daniel »

Oh so you want to set the number of labels of the color ramp? This is clearly not easy...

If you use a 'relative' color scale (the default behavior in CC) CC will simply take the min and max values of the enabled scalar field and it will then display labels in between as long as it has enough screen space available (in a recursive manner). So in this mode the only way to act on this is to change... the screen size and the labels font size (not very handy in your case).

But you can also define your own 'absolute' color scale (see the Color Scales Manager - in the "Edit > Scalar Fields" menu - start by making a 'copy' of the default color scale then change it's 'Mode' to 'absolute'). With an absolute color scale, you can manually define the values of its different steps. CloudCompare will always try to display the min and max values of the enabled scalar field, but it will also display the labels corresponding to the min and max steps of your absolute color scale (so if you are lucky, it can give you a better sampling scheme of labels).

But I guess it will not be sufficient in your case, so if you really don't want the min/max labels to interfere, another 'hack' is to load a fake cloud with only two points and two values (e.g. 0 and 1) and then display this fake cloud's color scale instead of the true cloud's. The color scale will appear even if the fake cloud is 'hidden' (and if no other color scale is displayed). You can also play on the labels font size (in the 'Display properties') to get fewer labels...
Daniel, CloudCompare admin
Ingsayyad
Posts: 97
Joined: Fri Oct 25, 2013 9:17 am

Re: Scalar field

Post by Ingsayyad »

Thanx for your reply. I can't figure out where can I fix labels=steps+1.
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Scalar field

Post by daniel »

You can't ;)

You can just increase the font size (and decrease the window size) so that fewer labels will appear... (but only 4 will be hard).

We can add such a feature to the TODO list however (just need to find someone willing to develop it ;).
Daniel, CloudCompare admin
Ingsayyad
Posts: 97
Joined: Fri Oct 25, 2013 9:17 am

Re: Scalar field

Post by Ingsayyad »

thanx.
npettijohn
Posts: 7
Joined: Sat Feb 15, 2014 12:54 pm

Re: Scalar field display parameters

Post by npettijohn »

the color ramp display is not adjusting when I change the scalar field display parameters "displayed" range. When I reduce the displayed range, the color ramp maintains the larger range and grays out the values beyond the smaller displayed range values that I input. Therefore the color scale steps are not defined/identified with individual numerical values in the color ramp....instead they are all lumped within a large range of +-0.2000.
color scale ramp
color scale ramp
color scale ramp question.jpg (251.5 KiB) Viewed 12796 times
npettijohn
Posts: 7
Joined: Sat Feb 15, 2014 12:54 pm

Re: Scalar field

Post by npettijohn »

OK....figured out I needed to uncheck box under Parameters tab "show NaN/out of range values in grey"
npettijohn
Posts: 7
Joined: Sat Feb 15, 2014 12:54 pm

Color Scale Editor Step Values vs Color Ramp Step Values

Post by npettijohn »

I'm trying to figure out the relationship between the step values defined in the COLOR SCALE EDITOR and the steps of the resulting COLOR RAMP. I'm using absolute mode in Color Scale Editor. The steps in the Color Scale Editor are defined as follows:

Purple: -0.3
blue: -0.2
dark aqua: -0.15
sky blue: -0.1
light green: -0.07

green: 0.07
yellow: 0.1
orange: 0.15
red: 0.2
pink: 0.3

Below is a screen shot of the resulting color ramp. It appears that the outer value limits of the green and light green steps on the Color Ramp reflect the Color Scale Editor settings of 0.07 and -0.07 respectively. For the rest of the steps, the color ramp appears to place the defined value of the step in the middle of each color segment on the Color Ramp. For instance Orange is set to 0.15 in the Color Scale Editor and on the Color Ramp, 0.150 falls in the middle of the orange color segment. This results in definitions for each color that are not definite. In other words, what are the value extents of the color Orange? At what values does orange begin and end?
color scale editor vs color ramp steps
color scale editor vs color ramp steps
SCREEN SHOT COLOR SCALE EDITOR & COLOR RAMP STEP VALUE COMPARE.png (116.38 KiB) Viewed 12779 times
Below is a screen shot of the type of color definition I am trying to create in the Color Ramp. Any help on how to achieve this would be apprecieated. Thank you.
DESIRED COLOR RAMP STEPS
DESIRED COLOR RAMP STEPS
DESIRED COLOR RAMP 20140225.png (75.64 KiB) Viewed 12779 times
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Scalar field

Post by daniel »

In fact the 'steps' you define in the Color Ramp Editor dialog and the 'color steps' you define in the cloud properties are two separate concepts:
- the ramp is defined by several 'steps' (we could call them keypoints instead) between which a linear gradient is automatically computed
- then before displaying the points on screen you must define how many different (R,G,B) colors will be used (256 by default, but potentially more or less). So in this case the 'steps' are just a number of colors that will be regularly sampled on the whole color ramp interval. This is why the labels seem in your case to be arbitrarily placed relatively to the colors.

To make it short, you can't use the "color ramp steps" parameter to achieve what you are trying to do. You'll have to cope one way or another with the fact that a linear gradient is automatically computed between each 'steps'. The easiest way is to create 'fake' steps very close to each other (i.e. a pink step at 0.2 and a red step at 0.200001). For this it's better to 'prepare' the step with the right color somewhere in between and then "paste" its final position - e.g. 0.200001 - in the value field (otherwise the steps will be so close that you won't be able to differentiate them).
Daniel, CloudCompare admin
Post Reply