[vtkusers] vtkImageTracerWidget & vtkBMPWriter

Flo snrf at no-log.org
Thu Aug 30 10:47:33 EDT 2007


Mark:

 From my experience, there is a pointer reference issue.
I overcame it by using a temp vtkImageData to which I ->DeepCopy 
(TracerWidget->GetOutput()).
After that, you just work with the vtkImageData and you'll be fine.

HTH
Flo.

On 29-Aug-07, at 8:56 PM, JohnMark wrote:

> Hello , vtkusers ,
>     I want to extract any regions from a 2D CT slice , so I use the  
> vtkImageTracerWidget . surely , it is perfect , I can clip any  
> regions . but there is the problem coming : I want to save the  
> result with vtkBMPWriter :
>
> vtkImageCast * readerImageCast = vtkImageCast::New();
> // its data from the output of vtkImageStencil
> readerImageCast->SetInput((vtkDataObject *)stencil->GetOutput());
> readerImageCast->SetOutputScalarTypeToUnsignedChar();
> vtkBMPWriter * bmp = vtkBMPWriter::New();
> bmp->SetInput(readerImageCast1->GetOutput());
> bmp->SetFileName("C:/test.bmp");
> bmp->Write(); // problem !!!! it does not work any more !
> bmp->Update();
>
>     however , it does not work , what I got is just a black line  
> ( nothing ) . and then I change my method , I add a KeyReleaseEvent  
> and a AddObserver of vtkRenderWindowInteractor , the render window  
> would capture the message when the key was released and I get the  
> region , then I will save the result , but I still get nothing .
>
>     so what is wrong with my thinking ? and I know the  
> vtkImageTracerWidget class wrap the vtkImageViewer , vtkActor and  
> so on , I can save the result rendering in the vtkImageViewer , but  
> I can do nothing with the result of vtkImageTracerWidget . we can  
> not save the result but just to see it , isn't it ? if it is not ,  
> is there any method or any class to save it ?
>
>     thank you with great regards ! and waiting for your answer !
>
>     Mark
>
>     PS . this is a problem I have been thinking for almost a  
> month , I still get nothing now .
>
>
> 使用新一代 Windows Live Messenger 轻松交流和共享! 立 
> 即体验!
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/ 
> Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list