Hi, Sara,<br>         You need to make MeasurementVectorType consistent in your code.<br>Replace <span style="color: rgb(170, 13, 145);"><br>typedef</span> itk::Vector&lt; PixelType, <span style="color: rgb(28, 0, 207);">3</span> &gt; MeasurementVectorType;<br>

with <br><span style="color: rgb(170, 13, 145);">typedef</span> AdaptorType::MeasurementVectorType<span style="color: rgb(28, 0, 207);"></span> MeasurementVectorType;<br><br><br><br>wanlin<br><br><br><div class="gmail_quote">
On Wed, Dec 8, 2010 at 9:58 AM, Sara Rolfe <span dir="ltr">&lt;<a href="mailto:smrolfe@u.washington.edu">smrolfe@u.washington.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Here is the code for the previous email.<br>
<br>
<br><br>
<br>
On Dec 7, 2010, at 2:50 PM, Sara Rolfe wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks, that&#39;s working for me now.  Sorry for the string of questions, but I&#39;m now back to my original problem, with the assignment of the membership functions, in line 127.  I am guessing it&#39;s a problem with the data type, but it seems like this generalized version of k-means should support clustering vectors, since k-means is frequently used on color images.  The error message is below and my code is attached.  Please let me know if you have any advice.<br>

<br>
/Users/smrolfe/build/KdTreeBasedKMeansClustering.cxx: In function ‘int main(int, char**)’:<br>
/Users/smrolfe/build/KdTreeBasedKMeansClustering.cxx:129: error: no matching function for call to ‘std::vector&lt;itk::SmartPointer&lt;const itk::Statistics::MembershipFunctionBase&lt;main(int, char**)::PixelType&gt; &gt;, std::allocator&lt;itk::SmartPointer&lt;const itk::Statistics::MembershipFunctionBase&lt;main(int, char**)::PixelType&gt; &gt; &gt; &gt;::push_back(itk::Statistics::DistanceToCentroidMembershipFunction&lt;main(int, char**)::MeasurementVectorType&gt;*)’<br>

/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/bits/stl_vector.h:602: note: candidates are: void std::vector&lt;_Tp, _Alloc&gt;::push_back(const _Tp&amp;) [with _Tp = itk::SmartPointer&lt;const itk::Statistics::MembershipFunctionBase&lt;main(int, char**)::PixelType&gt; &gt;, _Alloc = std::allocator&lt;itk::SmartPointer&lt;const itk::Statistics::MembershipFunctionBase&lt;main(int, char**)::PixelType&gt; &gt; &gt;]<br>

/Users/smrolfe/build/KdTreeBasedKMeansClustering.cxx:59: warning: unused variable ‘outputImageFileName’<br>
/Users/smrolfe/ITK-Sandbox/ITK/Code/Numerics/Statistics/itkEuclideanDistanceMetric.txx: In member function ‘double itk::Statistics::EuclideanDistanceMetric&lt;TVector&gt;::Evaluate(const typename itk::Statistics::DistanceMetric&lt;TVector&gt;::MeasurementVectorType&amp;) const [with TVector = main(int, char**)::MeasurementVectorType]’:<br>

/Users/smrolfe/build/KdTreeBasedKMeansClustering.cxx:133:   instantiated from here<br>
/Users/smrolfe/ITK-Sandbox/ITK/Code/Numerics/Statistics/itkEuclideanDistanceMetric.txx:44: error: no match for ‘operator-’ in ‘(+#‘obj_type_ref’ not supported by dump_expr#&lt;expression error&gt;((&amp;((const itk::Statistics::EuclideanDistanceMetric&lt;main(int, char**)::MeasurementVectorType&gt;*)this)-&gt;itk::Statistics::EuclideanDistanceMetric&lt;main(int, char**)::MeasurementVectorType&gt;::&lt;anonymous&gt;)))-&gt;itk::Array&lt;double&gt;::&lt;anonymous&gt;.vnl_vector&lt;T&gt;::operator[] [with T = double](i) - (+ x)-&gt;itk::Vector&lt;main(int, char**)::PixelType, 3u&gt;::&lt;anonymous&gt;.itk::FixedArray&lt;TValueType, VLength&gt;::operator[] [with TValueType = main(int, char**)::PixelType, unsigned int VLength = 3u](i)’<br>

/Users/smrolfe/ITK-Sandbox/ITK/Code/Numerics/Statistics/itkEuclideanDistanceMetric.txx: In member function ‘double itk::Statistics::EuclideanDistanceMetric&lt;TVector&gt;::Evaluate(const typename itk::Statistics::DistanceMetric&lt;TVector&gt;::MeasurementVectorType&amp;, const typename itk::Statistics::DistanceMetric&lt;TVector&gt;::MeasurementVectorType&amp;) const [with TVector = main(int, char**)::MeasurementVectorType]’:<br>

/Users/smrolfe/build/KdTreeBasedKMeansClustering.cxx:133:   instantiated from here<br>
/Users/smrolfe/ITK-Sandbox/ITK/Code/Numerics/Statistics/itkEuclideanDistanceMetric.txx:69: error: cannot convert ‘itk::Vector&lt;double, 2u&gt;’ to ‘const double’ in initialization<br>
make[2]: *** [CMakeFiles/KdTreeBasedKMeansClustering.dir/KdTreeBasedKMeansClustering.cxx.o] Error 1<br>
make[1]: *** [CMakeFiles/KdTreeBasedKMeansClustering.dir/all] Error 2<br>
<br>
<br>
On Dec 7, 2010, at 2:19 PM, David Doria wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Tue, Dec 7, 2010 at 5:14 PM, Sara Rolfe &lt;<a href="mailto:smrolfe@u.washington.edu" target="_blank">smrolfe@u.washington.edu</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Ok, I&#39;ve decided that it&#39;s worth the trouble to reinstall the newest version<br>
of ITK.  Now I&#39;m having trouble finding/replacing the filters I was using.<br>
<br>
Does someone know what happened with the ImageToListAdaptor?  And if there&#39;s<br>
something similar I can replace it with?<br>
<br>
Also, is there a webpage where I can see what was discontinued and what was<br>
replaced?  I didn&#39;t see the info I&#39;m looking for on this wiki page:<br>
<a href="http://www.itk.org/Wiki/ITK_Release_3.18_Changed_From_Previous" target="_blank">http://www.itk.org/Wiki/ITK_Release_3.18_Changed_From_Previous</a><br>
</blockquote>
<br>
Good choice :)<br>
<br>
It is now called ImageToListSampleAdaptor<br>
<a href="http://www.itk.org/Doxygen/html/classitk_1_1ImageToListSampleAdaptor.html" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1ImageToListSampleAdaptor.html</a><br>
(the documentation seems to be down at the moment, check that link later)<br>
<br>
Here is an example:<br>
<a href="http://www.itk.org/Wiki/ITK/Examples/Statistics/ImageToListSampleAdaptor" target="_blank">http://www.itk.org/Wiki/ITK/Examples/Statistics/ImageToListSampleAdaptor</a><br>
<br>
David<br>
</blockquote>
<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>
</blockquote>
<br>
<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>
<br></blockquote></div><br>