[Insight-users] problems using ImageToVTKImageFilter

Carmen Olmos carmen_olm at yahoo.es
Fri Oct 1 08:47:08 EDT 2004


Hi,

I'm trying unsuccessfully to plot a slice of a volume. I read properly the image but I get nothing at the connector output. Maybe somebody can help


 

Thank you,

Carmen

 

typedef unsigned char myPixelType;

typedef itk::Image< myPixelType, 3 > ImageType;

typedef itk::ImageFileReader< ImageType > ReaderType;

typedef itk::ImageToVTKImageFilter< ImageType > ConnectorFilterType;

ReaderType::Pointer reader = ReaderType::New();

ConnectorFilterType::Pointer connector = ConnectorFilterType::New();

reader->SetFileName( "liver323seg.hdr" );

reader->Update();

reader->GetOutput()->Print(std::cout);

connector->SetInput( reader->GetOutput() );

connector->Update();

connector->GetOutput()->Print(std::cout);

vtkImageViewer * viewer =vtkImageViewer::New();

vtkRenderWindowInteractor * renderWindowInteractor = vtkRenderWindowInteractor::New();

viewer->SetupInteractor( renderWindowInteractor );

viewer->SetInput( connector->GetOutput() );

viewer->SetZSlice( 50 ); // <-- Slice selection

renderWindowInteractor->Start();




		
---------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20041001/18d3e26e/attachment.html


More information about the Insight-users mailing list