<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE></TITLE>
<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=732393317-21062004>Hi
Lucas,</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=732393317-21062004>In
general to do statistical calculation there are several methods in
</SPAN></FONT><FONT face=Arial color=#0000ff size=2><SPAN
class=732393317-21062004><A
href="http://www.itk.org/Doxygen16/html/namespaceitk_1_1Statistics.html">http://www.itk.org/Doxygen16/html/namespaceitk_1_1Statistics.html</A>.
In addition the software guide has a chapter on Statistics. This may be
sufficient for your purpose. However, if you need to work directly with images
instead of treating the data as a list of pixels. The following class I
believe might be useful.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=732393317-21062004></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=732393317-21062004><A
class=el
href="http://www.itk.org/Doxygen16/html/classitk_1_1ImageModelEstimatorBase.html"><FONT
face="Times New Roman" size=3>itk::ImageModelEstimatorBase< TInputImage,
TMembershipFunction ></FONT></A><FONT face="Times New Roman" color=#000000
size=3> </FONT></DIV>
<UL>
<LI><A class=el
href="http://www.itk.org/Doxygen16/html/classitk_1_1ImageGaussianModelEstimator.html">itk::ImageGaussianModelEstimator<
TInputImage, TMembershipFunction, TTrainingImage ></A> </LI></UL>
<DIV><SPAN class=732393317-21062004>There are tests associated with this class
in the testing directory. The training image could be a mask with unique label
for all the pixels in the data you want to build your model on.</SPAN></DIV>
<DIV><SPAN class=732393317-21062004></SPAN> </DIV>
<DIV><SPAN class=732393317-21062004>The </SPAN><SPAN class=732393317-21062004><A
class=el
href="http://www.itk.org/Doxygen16/html/classitk_1_1ImageClassifierBase.html">itk::ImageClassifierBase<
TInputImage, TClassifiedImage ></A><STRONG> </STRONG>class allows the
usage different model while working with images for classification. It is
possible for you to derive your class from the classifier base with the
appropriate components or use the some components from the classifier base
within your class as a helper class depending on what works best for
you.</SPAN></DIV>
<DIV><SPAN class=732393317-21062004></SPAN> </DIV>
<DIV><SPAN class=732393317-21062004>For instance, the MRF filter class (<A
class=el
href="http://www.itk.org/Doxygen16/html/classitk_1_1MRFImageFilter.html">itk::MRFImageFilter<
TInputImage, TClassifiedImage ></A>) uses the image classifier
class. There is test code in the testing directory, you could leverage your
implementation by looking into this code.</SPAN></DIV>
<DIV><SPAN class=732393317-21062004></SPAN> </DIV>
<DIV><SPAN class=732393317-21062004>Note: all the images take vector value input
as is the case with your data.</SPAN></DIV>
<DIV><SPAN class=732393317-21062004></SPAN> </DIV>
<DIV><SPAN class=732393317-21062004>Regards,</SPAN></DIV>
<DIV><SPAN class=732393317-21062004>Sayan</SPAN></DIV>
<DIV><SPAN class=732393317-21062004></SPAN> </DIV>
<DIV><SPAN class=732393317-21062004> </SPAN></DIV></SPAN></FONT>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Lucas Lorenzo
[mailto:lucas@cvrti.utah.edu]<BR><B>Sent:</B> Wednesday, June 16, 2004 1:32
PM<BR><B>To:</B> Luis Ibanez<BR><B>Cc:</B> ITK<BR><B>Subject:</B> Re:
[Insight-users] CovarianceCalculator<BR><BR></FONT></DIV><!-- Converted from text/enriched format -->
<DIV>Hi Luis, </DIV><BR>
<DIV>thanks again. </DIV><BR>
<DIV>1) the processing that<FONT color=#000000> I plan to do on it is: </DIV>
<DIV>a) to pass individual pixels (vectors) as arguments for the
MahalanobisDistanceMembershipFunction class; </DIV>
<DIV>b) to pass a sample list of pixels (vectors) as an argument for theMean
Calculator class; </DIV>
<DIV>c) to pass a sample list of pixels (vectors) as an argument for the
CovarianceCalculator class. </DIV><BR>
<DIV>2) Let's say that I'm going to write my own ImageIO object. Is there any
documentation and/or example I could use ? </DIV><BR>
<DIV>Thanks, </DIV>
<DIV></FONT></DIV><BR>
<DIV>Lucas </DIV><BR><BR>
<DIV>On Jun 16, 2004, at 1:43 PM, Luis Ibanez wrote: </DIV><BR>
<BLOCKQUOTE><BR>
<DIV>Hi Lucas, </DIV><BR>
<DIV>If the vector size is not known at compliation time, </DIV>
<DIV>you are probably having to defined the images as: </DIV><BR>
<DIV>itk::Image< std::vector< float >, Dimension > </DIV><BR>
<DIV>and.. in that case you will have to write your own </DIV>
<DIV>ImageIO object in order to read the fileformat. </DIV><BR><BR>
<DIV>Another option for you could be to store individual </DIV>
<DIV>components per file. That is, instead of a file with </DIV>
<DIV>and image with 60 components per pixel, you could </DIV>
<DIV>store 60 files each one with an image of 1 component </DIV>
<DIV>per pixel. </DIV><BR>
<DIV>You could read these images sequencially using any </DIV>
<DIV>of the existing fileformats, an then copy the content </DIV>
<DIV>fron the incoming image into the i-th component of </DIV>
<DIV>the </DIV><BR>
<DIV>itk::Image< std::vector< float >, Dimension > </DIV><BR>
<DIV>You may want to sit in a peaceful place with some </DIV>
<DIV>coffee and do the math for the memory footprint of </DIV>
<DIV>such an image, because it can easily get out of control. </DIV><BR>
<DIV>Note also that you must consider upfront the type </DIV>
<DIV>of processing that you expect to apply to such an </DIV>
<DIV>image. </DIV><BR>
<DIV>Are you planning to do segmentation on it ? </DIV>
<DIV>maybe statistical classification ? </DIV><BR><BR>
<DIV>Note that the above image type may not satisfy the </DIV>
<DIV>API expected by some ITK filters. </DIV><BR><BR><BR>
<DIV>Regards, </DIV><BR><BR>
<DIV>Luis </DIV><BR><BR><BR>
<DIV>-------------------- </DIV>
<DIV>Lucas Lorenzo wrote: </DIV><BR>
<BLOCKQUOTE>
<DIV>Hi Luis, </DIV>
<DIV>thanks a lot for your answer. </DIV>
<DIV>mmm ... my problem is that I'll have to deal with 2D images of
vectors (right now I've defined them as itk::Vector type) but the length
of these vectors might change from one file to another. </DIV>
<DIV>Is there any way to load such an image from a file without knowing
the vector size at compilation time ? </DIV>
<DIV>Thanks, </DIV>
<DIV>Lucas </DIV>
<DIV>On Jun 15, 2004, at 11:31 PM, Luis Ibanez wrote: </DIV>
<BLOCKQUOTE><BR>
<DIV>Hi Lucas, </DIV><BR>
<DIV>The source of the problem is that VXL uses explicit </DIV>
<DIV>instantiation of Templates as opposed to ITK that </DIV>
<DIV>uses implicit instatiation. </DIV><BR>
<DIV>This means that in vnl you can only use types that </DIV>
<DIV>have already been explicity instantiated in the </DIV>
<DIV>library. If you need to use a new combination, then </DIV>
<DIV>you have to add the corresponding explicit instantiation.
</DIV><BR>
<DIV>The vnl_fixed_matrix is only instantiated for a </DIV>
<DIV>certain number of template parameters. </DIV><BR>
<DIV>You will find them under: </DIV><BR>
<DIV>Insight/Utilities/vxl/core/vnl/Templates </DIV><BR>
<DIV>They are </DIV><BR>
<DIV>vnl_matrix_fixed+double.1.1-.cxx </DIV>
<DIV>vnl_matrix_fixed+double.1.2-.cxx </DIV>
<DIV>vnl_matrix_fixed+double.1.3-.cxx </DIV>
<DIV>vnl_matrix_fixed+double.2.1-.cxx </DIV>
<DIV>vnl_matrix_fixed+double.2.2-.cxx </DIV>
<DIV>vnl_matrix_fixed+double.2.3-.cxx </DIV>
<DIV>vnl_matrix_fixed+double.2.4-.cxx </DIV>
<DIV>vnl_matrix_fixed+double.2.6-.cxx </DIV>
<DIV>vnl_matrix_fixed+double.3.1-.cxx </DIV>
<DIV>vnl_matrix_fixed+double.3.2-.cxx </DIV>
<DIV>vnl_matrix_fixed+double.3.3-.cxx </DIV>
<DIV>vnl_matrix_fixed+double.3.4-.cxx </DIV>
<DIV>vnl_matrix_fixed+double.3.5-.cxx </DIV>
<DIV>vnl_matrix_fixed+double.4.1-.cxx </DIV>
<DIV>vnl_matrix_fixed+double.4.2-.cxx </DIV>
<DIV>vnl_matrix_fixed+double.4.3-.cxx </DIV>
<DIV>vnl_matrix_fixed+double.4.4-.cxx </DIV>
<DIV>vnl_matrix_fixed+double.6.6-.cxx </DIV>
<DIV>vnl_matrix_fixed+float.1.2-.cxx </DIV>
<DIV>vnl_matrix_fixed+float.1.3-.cxx </DIV>
<DIV>vnl_matrix_fixed+float.2.1-.cxx </DIV>
<DIV>vnl_matrix_fixed+float.2.2-.cxx </DIV>
<DIV>vnl_matrix_fixed+float.3.1-.cxx </DIV>
<DIV>vnl_matrix_fixed+float.3.3-.cxx </DIV>
<DIV>vnl_matrix_fixed+float.3.4-.cxx </DIV>
<DIV>vnl_matrix_fixed+float.3.5-.cxx </DIV>
<DIV>vnl_matrix_fixed+float.4.3-.cxx </DIV>
<DIV>vnl_matrix_fixed+float.4.4-.cxx </DIV>
<DIV>vnl_matrix_fixed+int.2.2-.cxx </DIV>
<DIV>vnl_matrix_fixed+int.3.4-.cxx </DIV>
<DIV>vnl_matrix_fixed+vnl_bignum.3.3-.cxx </DIV>
<DIV>vnl_matrix_fixed+vnl_rational.3.3-.cxx </DIV>
<DIV>vnl_matrix_fixed_pairwise_ops.cxx </DIV>
<DIV>vnl_matrix_fixed_ref+double.3.3-.cxx </DIV>
<DIV>vnl_matrix_fixed_ref+double.3.4-.cxx </DIV>
<DIV>vnl_matrix_fixed_ref+float.3.3-.cxx </DIV>
<DIV>vnl_matrix_fixed_ref+float.3.4-.cxx </DIV><BR><BR>
<DIV>As you can see, there is no instantiation for a matrix </DIV>
<DIV>of size 60 x 60 which is what you seems to be trying </DIV>
<DIV>to instantiate. </DIV><BR>
<DIV>BTW, Do you realy have a problem where your </DIV>
<DIV>feature vector has 60 components ? </DIV><BR><BR>
<DIV>If you really want to have 60 x 60 for </DIV>
<DIV>the matrix dimension, then you could add </DIV>
<DIV>a new file for explicit instantiation of </DIV>
<DIV>your matrix type. Note that you must add </DIV>
<DIV>this new file to the CMakeLists.txt file </DIV>
<DIV>in that directory. </DIV><BR>
<DIV>You may want to take a file such as: </DIV><BR>
<DIV>vnl_matrix_fixed+double.6.6-.cxx </DIV><BR>
<DIV>and copy/rename it as </DIV><BR>
<DIV>vnl_matrix_fixed+double.60.60-.cxx </DIV><BR>
<DIV>and change its internals in order to </DIV>
<DIV>use 60 x 60 as template arguments for </DIV>
<DIV>the matrix dimensions. </DIV><BR><BR><BR><BR>
<DIV>Regards, </DIV><BR><BR>
<DIV>Luis </DIV><BR><BR><BR>
<DIV>--------------------- </DIV>
<DIV>Lucas Lorenzo wrote: </DIV><BR>
<BLOCKQUOTE>
<DIV>Hi all, </DIV>
<DIV>I'm having a linking problem when compiling the following code
(I'm including only the important parts): </DIV>
<DIV>/ </DIV>
<DIV>#include "itkVector.h" </DIV>
<DIV>#include "itkListSample.h" </DIV>
<DIV>#include "itkCovarianceCalculator.h" </DIV>
<DIV>int main( int argc, char * argv[] ) </DIV>
<DIV>{ </DIV>
<DIV>const unsigned int vsize = 60; </DIV>
<DIV>typedef itk::Vector< float, vsize > InputPixelType; </DIV>
<DIV>typedef itk::Statistics::ListSample< InputPixelType >
SampleType ; </DIV>
<DIV>SampleType::Pointer sample = SampleType::New() ; </DIV>
<DIV>// here I create the samplelist </DIV>
<DIV>typedef itk::Statistics::CovarianceCalculator< SampleType >
</DIV>
<DIV>CovarianceAlgorithmType; </DIV>
<DIV>CovarianceAlgorithmType::Pointer covarianceAlgorithm =
CovarianceAlgorithmType::New(); </DIV>
<DIV>covarianceAlgorithm->SetInputSample( sample ); </DIV>
<DIV>// I've already calculated the mean: </DIV>
<DIV>covarianceAlgorithm->SetMean( meanAlgorithm->GetOutput() );
</DIV>
<DIV>covarianceAlgorithm->Update(); </DIV>
<DIV>return 0; </DIV>
<DIV>} </DIV>
<DIV>/ </DIV>
<DIV>The error message looks as follows: </DIV>
<DIV>/lucas:Seg_Code> make </DIV>
<DIV>Building dependencies cmake.check_depends... </DIV>
<DIV>Building object file ThresholdSegPrSh.o... </DIV>
<DIV>Building executable
/private/var/automount/Seg_Code/ThresholdSegPrSh... </DIV>
<DIV>ld: Undefined symbols: </DIV>
<DIV>vnl_matrix_fixed<double, (unsigned)60,
(unsigned)60>::div(double const*, double, double*) </DIV>
<DIV>vnl_matrix_fixed<double, (unsigned)60,
(unsigned)60>::fill(double) </DIV>
<DIV>vnl_matrix_fixed<double, (unsigned)60,
(unsigned)60>::print(std::basic_ostream<char,
std::char_traits<char> >&) const </DIV>
<DIV>make[1]: *** [/private/var/automount/Seg_Code/ThresholdSegPrSh]
Error 1 </DIV>
<DIV>make: *** [default_target] Error 2 </DIV>
<DIV>/ </DIV>
<DIV>Could anyone please help me with this problem ? </DIV>
<DIV>Thanks, </DIV>
<DIV>Lucas Lorenzo </DIV>
<DIV>University of Utah </DIV>
<DIV>Nora Eccles Harrison CardioVascular Research and Training
Institute </DIV>
<DIV>Fellows Room </DIV>
<DIV>95 South 2000 East </DIV>
<DIV>Salt Lake City, UT 84112-5000 </DIV>
<DIV>e-mail: lucas@cvrti.utah.edu </DIV>
<DIV>telephone: 801-587-9536 </DIV>
<DIV>----------------------------------------------------------------------
-- </DIV>
<DIV>_______________________________________________ </DIV>
<DIV>Insight-users mailing list </DIV>
<DIV>Insight-users@itk.org </DIV>
<DIV>http://www.itk.org/mailman/listinfo/insight-users
</DIV></BLOCKQUOTE><BR><BR><BR><BR>
<DIV>_______________________________________________ </DIV>
<DIV>Insight-users mailing list </DIV>
<DIV>Insight-users@itk.org </DIV>
<DIV>http://www.itk.org/mailman/listinfo/insight-users
</DIV><BR></BLOCKQUOTE>
<DIV>Lucas Lorenzo </DIV>
<DIV>University of Utah </DIV>
<DIV>Nora Eccles Harrison CardioVascular Research and Training Institute
</DIV>
<DIV>Fellows Room </DIV>
<DIV>95 South 2000 East </DIV>
<DIV>Salt Lake City, UT 84112-5000 </DIV>
<DIV>e-mail: lucas@cvrti.utah.edu </DIV>
<DIV>telephone: 801-587-9536 </DIV></BLOCKQUOTE><BR><BR><BR><BR></BLOCKQUOTE>
<DIV>Lucas Lorenzo </DIV><BR>
<DIV>University of Utah </DIV>
<DIV>Nora Eccles Harrison CardioVascular Research and Training Institute
</DIV>
<DIV>Fellows Room </DIV>
<DIV>95 South 2000 East </DIV>
<DIV>Salt Lake City, UT 84112-5000 </DIV><BR>
<DIV>e-mail: lucas@cvrti.utah.edu </DIV>
<DIV>telephone: 801-587-9536 </DIV></BLOCKQUOTE></BODY></HTML>