[Insight-users] VectorDistanceMap : Writing to a file

Luis Ibanez luis.ibanez@kitware.com
Thu, 09 Jan 2003 10:30:42 -0500


Hi Raluca,

Thanks for pointing this out.

The types for writing are validated in

  Insight/Code/IO/itkImageIOBase.cxx

There is a long switch statement with all
the supported types.  Offset<n> was missing
in there.

I just added entries for

    Offset<2>
    Offset<3>
    Offset<4>

You can update from the cvs repository
or modify your local file by inserting
the following lines around line 202 of
itkImageIOBase.cxx.

Then recompiling the IO library.

---------------------------------

   else if ( ptype == typeid(Offset<2>) )
     {
     this->SetNumberOfComponents(2);
     this->SetPixelType(ImageIOBase::LONG);
     this->SetComponentType(ImageIOBase::LONG);
     }
   else if ( ptype == typeid(Offset<3>) )
     {
     this->SetNumberOfComponents(3);
     this->SetPixelType(ImageIOBase::LONG);
     this->SetComponentType(ImageIOBase::LONG);
     }
   else if ( ptype == typeid(Offset<4>) )
     {
     this->SetNumberOfComponents(4);
     this->SetPixelType(ImageIOBase::LONG);
     this->SetComponentType(ImageIOBase::LONG);
     }

---------------------------------

Please let us know if you find any problems


Thanks

    Luis

-----------------------------------
Raluca wrote:
> Hi everybody
> 
> I'm using DanielssonDistanceMapImageFilter and I'm trying to save the
> VectorDistanceMap image to file. I've tried several writes and they all gave
> an error: "Pixel Type currently not available"
> According to the definition of the VectorIamgeType the PixelType is
> Offset<3> for a 3D Input Image.
> I've had no problem writing the DistanceMapImage.
> 
> Can anyone tell me if it's possible to write this image to file and how?
> 
> Thanks
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
> 
>