[Insight-developers] VectorType of itk::LevelSetFunction is FixedArray. Why not Vector?

Luis Ibanez luis.ibanez at kitware.com
Thu Jul 7 11:28:15 EDT 2005



Hi Zach,

Thanks for pointing this out.

There is no aparent reason why this VectorType couldn't
be an itk::Vector instead of an itk::FixedArray.


The fact that the VectorType represents an advection field
is actually a good argument in favor of using an itk::Vector
type instead of the itk::FixedArray type.

Note that the IO argument may not be the best reason for
changing the type. The coverage for reading and writing
itk::FixedArrays should be as complete as the one for
itk::Vectors

The itk::Vector class derives from the itk::FixedArray,
so the only reason for having them separate, is the fact
that Vectors represent a geometrical concept in N-D space,
and can therefore have a particular set of operators defined.
A comparative discussion on the concept of Vectors, Points,
Arrays... has been added to the second edition of the
Software Guide:

       http://www.itk.org/ItkSoftwareGuide.pdf

you will find it in section 8.8.1 "Geometrical Representation"
pdf-page 415.



Probably the right way to proceed at this point, will be for
you to change the type in your local copy, run and submit an
experimental build, and if all the tests are green in the
Dashboard then we will proceed to change the type.


Please let us know if this option sounds reasonable to you.



     Thanks


        Luis




-----------------------
Zachary Pincus wrote:
> Hi guys,
> 
> The base class for level set functions in ITK (itk::LevelSetFunction) 
> typedef's VectorType as a FixedArray. This means that custom edge 
> advection images need to have FixedArrays as pixels, which is 
> inconvenient because most of the ImageWriter classes that deal with 
> vector images only work with Vector-typed pixels, not FixedArray-typed 
> pixels. Moreover, there are many appropriate numeric traits defined for 
> Vector, but none for FixedArray -- this makes using filters on 
> FixedArray images more challenging.
> 
> Is there any reason why FixedArray images are used in this case and not 
> Vector images? Do FixedArrays have fewer data members or fewer virtual 
> functions so that using them is significantly faster? Or is there some 
> other advantage? If not, is there any reason not to change the 
> LevelSetFunction typedef to Vector instead of FixedArray? (And you guys 
> prudently wouldn't want to make this an ITK-wide change, is there any 
> reason I wouldn't want change it for my own ITK checkout?)
> 
> Sure, I can pixel-by-pixel copy a Vector image to a FixedArray image, 
> but if it's not necessary that's better for me.
> 
> Zach
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
> 
> 





More information about the Insight-developers mailing list