[Insight-users] not use smart pointer

Pan Ross rosspan2004 at yahoo.com.cn
Mon Jan 3 19:47:04 EST 2005


Dear Sir,
    I want to declare a pointer in one function and use it in another function. Smart Pointer cannot work. But VTK   ImageReaderType * reader = new ImageReaderType(); can work.
 How should I do?
 
 ImageReaderType::Pointer reader = ImageReaderType::New();
  reader->SetFileName(strdup(lpszPathName));
  //Connect ITK -> VTK
  ItkImageToVtkImageType::Pointer bridge = ItkImageToVtkImageType::New();
  bridge->SetInput( reader->GetOutput() );
  CEntity * pEnt = new CEntity();
  pEnt->SetPointer(bridge->GetOutput());
 
Thanks.



---------------------------------
Do You Yahoo!?
150万曲MP3疯狂搜,带您闯入音乐殿堂
美女明星应有尽有,搜遍美图、艳图和酷图
1G就是1000兆,雅虎电邮自助扩容!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050104/3e6ab83d/attachment.html


More information about the Insight-users mailing list