[Insight-developers] itkVector and itkRGBPixel

Joshua Cates cates@sci.utah.edu
Thu, 23 Jan 2003 17:39:48 -0700 (MST)


Hi,

Often I find myself in the situation of needing to read a color image and
process it as a numerical vector.  The problem with this situation is that
the itk file IO objects do not seem to handle reading data directly into
vector images.  They do work with RGBPixel, but since RGBPixel is not a
subclass of itkVector, it has no arithmetic operations defined and cannot
be used as a numerical pixel type.  So I'm stuck with casting outside of
the pipeline, which is not an ideal situation.

How do others handle this problem?  I propose either defining an
appropriate functor for casting from RGBPixel<T> to Vector<T, 3> (is this
even possible given the constraints imposed upon us by microsoft?), or
making RGBPixel a subclass of Vector.

Thanks,

Josh.


______________________________
 Josh Cates			
 School of Computer Science	
 University of Utah
 Email: cates@sci.utah.edu
 Phone: (801) 587-7697
 URL:   http://www.sci.utah.edu/~cates