<DIV>Hi&nbsp; Zach :<BR>&nbsp;&nbsp;&nbsp; I have generated&nbsp;three Signed Distance Maps with SignedDanielssonDistanceMapImageFilter,and stored them in mha files,I want to use them as the TrainingImage.&nbsp;Now i have a question that how can i give these inputs to the itkImagePCAShapeModelEstimator? There are 3 TrainingImages and they are accessed using "this-&gt;getinput(0),this-&gt;getinput(1),this-&gt;getinput(2) in the itkImagePCAShapeModelEstimator class.</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;Here is my code, it can't work.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; const&nbsp;&nbsp; unsigned int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dimension = 2;</DIV>
<DIV>&nbsp; typedef float&nbsp;&nbsp;&nbsp; my_PixelType;<BR>&nbsp; typedef itk::Image&lt; my_PixelType, Dimension &gt;&nbsp;&nbsp;&nbsp; signdis_ImageType;<BR>&nbsp; std::vector&lt;signdis_ImageType::Pointer&gt; signdisImages( 3 );<BR>&nbsp; <BR>&nbsp; typedef&nbsp; itk::ImageFileReader&lt; signdis_ImageType &gt; ReaderType;<BR>&nbsp; typedef&nbsp; itk::ImageFileWriter&lt;&nbsp; signdis_ImageType&nbsp; &gt; WriterType;</DIV>
<DIV>&nbsp; ReaderType::Pointer reader = ReaderType::New();<BR>&nbsp; WriterType::Pointer writer = WriterType::New();</DIV>
<DIV>&nbsp; reader-&gt;SetFileName( argv[1] );<BR>&nbsp; reader-&gt;Update();<BR>&nbsp; signdisImages[0] = reader-&gt;GetOutput();<BR>&nbsp; reader-&gt;SetFileName( argv[2] );<BR>&nbsp; reader-&gt;Update();<BR>&nbsp; signdisImages[1] = reader-&gt;GetOutput();<BR>&nbsp; reader-&gt;SetFileName( argv[3] );<BR>&nbsp; reader-&gt;Update();<BR>&nbsp; signdisImages[2] = reader-&gt;GetOutput();</DIV>
<DIV><BR>&nbsp; typedef itk::ImagePCAShapeModelEstimator&lt;<BR>&nbsp; signdis_ImageType,&nbsp;<BR>&nbsp; signdis_ImageType &gt;&nbsp; my_Estimatortype;</DIV>
<DIV>&nbsp; my_Estimatortype::Pointer filter = my_Estimatortype::New(); <BR>&nbsp;&nbsp;filter-&gt;SetInput( signdisImages );&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp; error&nbsp; here!!!!!!!!!!!!!!!!!!!!!</DIV>
<DIV>&nbsp; writer-&gt;SetFileName( argv[4] );<BR>&nbsp; writer-&gt;SetInput( filter-&gt;GetOutput(0) );<BR>&nbsp; writer-&gt;Update(); <BR>&nbsp; writer-&gt;SetFileName( argv[5] );<BR>&nbsp; writer-&gt;SetInput( filter-&gt;GetOutput(1) );<BR>&nbsp; writer-&gt;Update(); </DIV>
<DIV>&nbsp; ........</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks</DIV>
<DIV>sunli</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>----- Original Message ----- <BR>From: "Zachary Pincus" &lt;<A href="mailto:zpincus@stanford.edu">zpincus@stanford.edu</A>&gt;<BR>To: "sun" &lt;<A href="mailto:kacking123@163.com">kacking123@163.com</A>&gt;<BR>Cc: &lt;<A href="mailto:insight-users@itk.org">insight-users@itk.org</A>&gt;<BR>Sent: Tuesday, May 30, 2006 2:55 AM<BR>Subject: Re: [Insight-users] How to compute "PCA shape model"?<BR><BR><BR><BR>&gt; Hi&nbsp; Zach :<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Thank you for your reply.<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; I have read the code in itkImagePCAShapeModelEstimator.txx . It&nbsp; <BR>&gt; seems that the mean image and principal component outputs are<BR>&gt; generated in this class,and the inputs of this class is&nbsp; <BR>&gt; TrainingImages.<BR><BR>This is correct.<BR><BR>&gt; So i wondered what the&nbsp; "signed distance maps a set of<BR>&gt; training shapes " mean in your reply, and how can i input these&nbsp; <BR>&gt; images.<BR><BR>Use one of the Signed Distance Map filters available in ITK (there&nbsp; <BR>are several, check out the Doxygen class list) to convert binary&nbsp; <BR>training images (spanning the space of possible shapes you wish to&nbsp; <BR>segment) into signed distance maps, where each pixel's value is the&nbsp; <BR>distance from that pixel to the nearest edge of the binary object&nbsp; <BR>(and the pixel's value is negative if it is inside the object). This&nbsp; <BR>then represents each shape as the zero-level set of an image.<BR><BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; In the quoted code, the shape model defined by&nbsp; <BR>&gt; CorpusCallosumMeanShape.mha and the first three principal<BR>&gt; components CorpusCallosumMode0.mha, CorpusCallosumMode1.mha and&nbsp; <BR>&gt; CorpusCallosumMode12.mha. How can i generate<BR>&gt; these mha files? Can i write the principal component outputs of&nbsp; <BR>&gt; itkImagePCAShapeModelEstimator class in&nbsp; mha files<BR>&gt; directly?<BR><BR>That is correct. Or you could use them directly without writing them&nbsp; <BR>to files.<BR><BR><BR><BR>&gt;<BR>&gt; Thanks<BR>&gt; Sunli<BR>&gt;<BR>&gt; ----- Original Message -----<BR>&gt; From: "Zachary Pincus" &lt;<A href="mailto:zpincus@stanford.edu">zpincus@stanford.edu</A>&gt;<BR>&gt; To: "sun" &lt;<A href="mailto:kacking123@163.com">kacking123@163.com</A>&gt;<BR>&gt; Cc: "itk" &lt;<A href="mailto:insight-users@itk.org">insight-users@itk.org</A>&gt;<BR>&gt; Sent: Sunday, May 28, 2006 3:41 AM<BR>&gt; Subject: Re: [Insight-users] How to compute "PCA shape model"?<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; This is a longstanding gap in the documentation.<BR>&gt;<BR>&gt; In brief, you will need to generate signed distance maps of a set of<BR>&gt; training shapes, and pass them to the PCAShapeModelEstimator class.<BR>&gt; You may then choose to divide the returned "shape mode" images (note<BR>&gt; that output zero from the model estimator is the mean image) by the<BR>&gt; reported standard deviations, as described in the example.<BR>&gt;<BR>&gt; Let me know if more detail is required.<BR>&gt;<BR>&gt; Zach Pincus<BR>&gt;<BR>&gt; Program in Biomedical Informatics and Department of Biochemistry<BR>&gt; Stanford University School of Medicine<BR>&gt;<BR>&gt;<BR>&gt; On May 27, 2006, at 12:06 AM, sun wrote:<BR>&gt;<BR>&gt;&gt; Hi all:<BR>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I am using the filter "Geodesic Active Contours Segmentation<BR>&gt;&gt; with Shape Guidance" to<BR>&gt;&gt; segment my image now.But the quoted&nbsp; code just reads in a "PCA<BR>&gt;&gt; shape model" that has been pre-computed<BR>&gt;&gt; earlier. I want to know how to compute such a shape model in&nbsp; ITK.<BR>&gt;&gt; Who can help me?<BR>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sun li<BR>&gt;&gt;<BR>&gt;&gt;<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV><SPAN></SPAN><br><!-- footer --><br><br><br><br><br><div style="border-bottom:1px solid #999"></div><br>

        <font color="black" style="font-size:14.8px">你 不 想 试 试 今 夏 最 “酷” 的 邮 箱 吗 ?</font>
        <br>
         <a href="http://www.126.com/" target="_blank" style="font-size:13px;line-height:160%;color:blue">蕴 涵 中 华 传 统 文 化 于 世 界 一 流 科 技 之 中,创 新 Ajax 技 术,126 “D 计 划”火 热 体 验 中 !
</a>