<div>A possible workaround if your application permits:</div><div>Use an image of itk::Vector's. Vector has GetNumberOfComponents(). </div><div><br></div><div>Array and VariableLengthVector have GetNumberOfElements() but not GetNumberOfComponents()</div>
<div><br></div><div>No such Get function exists for FixedArray, but GetNumberOfComponents() is defined in RGBPixel</div><div><br></div><div>Is there a conceptual difference between GetNumberOfComponents() and GetNumberOfElements()?</div>
<div><br></div><div>A possible solution:</div><div>Fix VariableLengthVector to interface correctly with VectorResampleImageFilter (and potentially other Vector*Filters) by renaming GetNumberOfElements to GetNumberOfComponents() and changing</div>
<div><br></div><div>const unsigned int numberOfComponents = PixelType::GetNumberOfComponents();</div><div>to</div><div>unsigned int numberOfComponents = PixelType::GetNumberOfComponents(); </div><br><div class="gmail_quote">
On Thu, Jul 7, 2011 at 3:40 PM, David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Thu, Jul 7, 2011 at 3:34 PM, Cory Quammen <<a href="mailto:cquammen@cs.unc.edu">cquammen@cs.unc.edu</a>> wrote:<br>
> David,<br>
><br>
> Perhaps you want to add a method GetNumberOfComponents() to<br>
> VariableLengthVector and see if it works. If it does, this seems like<br>
> a good addition to make.<br>
><br>
> Thanks,<br>
> Cory<br>
<br>
</div>The problem is that the length of a VariableLengthVector is a member:<br>
<br>
inline unsigned int GetNumberOfElements(void) const<br>
{ return m_NumElements; }<br>
<br>
versus the CovariantVector which has a static function that is called<br>
from the VectorResampleImageFilter (the error is "cannot call member<br>
function without object):<br>
<br>
const unsigned int numberOfComponents = PixelType::GetNumberOfComponents();<br>
<br>
There is also the ::Dimension variable:<br>
<br>
itkStaticConstMacro(Dimension, unsigned int,<br>
TInputImage::PixelType::Dimension);<br>
<br>
that is not a member.<br>
<br>
Is there an easy fix?<br>
<div><div></div><div class="h5"><br>
David<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</div></div></blockquote></div><br>