<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">It seems that you are trying to perform
convolution in ITK. Have you tried using this class and write a
wrapper around it?<br>
<br>
<a
href="http://www.itk.org/Doxygen/html/classitk_1_1ConvolutionImageFilter.html">http://www.itk.org/Doxygen/html/classitk_1_1ConvolutionImageFilter.html</a><br>
<br>
Siavash<br>
On 9/9/2013 7:13 PM, shiwei wrote:<br>
</div>
<blockquote
cite="mid:64ba692c.12b53.14105a592d0.Coremail.swingsw89@163.com"
type="cite">
<div
style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">Hi,All~
<div> Now I ran into some problems is that I need to use
the Itk::meanImageFilter to prosess an Image, and I did it
,then I need to visit some Lines of the Pixels in the Image,
If I use an Iterator,however, I need at least 2 more
iterators to do my work because I have to visit two LInes of
the Image simultaneously. So I convert the Itk image to matrix
that I can easily process the task.</div>
<div> Here are the matlab code of my task:</div>
<div> <b> for i = 1:20</b></div>
<div><b> MMt1=conv22(MMt1,4); //MMT1 is the Image </b></div>
<div><b> end</b></div>
<div> </div>
<div><b> function ss1=conv22(MMt1,Ls)</b></div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>[nxx,nyy]=size(MMt1);</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>ss1=MMt1;</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>ss=conv2(MMt1,1/(2*Ls+1)^2*ones(2*Ls+1,2*Ls+1))
;</div>
<div><br>
</div>
<div> <span class="Apple-tab-span" style="white-space:pre"> </span>ss1(Ls+1:nxx-Ls,Ls+1:nyy-Ls)=ss(2*Ls+1:nxx,2*Ls+1:nyy);</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>for
i=1:Ls</div>
<div> <span class="Apple-tab-span" style="white-space:pre"> </span>
ss1(i,:)=.5*(ss1(i,:)+ss1(i+1,:));</div>
<div> <span class="Apple-tab-span" style="white-space:pre">
</span>ss1(nxx-i+1,:)=.5*(ss1(nxx-i+1,:)+ss1(nxx-i,:));</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>end</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>for
i=1:Ls</div>
<div> <span class="Apple-tab-span" style="white-space:pre">
</span>ss1(:,i)=.5*(ss1(:,i)+ss1(:,i+1));</div>
<div> <span class="Apple-ta b-span" style="white-space:pre">
</span>ss1(:,nyy-i+1)=.5*(ss1(:,nyy-i+1)+ss1(:,nyy-i));</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>end</div>
<div><br>
</div>
<div> Now I alreay have the ITK code for the<b> function
conv22</b>,however, the real problem is about the <b>for
loop "for 1=1:20"</b>, because I did the meanimageFiltering
uses the itkclass,but then I convet the itk::images to matrix,
now if I want to do the <b>for loop "for 1=1:20",</b> Do I
need to convert the matrix back to images for
Itk::MeanImageFilter? Or the Filter can have some way to read
a matrix?</div>
<div><br>
</div>
<div> If I write the code like this ,It will be very
compelx for every loop I have to conver between matrix and
images! Do you have more convieniant way to do this task? Or
some Filters can read the matrix and to do the
MeanImageFiltering? Thank you !</div>
</div>
<br>
<br>
<span title="neteasefooter"><span id="net ease_mail_footer"></span></span>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_____________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at
<a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Kitware offers ITK Training Courses, for more information visit:
<a class="moz-txt-link-freetext" href="http://www.kitware.com/products/protraining.php">http://www.kitware.com/products/protraining.php</a>
Please keep messages on-topic and check the ITK FAQ at:
<a class="moz-txt-link-freetext" href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a>
</pre>
</blockquote>
<br>
</body>
</html>