Alejandro1400 / fluorophores_blinking_smlm

0 stars 0 forks source link

[feat] STORM Single Frame Localization #5

Closed Alejandro1400 closed 3 months ago

Alejandro1400 commented 3 months ago

The purpose of this feature is to enable single-frame localization of molecules using STORM (Stochastic Optical Reconstruction Microscopy) techniques, this works as a 'Test parameters' so that the parameter selection can be tuned before starting the video processing. By utilizing the first frame of the loaded image, a defined threshold for molecule detection, pixel resolution, and the diffraction limit, the system will localize all molecules present in the frame.

Feature Details

Input Parameters:
  1. First Frame: The initial image frame from which molecule localization is performed.
  2. Detection Threshold: The minimum intensity value considered for detecting a molecule.
  3. Pixel Resolution: The resolution of each individual pixel in the frame, measured in nanometers.
  4. Diffraction Limit: The minimum distance between light emissions from molecules that allows them to be considered as completely separated.
Functionality:
  1. Loading the First Frame:

    • The first frame is extracted from the loaded image sequence.
  2. Threshold Definition:

    • A user-defined detection threshold is used to identify potential molecules. Only pixels with intensity values above this threshold are considered for further analysis.
  3. Pixel Resolution:

    • This parameter defines the physical size of each pixel, aiding in the accurate localization of molecules within the frame.
  4. Diffraction Limit:

    • This value determines the minimum distance between two molecules' light emissions to ensure they are resolved as distinct entities.
  5. Localization Process:

    • The system iterates through each pixel in the frame.
    • For each pixel exceeding the detection threshold, its surrounding area is analyzed to refine the position estimate of the molecule.
    • This involves assessing the intensity values of neighboring pixels to determine the centroid of the molecule's emission.
UI Components:
  1. Detection Threshold Input:

    • Label: Det. Threshold:
    • Input Field: Numeric, with an option to be empty, initially set to invisible.
  2. Pixel Resolution Input:

    • Label: Pixel Res. (nm):
    • Input Field: Numeric, initially set to 100, initially set to invisible.
  3. Diffract. Limit Input:

    • Label: Diffract. Limit:
    • Input Field: Numeric, initially set to 200, initially set to visible.

Example Usage:

Expected Output:

Alejandro1400 commented 3 months ago

Implementation Details

To fulfill the feature requirements for single-frame localization of molecules using STORM techniques, the following steps were undertaken:

  1. Loading the First Frame:

    • The first frame of the loaded image sequence is extracted for analysis.
  2. Threshold Normalization:

    • The user-defined detection threshold is normalized based on the intensity values of the image. This ensures that only pixels with intensity values above the threshold are considered for molecule detection.
  3. Pixel Resolution and Diffraction Limit:

    • The pixel resolution is used to define the physical size of each pixel, and the diffraction limit determines the minimum distance between light emissions from molecules to ensure they are resolved as distinct entities.
  4. Localization Process:

    • The system iterates through each pixel in the frame.
    • For pixels exceeding the detection threshold, the surrounding area is analyzed to refine the position estimate of the molecule.
    • A search radius is calculated based on the diffraction limit and pixel resolution.
    • The intensity values of neighboring pixels are assessed to determine the centroid of the molecule's emission, ensuring accurate localization.
  5. Gaussian Fitting:

    • Gaussian fitting is applied to the local area around each detected molecule to further refine the position estimates.
    • This helps in accurately determining the centroid of the molecule's emission.
  6. Updating Maps:

    • Detection and checked maps are maintained to keep track of localized molecules and areas already processed.
    • These maps ensure that the same molecule is not detected multiple times and that the localization process is efficient.

Visualization:

The image below shows the result of the localization process. It displays the detected molecules overlaid on the first frame with their estimated positions marked.

STORM Single Frame Localization

In this example, 105 molecules were found and localized based on the detection threshold, pixel resolution, and diffraction limit parameters set by the user.