[Insight-developers] Vectors, APIs, and
Jim Miller
millerjv at ge.com
Fri Jun 10 15:18:55 EDT 2011
We have a lot of vector types in ITK. Ignoring the context sensitive vector types (Point, CovariantVector, Index, Offset, ...), we have a set of standard vector types FixedArray, Array, Vector, VariableLengthVector whose use depends largely on whether the number of items is known at compile time and whether the vector is being used to hold of collection of values or support linear algebra operations. We also have our safety net of vnl_vector.
We have added these vectors types over time to meet specific needs but have not really established a convention on when to use each type of vector. We wind up in circumstances where one class is using one vector type and needs to pass information to another class that uses a different vector type. In many circumstance, no automatic conversion is available and we ask the programmer to manually convert the vector types.
As we review all the code in ITK, should we take the opportunity to clean up the use of the various vector types? Anyone have suggestions on some conventions. For instance, given the number of ITK specific vector types, I would say that the API to ITK classes should have minimal exposure to vnl_vector. Similarly for vnl_matrix. Should we try to use VariableLengthVector more and Vector less? Should we add some of the missing methods to convert between vector types? For instance, a VariableLengthVector currently does not allow for initialization with a Vector or vnl_vector.
Scanning through the entire toolkit for this would be a huge task. However, I find when reviewing classes within a single family of algorithms, we are very inconsistent in the types of vectors used. For example, there can be two algorithms that a user might want to compare for a certain task but they use different vector types in their API, so the user cannot use one as a drop in replacement for the other.
Jim Miller
Senior Scientist
GE Research
Interventional and Therapy
GE imagination at work
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110610/5c5f5a8d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3108 bytes
Desc: not available
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110610/5c5f5a8d/attachment.bin>
More information about the Insight-developers
mailing list