[vtkusers] Problem in using vtkLookupTable with vtkContourFilter

Biddiscombe, John A. biddisco at cscs.ch
Wed Nov 9 13:46:37 EST 2011


I think you meant SetTableRange, not SetValueRange (which is the V in HSV)

JB

-----Original Message-----
From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Jothybasu Selvaraj
Sent: 09 November 2011 17:49
To: VTK Mailing List
Subject: [vtkusers] Problem in using vtkLookupTable with vtkContourFilter

Hi all,

I am trying to use my own lookup table with vtkContourFilter, so that
it can generate contour line of my own colors.

But some of the lines are of the same color!

Here is my code

 vtkSmartPointer<vtkLookupTable> isoLineTable =
                    vtkSmartPointer<vtkLookupTable>::New();
            double
scalarMin=*std::min_element(isodoseValues.begin(),isodoseValues.end());
            double
scalarMax=*std::max_element(isodoseValues.begin(),isodoseValues.end());
            isoLineTable->SetValueRange(scalarMin,scalarMax);
            qDebug()<<scalarMin<<scalarMax;
            isoLineTable->SetNumberOfTableValues(isodoseValues.size());
           // isoLineTable->SetRampToLinear();
            isoLineTable->Build();

             for(int i=0;i<isodoseValues.size();i++)
             {
                 //qDebug()<<colorsR[i]<<colorsG[i]<<colorsB[i];

isoLineTable->SetTableValue(i,colorsR[i],colorsG[i],colorsB[i]);

             }


            vtkSmartPointer<vtkPolyDataMapper> contourMapper =
                    vtkSmartPointer<vtkPolyDataMapper>::New();
            contourMapper->SetInputConnection(cf->GetOutputPort());
            contourMapper->SetScalarRange(isoLineTable->GetRange());
            contourMapper->SetLookupTable(isoLineTable);
            contourMapper->Update();

Any suggestions?

Thanks

Jothy

-- 
Jothy
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list