[Insight-users] Howto write custom pixelTypes

Karthik Krishnan karthik.krishnan at kitware.com
Fri Jun 27 10:45:46 EDT 2008


Unfortunately you cannot expect your created pixel types (whether they 
derive from existing ITK classes or not) to be readable and writable by 
ITK's ImageIO classes.

We have typeid checks riddled throughout the ImageIO classes. These have 
the intent of serializing the pixel types, deriving information from 
them such as the number of components etc..

In short, either

1. Stick with the existing pixel types in ITK.
2. If you feel you must write your own pixel type, you'll have to either 
modify the ITK sources or write your own ImageIO classes as well.

--
karthik

luke bloy wrote:
> Hi all,
>
> I've written a subclass of itkFixedArray, that i am using as the
> pixeltype for some images. I'd like to be able to use the itk classes to
> do the file IO but i'm not sure how to tell the ImageIOBase classes
> about my class. When I try to use the niftiImageIO i get this error.
>
> itk::ERROR: NiftiImageIO(0x8117c30): Pixel type currently not supported.
>
> Since it's a basically a vector image i thought this should work. What
> should I do?
>
> -Luke
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.o



More information about the Insight-users mailing list