[vtkusers] copy vtk image

shirani kannangara mangalika673 at gmail.com
Sat Sep 22 11:54:13 EDT 2012


Dear David
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.

regards
Shirani



On Fri, Sep 21, 2012 at 4:50 PM, David Doria <daviddoria at gmail.com> wrote:

> On Thu, Sep 20, 2012 at 11:46 PM, shirani kannangara <
> mangalika673 at gmail.com> wrote:
>
>> Hi
>> I want to copy vtk image.Please direct me to get that.
>> I will appreciate your help.
>> Shirani
>>
>
> newImage->DeepCopy(oldImage);
>
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/DeepCopy
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120922/c0be8a1e/attachment.htm>


More information about the vtkusers mailing list