<div dir="ltr"><div><div><div><div><div>    Hi everybody,<br><br></div>I am trying to use  vtkDiscretizedColorTransferFunction in order to assign predefined colors to a variable number of fixed values.<br></div>With the settings specified in the code below, the table works fine as soon as the values are contiguous, e.g., 3->4->5->6->7->8. But if I provide a list of non-contiguous ids, such as 3->5->6->7->8, the table apparently shifts the colors.<br></div>Can  anybody help me understand what I  am missing?<br></div>Thanks for any help<br><br></div>        Luca<br><div><div><div><br>Here is my code:<br><div><div><div><div><div><br></div><div>// This is an example<br></div><div>std::vetor<uint32> listIds = {3, 5, 6, 7, 8};<br></div><div>table = vtkSmartPointer<vtkDiscretizableColorTransferFunction>::New();<br>    table->DiscretizeOn();<br>    table->IndexedLookupOff();<br><br>    table->SetNumberOfValues(listIds.size());<br>    foreach (uint32 id, listaIds) {<br><br>        QColor color(myFunctionTogetColorsFromIds(id))  <br>        double r = color.redF();<br>        double g = color.greenF();<br>        double b = color.blueF();<br>        table->AddRGBPoint(static_cast<double>(id), r, g, b);<br>    }<br>    table->Build();<br>    <br></div></div></div></div></div></div></div></div></div>