[vtkusers] vtkImageData

Stefan Huber Huber.Ste at gmx.at
Mon Apr 7 09:49:56 EDT 2008


Hi,

i have an Array with pointdata and i want to generate imagadata to use vtk. How can i do it? Can you give me an example, how i can create an imagadataobject? my code doesn't work.

my code:

vtkImageData *img = vtkImageData::New();
img->AllocateScalars();
img->SetScalarTypeToInt();

vtkCellArray * scalars = vtkCellArray::New();
for(int i= 0; i< size; i++){
  scalars->InsertNextCell(dat[i]);
}
img->GetPointData()->SetScalars(scalars);
img->GetPointData()->CopyAllOn();
img->Update();
img->UpdateData();

thanx,
Stefan
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer



More information about the vtkusers mailing list