because when you delete the reader, the imagedate(reader->GetOutput()) has a reference count 0 , so it is also recycled. <br>if you want to pertain the output of the reader, you can do either:<br>1. connect the output to the vtk pipeline<br>
or <br>2. vtkImageData * img = vtkImageData::New();<br> img->DeepCopy(reader->GetOutput());<br> reader->Delete();<br> // then you can access to the img...<br><br>
<div class="gmail_quote">2010/3/21 Xiaofeng Z <span dir="ltr"><<a href="mailto:xf10036@hotmail.com">xf10036@hotmail.com</a>></span><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>Hello,<br><br>I use vtkDICOMImageReader to load a CT series:<br><br>vtkDICOMImageReader* reader = vtkDICOMImageReader::New();<br>reader.SetDirectoryName("...");<br>reader->Update();<br>vtkImageData* image = reader->GetOutput();<br>
<br>I was able to load the CT series without issue. The problem is as soon as I call reader::Delete(), the data in "image" appeared to be wiped out. Is there anyway to retain the vtkImageData object without having to keep the vtkDICOMImageReader object?<br>
<br>Thanks!<br><br>Xiaofeng Zhao<br>
<div class="hm"><a href="http://www.xzing.org/" target="_blank"></a><br><br><br>
<hr>
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. <a href="http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_1" target="_blank">Learn More.</a></div>
</div><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>
<br></blockquote></div><br><br clear="all"><br>-- <br>人生就像一个刷牙缸,你可以认为它是杯具,也可以认为它是洗具<br>