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

jerry z 65104355 at qq.com
Thu Jun 6 05:19:50 EDT 2013


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.


More information about the Insight-users mailing list