[Insight-users] I/O issue

Luis Ibanez luis.ibanez at kitware.com
Mon, 01 Mar 2004 22:36:22 -0500


Hi Alyassin,

If you are using the MetaImage file format, this is
a known bug issue. It has been logged as Bug # 580
http://www.itk.org/Bug/bug.php?op=show&bugid=580&pos=1

The best thing that you can do at this point is to
sign up for an account in the bug tracker and 'vote'
for this bug in order to increase its priority.



Regards,


    Luis


------------------------------------------
Alyassin, Abdalmajeid M (Research) wrote:

> Hi,
> 
> I'm having a hard time reading back a 2D Deformation Field I saved in itk.
> I'm using the following code ...
> 
> #include "itkImageFileReader.h" 
> #include "itkImageFileWriter.h" 
> #include "itkVector.h"
> #include "itkRawImageIO.h"
> #include "itkImageIOBase.h"
> 
>  const unsigned int Dimension = 2;
>  typedef float PixelType;
>  typedef itk::Vector< float, Dimension >    VectorPixelType;
>  typedef itk::ImageFileReader< DFImageType >   DFImageReaderType;
> 
>  itk::RawImageIO<PixelType,Dimension>::Pointer io =
> itk::RawImageIO<PixelType,Dimension>::New();
>   io->SetFileDimensionality(2);
>   io->CanReadFile(argv[3]);
>   io->SetDimensions(0,175);
>   io->SetDimensions(1,175);
>   io->SetByteOrderToLittleEndian();
>   io->SetFileTypeToBinary();
>   io->SetSpacing(0,1);
>   io->SetSpacing(1,1);
>   io->SetNumberOfComponents(2);
> 
>   DFImageReaderType::Pointer dfImageReader = DFImageReaderType::New();
>   dfImageReader->SetFileName( argv[3] );
>   dfImageReader->SetImageIO(io);
>   dfImageReader->Update();
> 
> the code compiles ok but it reads in zero values that are different than
> what is actually in deformation field files !!!
> is there a better way to read this? Any help is appreciated.
> 
> Majeid
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>