[Insight-users] itkVTKtoITKtoVTK modification

Pieter Vos pieterv@radiology.azn.nl
Thu, 2 May 2002 10:00:06 +0200 (CEST)


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
> 

-- 
Pieter Vos
UMC Radboud Nijmegen
The Netherlands
mailto:pieterv@radiology.azn.nl