<div dir="ltr">Hello Brad,<br><div class="gmail_extra"><br></div><div class="gmail_extra">Thanks for your reply. I had check the UpdateOutputInformation() with a seperate test code and there was no problem. I found that there are multiple instances of Reader created in every execution of the my code which was the cause of the error/behaviour I was having.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_quote">On Thu, Aug 13, 2015 at 9:11 PM, Bradley Lowekamp <span dir="ltr"><<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hello Rashad,<div><br></div><div>If you call ImageFileReader::UpdateOutputInformation() 2 times is "should" only call GenerateOutputInformation once.</div><div><br></div><div>The key to this behavior is the management of the timestamps in the process object classes done here [1].</div><div><br></div><div>What is required for this to work correctly is that the only the correct object get modified in these pipeline methods. When an object is modified the timestamp should be updated, and downstream processes get marked as out of date.</div><div><br></div><div>The best way to make sure your ImageSource does not get call twice is to write a test, that makes sure the process object's MTime does not change in GenerateOutputInformation call.</div><div><br></div><div>HTH,</div><div>Brad</div><div><br></div><div>[1] <a href="https://github.com/InsightSoftwareConsortium/ITK/blob/9f88e4e3b388ee2f1c1c006ae36de0613d305284/Modules/Core/Common/src/itkProcessObject.cxx#L1431-L1542" target="_blank">https://github.com/InsightSoftwareConsortium/ITK/blob/9f88e4e3b388ee2f1c1c006ae36de0613d305284/Modules/Core/Common/src/itkProcessObject.cxx#L1431-L1542</a></div><div><br><div><div><div><div class="h5"><div>On Aug 13, 2015, at 2:55 PM, Rashad M <<a href="mailto:mohammedrashadkm@gmail.com" target="_blank">mohammedrashadkm@gmail.com</a>> wrote:</div><br></div></div><blockquote type="cite"><div><div class="h5"><div dir="ltr">Hello all,<div><br></div><div>The documentation of itk::ProcessObject::GenerateOutputInformation( ) says</div><div><span style="font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:12px;line-height:22px">Generate the information describing the output data. [1]. The </span>GenerateOutputInformation() in itkImageFileReader first create all instances of ImageIO and setup direction, spacing, etc.. </div><div><br></div><div>If I understand correctly, the GenerateOutputInformation in the image file reader is called by UpdateOutputInformation( )</div><div><br></div><div>To my question, </div><div>If I call reader->UpdateOutputInformation() for first time it calls </div><div>reader->GenerateOutputInformation() as described in docs[2]. </div><div><br></div><div>Now If I have a second call to reader->UpdateOutputInformation( ) ?</div><div><br></div><div>Will it again go to GenerateOutputInformation() and createAllInstances of imageio , do the same thing again!</div><div><br></div><div>In itkProcessObject.cxx, there is the below documentation</div><div><br></div><div><div> * Call GenerateOutputInformation for subclass specific information.</div><div> * Since UpdateOutputInformation propagates all the way up the pipeline,</div><div> * we need to be careful here to call GenerateOutputInformation only if</div><div> * necessary. Otherwise, we may cause this source to be modified which</div><div> * will cause it to execute again on the next update.</div></div><div><br></div><div>How can I prevent it from calling it again in class sub class of itk::ImageSource?</div><div><br></div><div><font face="Lucida Grande, Verdana, Geneva, Arial, sans-serif"><span style="font-size:12px;line-height:22px">[1]<a href="http://www.itk.org/Doxygen/html/classitk_1_1ProcessObject.html#abe61fb6b7de8c443e7af1561bd722736" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1ProcessObject.html#abe61fb6b7de8c443e7af1561bd722736</a></span></font><br></div><div><font face="Lucida Grande, Verdana, Geneva, Arial, sans-serif"><span style="font-size:12px;line-height:22px"><br></span></font></div><div><div><br></div>-- <br><div><font face="arial, helvetica, sans-serif">Regards,<br> Rashad</font></div>
</div></div></div></div>
_______________________________________________<br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers ITK Training Courses, for more information visit:<br><a href="http://kitware.com/products/protraining.php" target="_blank">http://kitware.com/products/protraining.php</a><br><br>Please keep messages on-topic and check the ITK FAQ at:<br><a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://public.kitware.com/mailman/listinfo/insight-developers" target="_blank">http://public.kitware.com/mailman/listinfo/insight-developers</a><br></blockquote></div><br></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div><font face="arial, helvetica, sans-serif">Regards,<br> Rashad</font></div></div>
</div></div>