Remove uniform background noise from image

Hi, I have been using Igor fro a year and recently I'm trying to use Igor analysis some images. What I have are some images with noise(saying I have a bunch of 2D matrix. noise pixels has values about 5000, and good pixels has values about 20000~50000). I want to find a build-in function which can set all pixels, whose value is smaller than 10000, to 0. Of course I can write a for loop to do that, but I think Igor should have a build-in function which can do it faster.

Does anyone know how to do that?

I found there are some build-in function like ImageRemoveBackground can do similar stuff. The example in tutorial shows it can remove a non-uniform back ground. But why there is no example show more common and easier example -- how to remove an uniform background.

I like Igor for many reasons but there is one thing I think Igor can improve and it puzzles me for a very long time. There are few example examples in the tutorial, and even if there was, the example is a very complex one, which is very uncommon and very hard for starter to understand
Dahair wrote:
(...snip) I want to find a build-in function which can set all pixels, whose value is smaller than 10000, to 0. Of course I can write a for loop to do that, but I think Igor should have a build-in function which can do it faster.

Does anyone know how to do that?


MyImage[][] = MyImage[p][q] < 10000 ? 0 : MyImage[p][q]

If the pixel at (p,q) < 10000 it will be set to 0 otherwise it will retain its current value.

Enter DisplayHelpTopic "Operators" on the Igor command line (in the history window) to open an Igor help window on the topic of operators. Scroll down about 5 or so paragraphs for info on the conditional operator.

Quote:
MyImage[][] = MyImage[p][q] < 10000 ? 0 : MyImage[p][q]


This is equivalent to:
MyImage = MyImage < 10000 ? 0 : MyImage


Another way to do it:
MyImage *= MyImage >= 10000   // Multiplies by 1 if MyImage>=10000, by 0 otherwise


Help topic of interest:
DisplayeHelpTopic "Multidimensional Wave Indexing"

Dahair wrote:

Does anyone know how to do that?


There are a couple of simplified responses here that show you how to reset values of pixels in appropriate range. Related to this is the ImageThreshold operation. I suggest that you take a look at that because it would allow you to reset pixels in multiple ranges.
Quote:
I like Igor for many reasons but there is one thing I think Igor can improve and it puzzles me for a very long time. There are few example examples in the tutorial, and even if there was, the example is a very complex one, which is very uncommon and very hard for starter to understand


Have you tried the Image Processing Tutorial (File Menu->Example Experiments->Tutorials)? It takes you from very simple image operations to relatively complex tasks.

A.G.
WaveMetrics, Inc.