[vtkusers] MarchingCubes pointer to incomplete class type is not allowed

Zou Jing zjinger at hotmail.com
Tue Nov 28 09:05:18 EST 2017


Dear all,

I want to convert 3D DICOM or NIFTI image to points cloud (.stl) using vtkMarchingCubes.

But there is always the error that 'pointer to incomplete class type is not allowed'  when I deepcopy volume from reader(show in boldface in following code).

I am using  vtk 8.0.1. And I am a novice.

I am looking forward to your answer.

Thank you very much.



There is the code :
vtkSmartPointer<vtkNIFTIImageReader> reader1 = vtkSmartPointer<vtkNIFTIImageReader>::New();
       reader1->SetFileName("C:/Users/studentx/Desktop/lung/test/case1-00.nii");

       reader1->Update();
vtkSmartPointer<vtkImageData> volume =

              vtkSmartPointer<vtkImageData>::New();
vtkSmartPointer<vtkMarchingCubes> surface =

              vtkSmartPointer<vtkMarchingCubes>::New();

volume->DeepCopy(reader1->GetOutput());
#if VTK_MAJOR_VERSION <= 5
       surface->SetInput(volume);
#else
       surface->SetInputData(volume);
#endif
       surface->ComputeNormalsOn();
       surface->SetValue(0,0.5);

       vtkSmartPointer<vtkPolyData> moving = vtkSmartPointer <vtkPolyData>::New();
       moving->surface->GetOutput();

       //write polydata
       vtkSmartPointer<vtkPolyDataWriter> writer0 = vtkSmartPointer<vtkPolyDataWriter>::New();
       writer0->SetFileName("C:/Users/studentx/Desktop/lung/test/case1orgin.stl");
       writer0->SetInputData(moving);

       writer0->Write();







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


More information about the vtkusers mailing list