[Insight-users] itkVTKtoITKtoVTK modification

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


Hello,

I am working on the same.
I did not choose for the export/import. The reason for this is, that the
vtk part is in tcl/tk and the itk part in c++.
I work with a structured point dataset in vtk format, which is easy to
read in itk. This volume is segmented in itk with the
3DdeformableModel. It has a model/mesh as output which I have to write to
a vtk file again. But there is no itkMeshToVTKWriter (or I didn't find it
yet) so I made a procedure that write's the correct vtk file. 

I'm interessed in you're findings with the vtkImport/Export, does it work
fine? What kind of image is the toto.png?

Greetings,

Pieter


On Thu, 2 May 2002, Mathieu Lamard wrote:

> 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
> >>
> > 
> > 
> 
> 
> 
> 

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