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

Cory Quammen cory.quammen at kitware.com
Tue Nov 28 19:58:10 EST 2017


On Tue, Nov 28, 2017 at 7:57 PM, Zou Jing <zjinger at hotmail.com> wrote:
> Thanks a lot.
> I forgot #include <vtkImageData.h>
> Best regards.
> Jing

You're welcome :-)

Cory

>
> -----Original Message-----
> From: Cory Quammen [mailto:cory.quammen at kitware.com]
> Sent: Tuesday, November 28, 2017 10:51 PM
> To: Zou Jing <zjinger at hotmail.com>
> Cc: vtkusers at vtk.org
> Subject: Re: [vtkusers] MarchingCubes pointer to incomplete class type is not allowed
>
> 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->");
>>
>>        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.s
>> writer0->tl");
>>
>>        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.



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


More information about the vtkusers mailing list