[vtkusers] Fwd: Help for copy of vtkImageData

John Drescher drescherjm at gmail.com
Thu Sep 22 07:53:29 EDT 2011


---------- Forwarded message ----------
From: Rong Xu <xurong1981 at gmail.com>
Date: 2011/9/22
Subject: Re: [vtkusers] Help for copy of vtkImageData
To: John Drescher <drescherjm at gmail.com>


Hi, John :

My code is

// Map the image through the lookup table
    vtkSmartPointer<vtkImageMapToColors> color =
vtkSmartPointer<vtkImageMapToColors>::New();
    color->SetLookupTable(table);
    color->SetInputConnection(reslice->GetOutputPort());

    m_imgDataOnImagePlaneX->DeepCopy(color->GetOutput());

These code are in a class member function, and m_imgDataOnImagePlaneX is a
class member variable. I used vtkImageViewer2 to display the image data from
m_imgDataOnImagePlaneX, but nothing is on the VTK window. However, when I
used vtkImageViewer2 to display the image data from color->GetOutput() in
that class member function, that is ok. I don't know why.



2011/9/22 John Drescher <drescherjm at gmail.com>

> > In my programming, I want to copy a local variable of vtkImageData to a
> global variable of vtkImageData, and I tried shallowcopy and deepcopy, but
> they didn't work. Does anyone have ideas about this problem?
> >
>
> Nope. DeepCopy has always worked for me. Please post a small example
> demonstrating the problem.
>
> John
>



-- 

-----------------------

Best Regards!

=====================================================

Rong Xu,     Ph.D Student
Ohya Lab,   Global Information and Telecommunication Studies (GITS)
Waseda University, Japan (¨“169-0051)

Tel:             +81-80-4208-1207
E-mail:        xurong1981 at gmail.com
                  xurong at fuji.waseda.jp

=====================================================




-- 
John M. Drescher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110922/949fde6e/attachment.htm>


More information about the vtkusers mailing list