<DIV><PRE>Tom,</PRE><PRE>I would first make sure the vtkImageData instance created/recreated in func() is updated with the right data.  Usually, I insert an &lt;vtkImageData instance&gt;-&gt;Update() function while debugging to ensure the availability of the data in the pipeline at that point.  If there is any problem in having the data right (this could be possibly because this instance might be an output of an intermediate filter), the program will throw an exception right at the Update();</PRE><PRE>Usually, if the data is intact, copy won't have any problem.  To validate, you can create a dummy vtkImageData instance just before you copy and try your code.</PRE><PRE>Madhu.</PRE><PRE>=======================================================</PRE><PRE>&gt;<I>Try ShallowCopy(); it works for me.
</I>
No luck, unfortunately. I get the same crash, but I suspect that if it
did copy the PointData that I need it to, it would crash later on when
I tried to use the data from the first call to 'func'. I mentioned (but
forgot to spell out in the psuedo-code, oops) that I would be calling
the function twice, more like:

vtkDataSet *my_data[2];
my_data[0] = vtkDataSet::New();
my_data[1] = vtkDataSet::New();

my_data[0]-&gt;DeepCopy(this-&gt;func());
my_data[1]-&gt;DeepCopy(this-&gt;func());

than what I had originally given in psuedo code. Sorry.

Since this-&gt;func() will modify the 'Data' pointer (this was probably
unclear in my original post; func() will Delete() Data and create a New()
dataset), it is necessary to do a complete copy of the data returned
from the initial func() call.

Thank you, though. Responses / ideas are always welcome -- if I'm
mailing here I'm at the end of my rope =). Well, I suppose I could
always just rewrite this "func"tionality (har, har) to not rely on
DeepCopy()...

-tom

&gt;<I>Madhu.
</I>&gt;<I>
</I>&gt;<I>I have a function which returns a vtkDataSet*, but subsequent calls
</I>&gt;<I>will make the pointer returned in earlier calls invalid, so I want to
</I>&gt;<I>copy the output of the function into my own vtkDataSet. I figured
</I>&gt;<I>DeepCopy would do what I want, but it doesn't seem to copy (at least)
</I>&gt;<I>the vector data from the point data of the source dataset.
</I>&gt;<I>
</I>&gt;<I>To spell it out better:
</I>&gt;<I>
</I>&gt;<I>vtkDataSet* MyObj::func()
</I>&gt;<I>{
</I>&gt;<I>        this-&amp;gt;Data = some_filter-&amp;gt;GetOutput();
</I>&gt;<I>        return this-&amp;gt;Data; //Data is a vtkDataSet*
</I>&gt;<I>}
</I>&gt;<I>
</I>&gt;<I>void MyObj::SomeOtherFunc()
</I>&gt;<I>{
</I>&gt;<I>        vtkDataSet *my_data = vtkDataSet::New();
</I>&gt;<I>
</I>&gt;<I>        my_data-&amp;gt;DeepCopy(this-&amp;gt;func());
</I>&gt;<I>
</I>&gt;<I>        /*** CRASH HERE ***/
</I>&gt;<I>        my_data-&amp;gt;GetPointData()-&amp;gt;GetVectors();
</I>&gt;<I>        /*** CRASH HERE ***/
</I>&gt;<I>}
</I>&gt;<I>
</I>&gt;<I>Psuedo-ish code, of course. Running through gdb, it seems that
</I>&gt;<I>GetPointData() returns a valid pointer, but when I try to GetVectors()
</I>&gt;<I>from the pointer returned by GetPointData(), i get a segmentation
</I>&gt;<I>fault.
</I>&gt;<I>
</I>&gt;<I>So it looks to me as if the vector data isn't being copied. Is this
</I>&gt;<I>normal behavior? How / what should I set to enable a complete copy of
</I>&gt;<I>the vtkDataSet and all of the data it holds?
</I>&gt;<I>
</I>&gt;<I>Thanks,
</I>&gt;<I>
</I>&gt;<I>-tom
</I></PRE><!--endarticle--></DIV><p>
                <hr size=1>Do you Yahoo!?<br>
<a href="http://us.rd.yahoo.com/mail_us/taglines/aac/*http://promotions.yahoo.com/new_mail/static/ease.html">Yahoo! Mail Address AutoComplete</a> - You start. We finish.