Dear Xiaofeng,<br>If you want to break the pipeline, you&#39;d better create a _shallow_, not deep copy of the output. It prevents from creating a new physical copy of the image.<br>Snippet:<br>//...<br>dicomReader-&gt;Update();<br>


vtkImageData* output = vtkImageData::New();<br>output-&gt;ShallowCopy(dicomReader-&gt;GetOutput() );<br>dicomReader-&gt;Delete();<br>//...<br><br>Dear Prashanth,<br>Functions Register() and Unregister() are intended to object internal use, if you don&#39;t have to, don&#39;t use them.<br>


<br>Regards,<br>Pawel~<font color="#006600"><font size="4"><font face="garamond,serif"><br clear="all"></font></font></font>_________________<br>Paweł~~Łubniewski<br>__________________________________________________________________________<br>


<br><br><div class="gmail_quote">2010/3/21 Prashanth Udupa <span dir="ltr">&lt;<a href="mailto:prashanth.udupa@gmail.com" target="_blank">prashanth.udupa@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


You could also do this..<br>
<br>
vtkDICOMImageReader* reader = vtkDICOMImageReader::New();<br>
reader-&gt;...<br>
<div>reader-&gt;Update();<br>
<br>
vtkImageData* image = reader-&gt;GetOutput();<br>
</div>image-&gt;Register();<br>
<br>
reader-&gt;Delete();<br>
<br>
This way image will exist even after the reader is deleted...<br>
<br>
/ Prashanth<br>
<br>
2010/3/21 Xiaofeng Z &lt;<a href="mailto:xf10036@hotmail.com" target="_blank">xf10036@hotmail.com</a>&gt;:<br>
<div><div></div><div>&gt; Thanks for your reply.  I also found out that if I first create a<br>
&gt; vtkImageData object and pass it into vtkDICOMImageReader for it to use as<br>
&gt; output, the vtkImageData object will retain itself when vtkDICOMImageReader<br>
&gt; is deleted:<br>
&gt;<br>
&gt; vtkImageData* image = vtkImageData::New();<br>
&gt; reader.SetOutput(image);<br>
&gt; ...<br>
&gt;<br>
&gt; Is this a safe way to do?<br>
&gt;<br>
&gt; Thanks!<br>
&gt;<br>
&gt; Xiaofeng<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; ________________________________<br>
&gt; Date: Sun, 21 Mar 2010 13:11:50 +0900<br>
&gt; Subject: Re: [vtkusers] How to extract vtkImageData from vtkDICOMImageReader<br>
&gt; From: <a href="mailto:wangjunchen@gmail.com" target="_blank">wangjunchen@gmail.com</a><br>
&gt; To: <a href="mailto:xf10036@hotmail.com" target="_blank">xf10036@hotmail.com</a>; <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br>
&gt;<br>
&gt; because when you delete the reader, the imagedate(reader-&gt;GetOutput()) has a<br>
&gt; reference count 0 , so it is also recycled.<br>
&gt; if you want to pertain the output of the reader, you can do either:<br>
&gt; 1. connect the output to the vtk pipeline<br>
&gt; or<br>
&gt; 2.  vtkImageData * img = vtkImageData::New();<br>
&gt;     img-&gt;DeepCopy(reader-&gt;GetOutput());<br>
&gt;     reader-&gt;Delete();<br>
&gt;     // then you can access to the img...<br>
&gt;<br>
&gt; 2010/3/21 Xiaofeng Z &lt;<a href="mailto:xf10036@hotmail.com" target="_blank">xf10036@hotmail.com</a>&gt;<br>
&gt;<br>
&gt; Hello,<br>
&gt;<br>
&gt; I use vtkDICOMImageReader to load a CT series:<br>
&gt;<br>
&gt; vtkDICOMImageReader* reader = vtkDICOMImageReader::New();<br>
&gt; reader.SetDirectoryName(&quot;...&quot;);<br>
&gt; reader-&gt;Update();<br>
&gt; vtkImageData* image = reader-&gt;GetOutput();<br>
&gt;<br>
&gt; I was able to load the CT series without issue.  The problem is as soon as I<br>
&gt; call reader::Delete(), the data in &quot;image&quot; appeared to be wiped out.  Is<br>
&gt; there anyway to retain the vtkImageData object without having to keep the<br>
&gt; vtkDICOMImageReader object?<br>
&gt;<br>
&gt; Thanks!<br>
&gt;<br>
&gt; Xiaofeng Zhao<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; ________________________________<br>
&gt; Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.<br>
&gt; Learn More.<br>
&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; 人生就像一个刷牙缸,你可以认为它是杯具,也可以认为它是洗具<br>
&gt;<br>
&gt; ________________________________<br>
&gt; Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.<br>
&gt; Learn More.<br>
&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
--<br>
</div></div>Thanks and Warm Regards,<br>
Prashanth N Udupa<br>
<font color="#888888"><br>
<a href="mailto:prashanth.udupa@gmail.com" target="_blank">prashanth.udupa@gmail.com</a><br>
<a href="http://www.prashanthudupa.com" target="_blank">http://www.prashanthudupa.com</a><br>
<a href="http://prashanthudupa.livejournal.com/" target="_blank">http://prashanthudupa.livejournal.com/</a><br>
</font><div><div></div><div>_______________________________________________<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>