<br>Hi Somi, <br><br>1) Yes, if you are using iterators in order to process data from<br> and image, you must encapsulate such processing inside<br> a new ITK filter.<br><br> You may find useful to look at the following tutorial:<br>
<br><a href="http://www.na-mic.org/Wiki/images/b/bc/Insight-Writing-a-New-Filter.ppt">http://www.na-mic.org/Wiki/images/b/bc/Insight-Writing-a-New-Filter.ppt</a><br><br><br>2) You have a point, that if the pipeline end up being <br>
re-executed every time (due to the intermediate memory<br> release) then there is no advantage on using a pipeline<br> versus using a procedural approach with iterators.<br><br> but... there is no disadvantage either :-)<br>
<br> So, you could certainly go either way.<br><br> My suggestion will be to, at least, create a C++ class<br> that encapsulates the whole of your processing, and<br> then implement each one of the processing steps as<br>
methods of that larger class.<br><br> Sometimes we focus too much on the use of the <br> pipeline and forget that basic OOP and C++ offer<br> natural ways of organizing the code.<br><br><br><br> Regards<br>
<br><br> Luis<br><br>---------------------------------------------------------------------------------------------<br><div class="gmail_quote">On Thu, Apr 22, 2010 at 10:57 PM, somi <span dir="ltr"><<a href="mailto:seesomi@gmail.com">seesomi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Luis,<br>Thanks for your reply. It was very helpful.<br>My application has the following flow:<br>
<br>a)User specifies ROI interactively <br>b) Do segmentation in the specified region to get region A and B<br>c) Based on user specified thickness, label the boundary of the A and B as a new label C (of thickness specified by user)<br>
d) Visualize the segmentation<br><br>Currently I have set this up as a series of ITK and VTK filters. Note that due to size of dataset I release data on all filters, so the whole pipeline is re-executed every time.<br><br>
Currently I use neighborhood iterators for (c) . Should I wrap the functionality into a filter ?<br>As the whole pipeline is re-executed everytime, what would be the disadvantage of using iterators instead of a filter ?<br>
<br>Thanks,<br><font color="#888888">Somi</font><div><div></div><div class="h5"><br><br><br><div class="gmail_quote">On Thu, Apr 22, 2010 at 10:52 AM, Luis Ibanez <span dir="ltr"><<a href="mailto:luis.ibanez@kitware.com" target="_blank">luis.ibanez@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div><br>Hi Somi,<br><br>You may want to look at the example:<br><br>InsightApplications/QtITK/<br>CMakeLists.txt<br>itkQtAdaptor.h<br>itkQtLightIndicator.h<br>itkQtProgressBar.cxx<br>itkQtProgressBar.h<br>
qtITK.cxx<br><br><a href="http://www.itk.org/cgi-bin/viewcvs.cgi/QtITK/?root=InsightApplications" target="_blank">http://www.itk.org/cgi-bin/viewcvs.cgi/QtITK/?root=InsightApplications</a><br>
<br>It show how to update a Qt progress bar by <br>capturing progress events sent from an ITK<br>filter.<br><br>More specifically about your questions:<br><br><br>a) In order to integrate a single progress value <br> by composing the progress reported by each <br>
individual filter in a pipeline, you can use the<br> helper class:<br><br> Insight/Code/Common/<br> itkProgressAccumulator.h<br> itkProgressAccumulator.cxx<br><br> you need to register all the ITK filters with it<br>
and you must come up with a percentage of<br> how much each filter contributes to the total<br> progress of the pipeline.<br><br> For examples of use, look at any of the following<br> filters:<br><br> Insight/Code/BasicFilters/<br>
itkOpeningByReconstructionImageFilter.txx<br>itkOrientImageFilter.txx<br>itkSignedDanielssonDistanceMapImageFilter.txx<br>itkSignedMaurerDistanceMapImageFilter.txx<br>itkSmoothingRecursiveGaussianImageFilter.txx<br>itkZeroCrossingBasedEdgeDetectionImageFilter.txx <br>
<br><br>b) Since ITK and VTK are independent toolkits you <br> will have to write specific command observers for<br> each family of filters.<br><br> and you may have to write a customized Progress<br> Accumulator that can take contributions from both<br>
ITK and VTK. Strictly speaking the progress <br> accumulator doesn't even need to know that filters<br> are involved in the process. It just needs to know<br> about relative contributions of every stage of <br>
processing.<br><br><br>c) Why would you use iterators in the pipeline ?<br> <br> Iterators are usually hidden from the <br> view of mortals inside the protective <br> enclosure of filters :-)<br><br>
<br> Regards,<br><br><br> Luis<br> <br><br>-------------------------------------------------------------------<br></div></div><div class="gmail_quote"><div><div></div><div>On Tue, Apr 20, 2010 at 3:39 PM, somi <span dir="ltr"><<a href="mailto:seesomi@gmail.com" target="_blank">seesomi@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div>Hi,<br>I have a Qt based application where I load some image using ITK, do segmentation, extract subsurface and display using vtk.<br>
I need some help displaying the progress events.<br><br>I have connected the ITK and VTK pipelines . I want to show progress of individual as well as total progress in separate Qt progress bars.<br>
<br>a) How can I get the progress of the whole pipeline ? Do I have to use QProgressDialog progress + progress.setValue(n) +
qApp->processEvents(); manually setting value of n after every
filter ?<br>
<br>b) For individual filter progress update do I use two different classes one overriding itk::Command and other vtk::Command ? Do I have to use separate progress bar for ITK/VTK<br><br>c) What changes do I have to do if I use iterators in my pipeline ?<br>
<br><br>Thanks,<br><font color="#888888">Somi<br><br><br><br>
</font><br></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://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</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://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></div></blockquote></div><br>
</blockquote></div><br>
</div></div></blockquote></div><br>