<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 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->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 <itkImageFileReader.h><br>#include <itkImageFileWriter.h><br>#include <itkMultiplyByConstantImageFilter.h><br><br>int main(int argc, char * argv[])<br>{<br> typedef double PixelType;<br> const unsigned int Dimension = 3;<br> typedef itk::Image< PixelType, Dimension > ImageType;<br><br> typedef itk::ImageFileReader<ImageType> ReaderType;<br> ReaderType::Pointer reader = ReaderType::New();<br> reader->SetFileName(argv[1]);<br> reader->Update();<br><br> typedef itk::MultiplyByConstantImageFilter< ImageType, PixelType,<br>ImageType > FilterType;<br> FilterType::Pointer filter = FilterType::New();<br> filter->SetInput(reader->GetOutput());<br> filter->SetConstant(0.);<br> filter->SetInPlace(atoi(argv[2]));<br><br> typedef itk::ImageFileWriter< ImageType > WriterType;<br> WriterType::Pointer writer = WriterType::New();<br> writer->SetInput(filter->GetOutput());<br> writer->SetFileName(argv[3]);<br> writer->SetNumberOfStreamDivisions(2);<br> writer->Update();<br><br> 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: 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"> </span><span class="Apple-converted-space"> </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 </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"> </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>