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

Cory Quammen cory.quammen at kitware.com
Tue Nov 28 09:51:18 EST 2017


Make sure you are including the header files that define the classes
you are using, e.g.

#include <vtkNIFTIImageReader.h>
#include <vtkImageData.h>
#include <vtkMarchingCubes.h>

- Cory


On Tue, Nov 28, 2017 at 9:05 AM, Zou Jing <zjinger at hotmail.com> wrote:
> 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();
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>



-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.


More information about the vtkusers mailing list