[Insight-users] Quickly get the Number of points ofConnectedThresholdImageFilter's output

jerry z 65104355 at qq.com
Thu Jun 6 11:56:33 EDT 2013


Thank you!


------------------ Original ------------------
From:  "Bradley Lowekamp [via ITK - Users]"<ml-node+s7n31648h80 at n7.nabble.com>;
Date:  Thu, Jun 6, 2013 08:59 PM
To:  "zlf"<65104355 at qq.com>; 

Subject:  Re: Quickly get the Number of points ofConnectedThresholdImageFilter's output



 	Hello, 

I appears that you are using WrapITK perhaps in JAVA? 

You are not going to get good ITK iterator performance in that wrapped environment to perform efficient small operations per pixel. You should try to used existing algorithms and filters. 


You could use the LabelStatisticsImageFilter: 

http://www.itk.org/Doxygen/html/classitk_1_1LabelStatisticsImageFilter.html

You can use the StatisticsImageFilter: 

http://www.itk.org/Doxygen/html/classitk_1_1StatisticsImageFilter.html

Or the BinaryImageToStatisticsLabelMapFilter: 

http://www.itk.org/Doxygen/html/classitk_1_1BinaryImageToStatisticsLabelMapFilter.html



On Jun 6, 2013, at 5:19 AM, jerry z <[hidden email]> wrote: 

> Hi all, 
> I need to know the number of points ConnectedThresholdImageFilter's output 
> contains. 
>  
> I am trying to get that from: 
>  
>            itk.itkImageRegionIterator_ISS3 iterator = new 
> itkImageRegionIterator_ISS3( 
>                connectedThresholdOutput, 
>                connectedThresholdOutput.LargestPossibleRegion); 
>  
>            int count = 0; 
>            for (iterator.GoToBegin(); !iterator.IsAtEnd; iterator++) 
>            { 
>                short value = iterator.Get().ValueAsSS; 
>                if (value == 1) 
>                { 
>                    count++; 
>                } 
>            } 
>  
> But it tooks 2 seconds while ConnectedThresholdImageFilter.GetOutput only 
> took 153ms. 
> Is there a faster way? 
>  
> Regards, 
>  
> Jerry 
>  
>  
>  
> -- 
> View this message in context: http://itk-users.7.n7.nabble.com/Quickly-get-the-Number-of-points-of-ConnectedThresholdImageFilter-s-output-tp31646.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://www.itk.org/mailman/listinfo/insight-users

_____________________________________ 
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://www.itk.org/mailman/listinfo/insight-users
 	 	 	 	
 	
 	
 	 		If you reply to this email, your message will be added to the discussion below:
 		http://itk-users.7.n7.nabble.com/Quickly-get-the-Number-of-points-of-ConnectedThresholdImageFilter-s-output-tp31646p31648.html 	
 	 		 		To unsubscribe from Quickly get the Number of points of ConnectedThresholdImageFilter's output, click here.
 		NAML



--
View this message in context: http://itk-users.7.n7.nabble.com/Re-Quickly-get-the-Number-of-points-ofConnectedThresholdImageFilter-s-output-tp31658.html
Sent from the ITK - Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130606/37827306/attachment-0001.htm>


More information about the Insight-users mailing list