[Insight-users] vtk image reader

Pieter Vos pieterv@radiology.azn.nl
Wed, 10 Apr 2002 08:50:18 +0200 (CEST)


Hi Will,

In the mail below, you say there is a patch for the file. I Really would
like to receive the patch.

Many thanks,

Pieter Vos

On Thu, 4 Apr 2002, Will Schroeder wrote:

> Hi Pieter-
> 
> I believe this problem has been fixed. When did you download the beta? I 
> can send you a patch if necessary.
> 
> Will
> 
> At 10:59 AM 4/4/2002 +0200, Pieter Vos wrote:
> >Hello,
> >
> >I have a problem with the usage of itkVTKImageIO.cxx
> >The test file provided (itkVTKImageIOTest.cxx) works excelent, however I'm
> >interested in just reading a vtk file, not first writing and then reading
> >the written file.
> >But I retrieve an exception when excecuting reader->update():
> >
> >exception in file reader
> >Number of dimensions in file (2) does not match number of dimensions in
> >output (3)
> >Unknown
> >
> >The header looks like:
> >
> ># vtk DataFile Version 3.0
> >vtk output
> >ASCII
> >DATASET STRUCTURED_POINTS
> >DIMENSIONS 20 20 20
> >SPACING 1.05263 1.05263 1.05263
> >ORIGIN 0 0 0
> >POINT_DATA 8000
> >COLOR_SCALARS scalars float 1
> >
> >So the number of dimensions should be set correct by the reader, but it
> >does not so. The code looks like:
> >
> >
> >   itk::VTKImageIO::Pointer vtkIO;
> >   vtkIO = itk::VTKImageIO::New();
> >   itk::ImageFileReader<FloatImageType>::Pointer reader;
> >   reader = itk::ImageFileReader<FloatImageType>::New();
> >   reader->SetImageIO(vtkIO);
> >   reader->SetFileName("sphere.vtk");
> >     try
> >     {
> >     reader->Update();
> >     }
> >   catch (itk::ExceptionObject & e)
> >     {
> >     std::cerr << "exception in file reader " << std::endl;
> >     std::cerr << e.GetDescription() << std::endl;
> >     std::cerr << e.GetLocation() << std::endl;
> >     return EXIT_FAILURE;
> >     }
> >
> >Do I need to do some presettings? Which one?
> >
> >Many thanks,
> >
> >--
> >Pieter Vos
> >AZN Radboud The Netherlands
> >Tel.: 06-18876433
> >mailto:pieterv@radiology.azn.nl
> >
> >_______________________________________________
> >Insight-users mailing list
> >Insight-users@public.kitware.com
> >http://public.kitware.com/mailman/listinfo/insight-users
> 
> 

-- 
Pieter Vos
Doddendaal 190 Nijmegen
Tel.: 06-18876433
mailto:pieterv@radiology.azn.nl