[vtkusers] copy vtk image

John Drescher drescherjm at gmail.com
Sat Sep 22 12:01:52 EDT 2012


> Thanks for your reply.First of all I would like to explain my problem.I have
> written .mhd rgb file  in .vtk format using itk. I'm now able to open rgb
> image.Now I want get a copy of it.I used deep copy. My codes are as follows.
>
> #include <vtkPolyData.h>
> #include <vtkSmartPointer.h>
> int main(unsigned int argc,  char *argv[])
> {
>
> vtkSmartPointer<vtkPolyData> polyData = vtkSmartPointer<vtkPolyData>::New();
>    vtkSmartPointer<vtkPolyData> polyDataCopy =
> vtkSmartPointer<vtkPolyData>::New();
>    polyDataCopy->DeepCopy ( "D:\\rgbabdomen\\Debug\\output.vtk" );
>
> return 0;
> }
> My program is built with zero errors.But unable to open it.Do I have to
> include visualization par.I am very much thankful to you if you can help me.
>

Deep copy does not copy a file it copies a vtk image in memory. What
exactly are you trying to do? To me it looks like you want to open a
vtk file in one format and save it in a different format. There should
be examples in the wiki that do that. Also ITK has examples that do
that.

John



More information about the vtkusers mailing list