[vtkusers] Is it possible to create a standalone vtkImage in vtk6 ?

Nigel Mcfarlane Nigel.Mcfarlane at beds.ac.uk
Tue Mar 3 07:16:28 EST 2015


Dear mailing list,

I am updating a colleague's code to compile with vtk6.  It contains the following lines from vtk4/5, where the programmer is creating a vtkStructuredPoints.  The code is not embedded in a vtk filter.  I have indicated the lines which do not compile.

std::cout << "Generating seg volume\n";
vtkStructuredPoints * vol = vtkStructuredPoints::New();
vol->SetDimensions(dim3d);
vol->SetExtent(0, dim3d[0] - 1, 0, dim3d[1] - 1, 0, dim3d[2] - 1);
vol->SetSpacing(spacing[0], spacing[1], spacing[2]);
vol->SetOrigin(0, 0, 0);
vol->SetNumberOfScalarComponents(1); // ERROR
vol->SetScalarTypeToUnsignedChar(); // ERROR
vol->AllocateScalars(); // ERROR
vol->GetPointData()->GetScalars()->FillComponent(0,DrEyeLabels::LABEL_NONE);

I know that SetNumberOfScalarComponents() and SetScalarTypeToUnsignedChar() have been replaced in vtk6 with SetPointDataActiveScalarInfo(), but this method requires a vtkInformation object, and is static, so I can't see any way to use this outside of a RequestInformation() method in a filter.  Is it possible any longer to create a standalone vtkImage, or is this class now just a shell which can only be configured by a pipeline request?

Thank you
Nigel McFarlane
University of Bedfordshire, UK


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150303/3eba0a9d/attachment.html>


More information about the vtkusers mailing list