<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EstiloCorreo18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.9pt 70.9pt 70.9pt 70.9pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=ES link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'>Hi Bert,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'>Your code snippet is not correct. You cannot directly
write on the output of a ProcessObject such as a reader/filter. Instead you
must assign it to an image pointer and call DisconnectPipeline(). The code
would look like this if I&#8217;m not wrong. Note that there may be errors and
I didn&#8217;t even try it.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'>InputImageType::Pointer mk = readerMk-&gt;GetOutput();
<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'>mk-&gt;DisconnectPipeline();<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'>for (int i =0; i&lt;2; i++)<br>
&nbsp; {<br>
&nbsp; &nbsp; &nbsp; grayscaleDilate-&gt;SetInput( mk ); <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'>&nbsp; &nbsp; &nbsp; grayscaleDilate-&gt;Update();<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'>      mk = grayscaleDilate-&gt;GetOutput();<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'>      mk-&gt;DisconnectPipeline();<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'>      IteratorType mkIt( mk,
mk-&gt;GetRequestedRegion() );<br>
<br>
&nbsp; &nbsp; &nbsp; for ( markerIt.GoToBegin(); ! markerIt.IsAtEnd();<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mkIt.NextLine())<br>
&nbsp; &nbsp; &nbsp; {<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; makIt.GoToBeginOfLine();<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while ( ! mkIt.IsAtEndOfLine() )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mkIt.Set( false );<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ++mkIt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&nbsp; &nbsp; &nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>}<br>
</span></font><span lang=EN-GB><br>
Hope that helps<o:p></o:p></span></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'>Ivan</span></font><font size=2 color=navy face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial;color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>De:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> insight-users-bounces@itk.org
[mailto:insight-users-bounces@itk.org] <b><span style='font-weight:bold'>En
nombre de </span></b>Bert<br>
<b><span style='font-weight:bold'>Enviado el:</span></b> miércoles, 23 de abril
de 2008 23:24<br>
<b><span style='font-weight:bold'>Para:</span></b> insight-users@itk.org<br>
<b><span style='font-weight:bold'>Asunto:</span></b> [Insight-users] how to
update the content of an image</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Dear all,<br>
<br>
I would like to update the content of an image. I read an <br>
image from a file and then this image is passed, as an <br>
argument, in the itkGrayscaleDilateFilter. The output of <br>
this filter is then modificated and passed again in the<br>
&nbsp;itkGrayscaleDilateFilter.How can I update the new content <br>
ok ReaderMk(see the code)?<br>
<br>
InputImageType::Pointer mk = InputImageType::New();<br>
mk = readerMk-&gt;GetOutput(); &nbsp; <br>
IteratorType mkIt( mk, mk-&gt;GetRequestedRegion() ); &nbsp;&nbsp;&nbsp; <br>
<br>
&nbsp; mkIt.SetDirection(0);<br>
&nbsp; <br>
&nbsp; grayscaleDilate-&gt;SetKernel( structuringElement );<o:p></o:p></span></font></p>

<div id=1eue>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
&nbsp; for (int i =0; i&lt;2; i++)<br>
&nbsp; {<br>
&nbsp; &nbsp; &nbsp; grayscaleDilate-&gt;SetInput( readerMk-&gt;GetOutput() );
&nbsp;&nbsp; //I would like to update the readerMk<br>
&nbsp; &nbsp; &nbsp; grayscaleDilate-&gt;Update();<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for ( markerIt.GoToBegin(); !
markerIt.IsAtEnd();<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mkIt.NextLine())<br>
&nbsp; &nbsp; &nbsp; {<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; makIt.GoToBeginOfLine();<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while ( ! mkIt.IsAtEndOfLine() )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mkIt.Set( false );<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ++mkIt;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&nbsp; &nbsp; &nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; readerMk-&gt;Update();&nbsp;&nbsp;&nbsp;&nbsp;
//Do I need to add something else?<o:p></o:p></span></font></p>

</div>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>}<br>
<br>
Thanks a lot for your help<o:p></o:p></span></font></p>

<p><font size=2 face="Times New Roman"><span style='font-size:10.0pt'>No virus
found in this incoming message.<br>
Checked by AVG.<br>
Version: 7.5.524 / Virus Database: 269.23.3/1392 - Release Date: 22/04/2008
15:51</span></font><o:p></o:p></p>

</div>

</body>

</html>
<BR>

<P><FONT SIZE=2>No virus found in this outgoing message.<BR>
Checked by AVG.<BR>
Version: 7.5.524 / Virus Database: 269.23.4/1394 - Release Date: 23/04/2008 19:16<BR>
</FONT> </P>