<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thanks! &nbsp;I fixed this and was able to compile.<div><br></div><div>Sara<br><div><br><div><div>On Dec 7, 2010, at 7:06 PM, wanlin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi, Sara,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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;&nbsp;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's working for me now. &nbsp;Sorry for the string of questions, but I'm now back to my original problem, with the assignment of the membership functions, in line 127. &nbsp;I am guessing it'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. &nbsp;The error message is below and my code is attached. &nbsp;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: &nbsp; 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: &nbsp; 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've decided that it's worth the trouble to reinstall the newest version<br> of ITK. &nbsp;Now I'm having trouble finding/replacing the filters I was using.<br> <br> Does someone know what happened with the ImageToListAdaptor? &nbsp;And if there'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? &nbsp;I didn't see the info I'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></blockquote></div><br></div></div></body></html>