[Insight-users] itkVTKtoITKtoVTK modification

Mathieu Lamard Mathieu.Lamard@enst-bretagne.fr
Thu, 02 May 2002 10:23:30 +0200


Thanks Pieter,
  but I want to use a vtkReader and not a itk image reader and that's 
why a try to modify the itkVTKtoITKtoVTK example.
In fact I want to use a vtk for reading images + mouse interaction ... 
ant itk for image filtering.

Mathieu


Pieter Vos wrote:
> Hi,
> 
> Maybe I can help. I think you are forgetting to set up an input/output
> object:
> 
>   //setup in/output
>   itk::PNGImageIO::Pointer io;
>   io = itk::PNGImageIO::New();
> 
>   //Read image
>   itk::ImageFileReader<RGBImageType>::Pointer reader;
>   reader = itk::ImageFileReader<RGBImageType>::New();
>   reader->SetFileName( filename );
>   reader->SetImageIO(io);
> 
> Also use the smartpointer in sted of the clean star.
> You can look in the map /Insight/Testing/Code/IO
> for more examples.
> 
> On Tue, 30 Apr 2002, Mathieu Lamard wrote:
> 
> 
>>Hello,
>>The example itkVTKtoITKtoVTK works fine for me but I want to change
>>
>>
>>vtkImageNoiseSource* source = vtkImageNoiseSource::New();
>>   source->SetWholeExtent(0, 255, 0, 255, 0, 0);
>>   source->SetMinimum(0);
>>   source->SetMaximum(1);
>>
>>by
>>
>>  vtkPNGReader * m_vtkPNGReader = vtkPNGReader::New();
>>   m_vtkPNGReader ->SetFileName( "toto.png" );
>>   m_vtkPNGReader ->Update();
>>
>>   vtkImageLuminance * m_luminance = vtkImageLuminance::New();
>>
>>   m_luminance -> SetInput(m_vtkPNGReader->GetOutput());
>>
>>
>>And then
>>
>>   vtkImageExport* vtkExporter = vtkImageExport::New();
>>   vtkExporter->SetInput(m_luminance->GetOutput());
>>
>>But here it did not work :-(
>>have anybody  an idea ?
>>
>>Thank
>>
>>Mathieu
>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users@public.kitware.com
>>http://public.kitware.com/mailman/listinfo/insight-users
>>
> 
>