<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello Simon,<div><br></div><div>Can you please report this as &nbsp;a bug in the bug tracker:</div><div><br></div><div><a href="http://www.vtk.org/Wiki/ITK_Procedure_for_Contributing_Bug_Fixes#Entering_a_bug">http://www.vtk.org/Wiki/ITK_Procedure_for_Contributing_Bug_Fixes#Entering_a_bug</a></div><div><br></div><div>You can assign it to me also.</div><div><br></div><div>BTW, if you don't call "reader-&gt;Update()" I believe it would work.</div><div><br></div><div>Thanks,</div><div>Brad</div><div><br><div><div>On Mar 21, 2011, at 10:06 AM, Simon Rit wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi,<br>I have a problem with InPlaceImageFilter when using streaming. When I<br>connect the input of an InPlaceImageFilter to a filter that has been<br>updated and try to write the output of this filter with<br>SetNumberOfStreamDivisions set e.g. to 2, only the first half of the<br>filter is updated. I have written a simple test case to reproduce this<br>problem (using ITK 3.20):<br><br>////////////////////////////////////////////////////////////////////////////////////////<br>#include &lt;itkImageFileReader.h&gt;<br>#include &lt;itkImageFileWriter.h&gt;<br>#include &lt;itkMultiplyByConstantImageFilter.h&gt;<br><br>int main(int argc, char * argv[])<br>{<br> &nbsp;typedef double PixelType;<br> &nbsp;const unsigned int Dimension = 3;<br> &nbsp;typedef itk::Image&lt; PixelType, Dimension &gt; ImageType;<br><br> &nbsp;typedef itk::ImageFileReader&lt;ImageType&gt; ReaderType;<br> &nbsp;ReaderType::Pointer reader = ReaderType::New();<br> &nbsp;reader-&gt;SetFileName(argv[1]);<br> &nbsp;reader-&gt;Update();<br><br> &nbsp;typedef itk::MultiplyByConstantImageFilter&lt; ImageType, PixelType,<br>ImageType &gt; FilterType;<br> &nbsp;FilterType::Pointer filter = FilterType::New();<br> &nbsp;filter-&gt;SetInput(reader-&gt;GetOutput());<br> &nbsp;filter-&gt;SetConstant(0.);<br> &nbsp;filter-&gt;SetInPlace(atoi(argv[2]));<br><br> &nbsp;typedef itk::ImageFileWriter&lt; ImageType &gt; WriterType;<br> &nbsp;WriterType::Pointer writer = WriterType::New();<br> &nbsp;writer-&gt;SetInput(filter-&gt;GetOutput());<br> &nbsp;writer-&gt;SetFileName(argv[3]);<br> &nbsp;writer-&gt;SetNumberOfStreamDivisions(2);<br> &nbsp;writer-&gt;Update();<br><br> &nbsp;return EXIT_SUCCESS;<br>}<br>////////////////////////////////////////////////////////////////////////////////////////<br><br>To run this testPgm, compile it, use a test image input.mha and run<br>successively:<br>$ testPgm input.mha 0 output0.mha<br>$ testPgm input.mha 1 output1.mha<br>output0.mha and output1.mha should be the same but are not: only half<br>of output1.mha is set to 0 instead of the full image.<br><br>I believe that the reason is the test "if (bufferedRegion ==<br>largestRegion)" in itkImageFileWriter.txx. With InPlaceImageFilter,<br>the region might be buffered but only the requested region has been<br>updated...<br>Am I missing something? Is this a (known) bug? Any easy fix?<br>Obviously, I can disable the inplace capability but I believe this<br>should be fixed since it concerns many filters.<br>Thanks in advance for your help!<br>Simon<br><br>NB: &nbsp;I had similar problems with StreamingImageFilter but I did not<br>investigate where the problem was in this case.<br>_____________________________________<br>Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers ITK Training Courses, for more information visit:<br>http://www.kitware.com/products/protraining.html<br><br>Please keep messages on-topic and check the ITK FAQ at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to subscribe/unsubscribe:<br>http://www.itk.org/mailman/listinfo/insight-users<br></div></blockquote></div><br><div>
<span class="Apple-style-span" style="font-size: 12px; "><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">========================================================</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Bradley Lowekamp<span class="Apple-converted-space">&nbsp;</span><span class="Apple-converted-space">&nbsp;</span></font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font class="Apple-style-span" face="Arial"><span class="Apple-style-span" style="font-family: Arial; "><span class="Apple-style-span" style="font-family: Arial; ">Lockheed Martin&nbsp;</span></span></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Contractor for</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Office of High Performance Computing and Communications</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">National Library of Medicine<span class="Apple-converted-space">&nbsp;</span></font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a></font></p><br class="Apple-interchange-newline"></span>
</div>
<br></div></body></html>