[ITK] [ITK-users] itkConnectedThresholdImageFilter does not support Progress?
Bradley Lowekamp
blowekamp at mail.nih.gov
Mon Jun 8 15:13:23 EDT 2015
Please make sure you are compiling your code in Release mode. It can make over a 10X performance difference.
The median image filter is not fast for large regions. You may want to look into the FastApproximageRankImageFilter [1, 2], or just the RankImageFilter.
You can look at how The ConnectedThresholdImageFitler reports progress in the code [3]. It does as good of a job as possible reporting progress. It will go smoothly for the number of pixels in the region, then just at the end for the number of pixels not visited.
You may want to look into teh GrayscaleDilateImageFilter to do you binary morphology [4].
HTH,
Brad
[1] http://www.itk.org/Doxygen/html/classitk_1_1FastApproximateRankImageFilter.html
[2] http://www.insight-journal.org/browse/publication/160
[3] https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Segmentation/RegionGrowing/include/itkConnectedThresholdImageFilter.hxx#L268-L328
[4] http://www.itk.org/Doxygen/html/classitk_1_1GrayscaleDilateImageFilter.html
On Jun 8, 2015, at 2:34 PM, zagwin <zagwin at gmail.com> wrote:
> Hello,
>
> I made a minipipeline using MedianImageFilter,
> ConnectedThresholdImageFilter, and BinaryDilateImageFilter. My progress bar
> will increase from 0->0.5 slowly, and then stop 0.5 for a while, and jump to
> 0.75, and increase slowly to 1. So, I suppose the
> ConnectedThresholdImageFilter does not support progress. Am I right? or I
> made a mistake?
>
> In the ::GenerateData()
> {
>
> typename ProgressAccumulator::Pointer progress = ProgressAccumulator::New();
> progress->SetMiniPipelineFilter(this);
> //Get InputImage
> const typename TInput::ConstPointer inputImage( this->GetInput() );
>
> typedef itk::MedianImageFilter <InputImageType, InputImageType>
> MedianImageFilterType;
> typedef itk::ConnectedThresholdImageFilter <InputImageType, OutputImageType>
> ConnectedThresholdFilterType;
> typedef itk::BinaryBallStructuringElement <OutputImagePixelType,
> ImageDimension> StructuringElementType;
> typedef itk::BinaryDilateImageFilter <OutputImageType,
> OutputImageType, StructuringElementType> BinaryDilateFilterType;
>
> MedianImageFilterType::Pointer medianfilter =
> MedianImageFilterType::New();
> ConnectedThresholdFilterType::Pointer ccthreshold =
> ConnectedThresholdFilterType::New();
> BinaryDilateFilterType::Pointer bDilate =
> BinaryDilateFilterType::New();
>
> progress->RegisterInternalFilter(medianfilter,.5f);
> progress->RegisterInternalFilter(ccthreshold, .25f);
> progress->RegisterInternalFilter(bDilate, .25f);
>
> .......
> }
>
>
>
> --
> View this message in context: http://itk-users.7.n7.nabble.com/itkConnectedThresholdImageFilter-does-not-support-Progress-tp35782.html
> Sent from the ITK - Users mailing list archive at Nabble.com.
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20150608/5400ec9b/attachment-0001.html>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php
Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
More information about the Community
mailing list