[vtkusers] Iterating through a vtkImageData

David Doria daviddoria+vtk at gmail.com
Sun Nov 1 16:12:32 EST 2009


I found vtkImageIterator, but from looking at the Test, I saw something like:

  int ext[3] = { 0, 0, 0};
  vtkImageData *id = vtkImageData::New();
  id->SetExtent(ext);
  vtkImageIterator<float*> *it = new vtkImageIterator<float*>(id,ext);

When I try that, I get:
undefined reference to
`vtkImageIterator<float*>::vtkImageIterator(vtkImageData*, int*)'

If I try to use the "vtk style" object creation:
vtkSmartPointer<vtkImageIterator<float*> > iterator =
vtkSmartPointer<vtkImageIterator<float*> >::New();

I get:
'New' is not a member of 'vtkImageIterator<float*>'

What I am trying to do is simply visit every voxel of a 3d
vtkImageData. It would also be nice to access a particular voxel in an
(x,y,z) type format. Can anyone comment on how to do either of these
things?

Thanks,

David



More information about the vtkusers mailing list