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

Luis Ibanez luis.ibanez at kitware.com
Tue May 13 18:02:38 EDT 2008


Hi Suyang,

You are probably right in that there are other placed in the code
that need to be modified.

The other alternatives that came to mind were related to using the
IntensityWindowingImageFilter in order to make all your negative pixels
to be set to zero, but I'm afraid that this will overpopulate the
histogram bin of the zero value, and shift the Otsu threshold from
the value that you would obtain by simply ignoring all negative values.


There must be many other options that are simply escaping me now...



                 Suggestions anyone ??



    Thanks


       Luis


--------------------
Suyang Mei wrote:
>   Thanks a lot, Luis, for your prompt response and goog suggestions.
>  
>   I looked into the code itkOtsuThresholdImageCalculator.txx, besides 
> the two places you pointed out need to change, I guess there are other 
> places need to modify, like totalPixels, imageMin, these numbers will be 
> different from with 0s and without 0s.
>  
>   Definitely it is a way to solve my problem, just wonder if there are 
> any other alternative ways to go...
>  
>   Thanks again for you rhelp.
>  
> Suyang
> 
> */Luis Ibanez <luis.ibanez at kitware.com>/* wrote:
> 
> 
>     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