[Insight-users] Pixels greater than 0 in an image

Luis Ibanez luis.ibanez at kitware.com
Tue May 13 15:35:36 EDT 2008


Hi Suyang,

After looking at the code of the itkOtsuThresholdImageCalculator.txx
the simplest solution seems to be insert an "infamous" if statement
in line 97, inside the while loop of the iterator, something like:

    if( value <= 0 )
      {
      ++iter;
      continue;
      }


and also in line 72 add:

    if( imageMin < 0 )
      {
      imageMin;
      }


You could generalize this to any given value K (instead of zero),
modify the name of the otsu threshold calculator class, and submit it
as a contribution to the Insight Journal, or submit it as a feature
request to the bug tracker.


Just to clarify,:what we are suggesting is that you modify your local
copy of the itkOtsuThresholdImageCalculator class, in order to add
this functionality. Renaming the files will help you have access to
the new class as well as to the current ITK implementation.


    Regards,


        Luis


-------------------
Suyang Mei wrote:
> Hi, ITK experts -
>  
>   I have a simple question, just want to get some advice from  -
>  
>  I have an image, and I want to calculate the Ostu threshold only using 
> the positive pixels in the image.
>  
>   What is the best way to proceed?
>  
>   Thanks a lot in advance.
>  
> Suyang
>   
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list