<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Bert,<br>
<br>
I think you should add at the end of the for loop:
markerDilated->DisconnectPipeline(); <br>
<br>
Hope that helps<br>
Best<br>
Irene<br>
<br>
<br>
<br>
Bert wrote:
<blockquote
cite="mid6f6eaba60804240957k516b1416u1d80cb7d51bd0602@mail.gmail.com"
type="cite">Hi Luis,<br>
<br>
Thanks a lot for your answer. What I am trying to do is to implement a
reconstruction algorithm. I haven't used any of the implemented ones
because I need to use my own structuring element.<br>
What I have to do is dilatation + intersection until the convergence,
this is why I need to modify the output of the Dilate filter. Is
possible to do it? This is the code I have:<br>
<br>
InputImageType::Pointer marker = InputImageType::New();<br>
InputImageType::Pointer markerDilated = InputImageType::New();<br>
InputImageType::Pointer mask = InputImageType::New();<br>
<br>
marker = readerMarker->GetOutput(); //read the marker image<br>
markerDilated = grayscaleReconstruction->GetOutput(); //read
the dilated marker<br>
mask = readerMask->GetOutput(); //read the mask image<br>
<br>
// Next we create two iterators. The iterators are initialized
over the same region. <br>
//The direction of iteration is set to 0, the $x$ dimension.<br>
IteratorType markerDilatedIt( markerDilated,
markerDilated->GetRequestedRegion() ); <br>
IteratorType maskIt( mask, mask->GetRequestedRegion() );<br>
markerDilatedIt.SetDirection(0);<br>
maskIt.SetDirection(0);<br>
<br>
grayscaleReconstruction->SetKernel( structuringElement );<br>
WriterType::Pointer writerMarkerDilated = WriterType::New();<br>
<br>
for (int i =0; i<numberOfIterations; i++)<br>
{<br>
grayscaleReconstruction->SetInput( marker ); <br>
grayscaleReconstruction->Update();<br>
<br>
<br>
for ( markerDilatedIt.GoToBegin(), maskIt.GoToBegin(); !
maskIt.IsAtEnd();<br>
markerDilatedIt.NextLine(), maskIt.NextLine())<br>
{<br>
markerDilatedIt.GoToBeginOfLine();<br>
maskIt.GoToBeginOfLine();<br>
<br>
while ( ! markerDilatedIt.IsAtEndOfLine() )<br>
{<br>
if( maskIt.Get()==0 )<br>
{<br>
markerDilatedIt.Set( 0 );<br>
++markerDilatedIt;<br>
++maskIt;<br>
}<br>
else <br>
{<br>
++markerDilatedIt;<br>
++maskIt;<br>
}<br>
}<br>
}<br>
writerMarkerDilated->SetFileName( argv[2] ); //overwrite
the marker<br>
writerMarkerDilated->SetInput(markerDilated);<br>
writerMarkerDilated->Update();<br>
<br>
readerMarker->Update();<br>
marker->Update();<br>
<br>
<br>
}<br>
<br>
Thanks a lot for your reply<br>
Best<br>
Bert<br>
<br>
<br>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Insight-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Insight-users@itk.org">Insight-users@itk.org</a>
<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>