[Insight-users] Vector Image reading
Luis Ibanez
luis.ibanez@kitware.com
Thu, 23 Jan 2003 14:09:39 -0500
Hi Raluca,
You can now read images whose pixel type
if Offset<N> where N is dimension 1 to 5.
The basic changed required was in the file
Insight/Code/IO/itkDefaultConvertPixelTraits.h
Which provides the template argument for the
ImageFileReader. We should probably add traits
for reading and writing itkPoint, itkVector
and itkCovariantVector.
So, now you can declare your image and reader as:
typedef itk::Image< itk::Offset<3>, 3 > ImageType;
typedef itk::ImageFileReader< ImageType > ReaderType;
Then instantiate a reader and give it a file name.
The DanielssonDistance example in
Insight/Examples/Filtering
Is now writing the vector image in a MetaImage file.
You may want to experiment with it for generating
a vector distance image. A suggested input file is
Insight/Examples/Data/FivePoints.png
Please let us know if you find any problems,
Thanks
Luis
------------------------------------------
Raluca wrote:
> Hi Luis
>
> Thank you for your answer it's been very helpful. I've done the necessary
> updates and the writer seems to work very well ... there is actually some
> data in the .raw file.
> Another problem arises when I try to read this file. I've declared a pixel
> type to match the image (Offset<3>) so that no conversion is necessary but I
> get a compiler error in the file itkDefaultConvertPixelTraits.h:
> "ComponentType is not a member of Offset<3>"
> If I define an image with a primitive PixelType (char, short, long ... etc)
> there is no error but how can I recover the data in its original form
> (Offset<3>) after the reading ?
>
> Thank you for your help
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>
>