[vtkusers] add color to marchingcube

Bill Lorensen bill.lorensen at gmail.com
Thu Nov 28 13:26:16 EST 2013


#include "vtkPointData.h"


On Thu, Nov 28, 2013 at 11:17 AM, Susanne Schmalkalt
<Susanne.Schmalkalt at gmx.de> wrote:
> Hello all,
>
> I want to add specific color to part of the surface of a volume data. For
> that I first use vtkExtractVOI to get the part I want, then get the surface
> by calling vtkMarchingCubes. Now, if I try then to addScalars to its Output
> I can't.
>
> Here is the code:
>
> Instantiate(colors,vtkUnsignedCharArray); ...
> Instantiate(colorLookupTable, vtkLookupTable); ...
>
>     Instantiate(brainsection, vtkExtractVOI);
>     brainsection->SetInput(imageData);
>     brainsection->SetVOI(minIJK[0],maxIJK[0],minIJK[1],maxIJK[1],
> minIJK[2],maxIJK[2]);
>     brainsection->Update();
>
>     Instantiate( brainsectionMC, vtkMarchingCubes );
>     brainsectionMC->SetValue(0,1);
>     brainsectionMC->SetInput( brainsection->GetOutput() );
>     brainsectionMC->Update();
>
>     Instantiate(brainsectionLocator, vtkPointLocator);
>     brainsectionLocator->SetDataSet(brainsectionMC->GetOutput());
>     brainsectionLocator->BuildLocator();
>
>     brainsectionMC->GetOutput()->GetPointData(); // And here I would like to
> call ->SetScalars(colors); but I get the error:
>  "error C2027: use of undefined type 'vtkPointData'". But even I copy this
> pointData to some new Instance of vtkPointData I get the same error.
>
> Does anyone know why or how I should do this?
> Thanks,
> Susi
>
>
>
> _______________________________________________
> 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
>



-- 
Unpaid intern in BillsBasement at noware dot com


More information about the vtkusers mailing list