Oops... it seems that I understand now some weird "bad extent"
happening... I will keep this thread bookmarked, since it teaches a lot
about VTK pipelining!<br>
<br>
This made me look at the documentation of ShallowCopy/DeepCopy. Finally, I found this class:<br>
<a href="http://www.vtk.org/doc/nightly/html/classvtkCell.html#a573202e8c9c3b5367b35fe7ad3fdfb43">http://www.vtk.org/doc/nightly/html/classvtkCell.html#a573202e8c9c3b5367b35fe7ad3fdfb43</a><br>
<br>
where it is said that ShallowCopy is for read-only copy... Is the code snippet right? ShallowCopying the output of the internal filter should then produce a read-only output for the main filter!<br><br>Do I mistake if I rather propose:<br>

inputCopy-&gt;ShallowCopy(input);<br>
blend-&gt;AddInput(inputCopy);<br>
blend-&gt;Update();<br>
output-&gt;DeepCopy(blend-&gt;GetOutput());<br><br>Jerome<br><br><div class="gmail_quote">2009/12/15 Michael Jackson <span dir="ltr">&lt;<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><br>
<br>
On Dec 15, 2009, at 11:53 AM, Bill Lorensen wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
After seeing Berk&#39;s reply it looks as though his<br>
vtkImageData* inputCopy = input-&gt;NewInstance();<br>
inputCopy-&gt;ShallowCopy(input);<br>
blend-&gt;AddInput(inputCopy);<br>
blend-&gt;Update();<br>
output-&gt;ShallowCopy(blend-&gt;GetOutput());<br>
<br>
would be:<br>
<br>
blend-&gt;AddInput(input);<br>
blend-&gt;Update()<br>
this-&gt;GraftOutput(blend-&gt;GetOutput());<br>
</blockquote>
<br></div>
Bill,<br>
  As, Berk explained, you _really_ need to have a shallow copy to decouple the internal and external pipelines. If this is not done the all sorts of &quot;Bad&quot; will happen.<br>
<br>
 Maybe what is needed is this:<br>
<br>
/* Get a Shallow copy from the input */<br>
vtkImageData* inputCopy = input-&gt;NewShallowCopyInstance();<div class="im"><br>
blend-&gt;AddInput(inputCopy);<br>
blend-&gt;Update();<br>
output-&gt;ShallowCopy(blend-&gt;GetOutput());<br></div>
/* Don&#39;t Forget to memory clean up somewhere.*/<br>
<br>
_________________________________________________________<br>
Mike Jackson                  <a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software                    <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
Principal Software Engineer                  Dayton, Ohio<div><div></div><div class="h5"><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br>