A plugin for point detecting in JI
This project is maintained by kilianna
Background Remover (BGR) is a plugin for the ImageJ platform that helps analyze fluorescence microscopy images with low signal-to-noise ratios and complex backgrounds.
BGR uses a special algorithm to separate signal from noise, preserving the real signal while removing background interference. This improves the detection of variable brightness objects in poor imaging conditions. BGR also provides accurate intensity measurements of detected objects, making it useful for researchers needing quantitative analysis.
To use the microscope image processing plugin for separating signal from noise, follow these steps:
After restarting, you will find the plugin easily accessible in the drop-down menu under
ImageJ: Plugins -> Background Remover.
The file must be imported as either a single image or a stack. It is required that the image (or stack) is in 16-bit grayscale format. By default, the plugin is run for the active window.
Main window
The program offers two modes: automatic and manual. In automatic mode, you can either enter specific parameters into individual fields or load a previously saved set of parameters (referred to as a “Preset”). After clicking OK button, the program automatically searches for points and displays the resulting image in a new window. To switch to manual mode, click the Interactive Parameters Tuning button located in the upper left corner of the window.
Interactive parameters tuning button
The plugin adds annotations about the operations performed on the file, which can be viewed by selecting Image -> Show Info….
Example of annotations
Please note that, due to the specific nature of ImageJ, annotations are displayed in a random order. They should be read in accordance with the numbering indicated in square brackets.
The automatic mode is easy to use and performs transformations based on user-provided parameters. These parameters can be entered manually or loaded from a file.
To create a new preset, select the [New preset] option from the Presets drop-down list. After filling in all the required fields with the desired parameters, click the Save button. A new window will appear, prompting you to name the preset you are saving. Once you have chosen and confirmed a name, the newly created preset will appear in the preset drop-down list at the top of the window.
To access an existing preset, simply select it from the Presets drop-down list. You can update an existing preset and save the changes by clicking the Save button again. To load the most recently used preset, select [Recently used] from the drop-down list. If you wish to delete a preset, you can do so by clicking the Delete button.
Presets list
Preliminary parameters determine the size of the scanning window and the approximate size of objects in the image.
Preliminary parameters section
These parameters include:
To separate the signal from the noise, the program uses an appropriately adjusted discrimination line represented by the following equation: \(y = a*x+b\)
Discrimination line parameters section
If these parameters are unknown, they should be established in manual mode.
Output parameters section
Points - points display options available in the drop-down list:
Signal points types list
If one of the Net signal options is selected, two additional fields will appear for setting parameters:
Net signal parameters explanation
Net signal parameters
When one of the three versions of Net signal is selected, the Output scale option can also be chosen. Selecting Original preserves the original scale, while Scaled adjusts the pixel values to cover the entire display range, increasing the contrast of the image. However, it’s important to note that using the Scaled option can alter both the absolute and relative relationships between individual pixel values. Therefore, it is recommended to use this option mainly for visual purposes.
Comparison of scaled and nonscaled images. From left: nonscaled and scaled image.
Background types list
Additional options:
In manual mode, you can optimize both the input parameters and, most importantly, the parameters of the discrimination line. Manual mode operates on the currently active image or the active image in a stack. To switch to manual mode, click the “Interactive Parameters Tuning” button located in the upper right corner of the window.
Interactive parameters mode button
After pressing this button, the plugin automatically enters manual mode and opens two additional windows: Preview and Discrimination plot.
Manual mode - main window
In the manual mode window, you will see that the “Interactive Parameters Tuning” button has been replaced by the “Profile plot window” button. This new button opens an additional window that displays profiles for individual pixels. Additionally, in the Discrimination line parameters section, there are new options related to curve fitting, including an Auto fitting feature.
Preview window
The Preview window displays two stacked images. The first image presents a preview of the predicted result, while the second image shows the original input image. This setup enables a real-time comparison between the input and output images.
The Discrimination Plot window initially features only a chart template, which is used to define the parameters for the discrimination line.
Empty plot window
In the main Parameters window, input the initial conditions under Preliminary parameters:
Select the areas in the image that you consider to be part of the background. Be sure not to include any parts related to the signal you want to isolate. It’s best to choose areas with a variety of intensities, particularly those close to the signal.
The default selection tool in ImageJ for choosing background areas is the oval tool. However, you can switch to other selection tools, such as the rectangle, polygon, or freehand selections. You can use different tools for different areas of the image. To select multiple areas, simply hold down the SHIFT key while making your selections. You can move a previously selected area using the mouse, and to delete any selected background areas, use the right ALT key. Additionally, you can access the tools from Edit -> Selection.
In the Preview window, you can select the background in both the original image and the preview image.
Sample image with the selected background
The chosen background points will be displayed on the plot in Discrimination plot window as blue circles.
Background pixels plotted on the graph (blue points)
Background pixels selected in the image transferred to the chart
To switch from background selection mode to point selection mode, click the Points Selection button in the Preview window. When you do this, any selected background areas will disappear. To return to background selection mode, simply click the Background Selection button.
You can select points using the Multi-Point tool in ImageJ. After marking the points, you can move them using your mouse. To delete a selected point, hold down the left or right ALT key while clicking on it. Similar to background selection, points can be selected in both the original image and the preview.
Sample image with the selected signal pixels
The graph in Discrimination plot window will show red circles that correspond to the selected points in the image. The numbers on the image will match those on the chart, allowing for any necessary adjustments.
Signal pixels plotted on the graph (red points)
To accurately define object boundaries, it is advisable to mark pixels near the object’s edge.
Example of marking a point on the boundary of an object
After selecting both the background and the signal in the Preview window, you can view the corresponding points on the graph. These points can be used to draw a discrimination line, which is represented by a yellow line on the chart. You can adjust the position and slope of the curve using your mouse. Alternatively, you can enter specific numerical values for the line’s parameters in the Parameters window. The equation of a straight line is:
\[y = a*x+b\]The second method is especially useful when a specific slope is needed for the adjusted discrimination line.
The third option is to use one of the three buttons in the Preview window in the Discrimination line section:
The slope coefficient of the discrimination line can be fixed by checking the Fix slope checkbox.
To enable automatic adjustment of discrimination line parameters, a minimum of 5 signal points and 10 noise points must be marked on the graph. Additionally, the signal and noise points should be in similar Mean surrounding intensity. If the discrimination line cannot be automatically adjusted, the plugin will display an appropriate message.
Discrimination line fitted using Below points button
Discrimination line fitted using Middle button
Discrimination line fitted using Above noise button
The final stage involves determining the output parameters, specifically how signal points and background are represented in the output image. Here are examples of various options for displaying the same resulting image. It’s important to note that not all methods allow for the preservation of the nominal signal intensity.
White points on black background preview
Black points on white background preview
The original intensity of signal points on the black background preview
Intensity of points showing the degree of matching of signal points on black background preview
Net signal of points (using median) on black background preview
In manual mode, you can view histograms for individual signals and background pixels that are marked on the graph. To access this feature, click the Profile Plot Window button located in the upper left corner of the Parameters window. A new Pixels surrounding intensity profile window will open, displaying the profiles of selected signal pixels in red (up to a maximum of 10) and the background profiles in blue (also up to 10 pixels). A light blue vertical line indicates the point from which the pixel’s surroundings are measured. The maximum value on the X-axis represents the size of the scanning window.
For detailed information on how these profiles are calculated, please refer to the publication.
Example of Pixel surrounding intensity profile window