[vtkusers] vtkColorTransferFunction question

David Gobbi david.gobbi at gmail.com
Sat Apr 9 17:30:26 EDT 2011


I think your best option is to to have two color transfer functions...
one with the exclusion value and one without.

The main CTF would not have the exclusion value.  This is the one that
would be controlled by the user, and would be used to create the
scalar bar.  The second CTF would be created by doing a DeepCopy of
the first CTF and adding the exclusion value... this is the one that
would actually be applied to the data.  You would have to create a
function that does the DeepCopy and makes the modification, and set up
event observers so that it is called when necessary.

 - David


On Fri, Apr 8, 2011 at 6:33 PM, vlibertiaux <vlibertiaux at gmail.com> wrote:
> Hello everyone,
>
> I use a colortransferfunction to be able to set an "out of color bar value"
> for an exclusion value.
>
> My exclusion value is -1 and my actual values range from 0 to 0.5.
>
> I build the colortransferfunction like this:
>
>                color->AddRGBPoint(-1, 0.5,0.5,0.5,1,1);
>                color->AddRGBPoint(smin,0,0,1);
>                color->AddRGBPoint( (smax+smin)/2,0,1,0);
>                color->AddRGBPoint(smax,1,0,0);
>
> so that I have gray values from -1 to smin and my actual colorbar from smin
> to smax.
>
> The problem is that this color bar is linear, so I have a large gray portion
> on my scalarbar.
>
> What can I do to have a non linear scalar bar, i.e. make the -1, smin part
> shorter than the smin, smax part on the bar ?
>
> Thank you very much for your answers !
>
> Best regards,
>
> V.



More information about the vtkusers mailing list