On 2/25/08, <b class="gmail_sendername">Vidya Rajagopalan</b> <<a href="mailto:vidyaraj@vt.edu">vidyaraj@vt.edu</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello Everyone,<br> <br> When initializing an ITK vector, can I assign a variable dimension?<br> <br> eg:<br> <br> int Dimension = NoOfInputs - 2;<br> typedef itk::Vector<float, Dimension> VectorPixelType;<br> <br>
Should the dimension be a constant integer only?</blockquote><div><br>No.<br><br>
ITK itself provides several classes that can serve as Arrays or vectors.<br>
<br>
1. FixedArray - Compile time fixed length arrays that's intended to represent an enumerated collection of n entities. <br>
2. Array - Run time resizeable array that is intended to hold a collection of n entities<br>
3. Vector - Compile time fixed length array that is intended to hold a
collection of n data types. A vector usually has a mathematical
meaning. It should only be used when mathematical operations such as
addition, multiplication by a scalar, product etc make sense. <br>
4. VariableLengthVector - Run time array that is intended to hold a
collection of scalar data types. Again, it should be used only when
mathematical operations on it are relevant. If not, use an Array. <br>
<br>
Now as far as instantiating images that use these datatypes...<br>
<br>
1. You can instantiate an itk::Image< TPixelType, 3 > over any of the above types.<br>
<br>
2. You can also instantiate a itk::VectorImage< Type, 3 >. The
resulting image will behave just as itk::Image<
VariableLengthVector< Type >, 3 > would behave. It will
provide faster memory access, consume less memory and provide a less
fragmented memory representation.<br>
<br>
--<br>
karthik </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Vidya Rajagopalan<br> <br> _______________________________________________<br>
Insight-users mailing list<br> <a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br> <a href="http://www.itk.org/mailman/listinfo/insight-user">http://www.itk.org/mailman/listinfo/insight-user</a><br> </blockquote>
</div>