<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">Hi,All~<div>&nbsp; &nbsp; &nbsp; &nbsp;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 &nbsp;at least 2 more iterators &nbsp;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>&nbsp; &nbsp; &nbsp; Here are the matlab code of my task:</div><div>&nbsp; &nbsp;<b> &nbsp; for i = 1:20</b></div><div><b>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MMt1=conv22(MMt1,4); &nbsp; //MMT1 is the Image&nbsp;</b></div><div><b>&nbsp; &nbsp; &nbsp; end</b></div><div>&nbsp; &nbsp; &nbsp;</div><div><b>&nbsp; &nbsp; &nbsp;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>&nbsp;<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>&nbsp; &nbsp;<span class="Apple-tab-span" style="white-space:pre">                </span> ss1(i,:)=.5*(ss1(i,:)+ss1(i+1,:));</div><div>&nbsp; &nbsp; <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>&nbsp; &nbsp; <span class="Apple-tab-span" style="white-space:pre">                </span>ss1(:,i)=.5*(ss1(:,i)+ss1(:,i+1));</div><div>&nbsp; &nbsp; <span class="Apple-tab-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>&nbsp; &nbsp; &nbsp; &nbsp;Now I alreay have the &nbsp;ITK code for the<b> function conv22</b>,however, &nbsp;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>&nbsp; &nbsp; &nbsp; 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="netease_mail_footer"></span></span>