[vtkusers] How to extract vtkImageData from vtkDICOMImageReader

王君臣 wangjunchen at gmail.com
Sun Mar 21 00:11:50 EDT 2010


because when you delete the reader, the imagedate(reader->GetOutput()) has a
reference count 0 , so it is also recycled.
if you want to pertain the output of the reader, you can do either:
1. connect the output to the vtk pipeline
or
2.  vtkImageData * img = vtkImageData::New();
    img->DeepCopy(reader->GetOutput());
    reader->Delete();
    // then you can access to the img...

2010/3/21 Xiaofeng Z <xf10036 at hotmail.com>

> Hello,
>
> I use vtkDICOMImageReader to load a CT series:
>
> vtkDICOMImageReader* reader = vtkDICOMImageReader::New();
> reader.SetDirectoryName("...");
> reader->Update();
> vtkImageData* image = reader->GetOutput();
>
> 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?
>
> Thanks!
>
> Xiaofeng Zhao
>  <http://www.xzing.org/>
>
>
> ------------------------------
> Hotmail has tools for the New Busy. Search, chat and e-mail from your
> inbox. Learn More.<http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_1>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>


-- 
人生就像一个刷牙缸,你可以认为它是杯具,也可以认为它是洗具
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100321/b2ee8b54/attachment.htm>


More information about the vtkusers mailing list