| 1 |
.. _ima-menu-analysis: |
| 2 |
|
| 3 |
Analysis features on Images |
| 4 |
============================ |
| 5 |
|
| 6 |
This section describes the image analysis features available in DataLab. |
| 7 |
|
| 8 |
.. seealso:: |
| 9 |
|
| 10 |
:ref:`ima-menu-operations` for more information on operations that can be performed |
| 11 |
on images, or :ref:`ima-menu-processing` for information on processing features on |
| 12 |
images. |
| 13 |
|
| 14 |
.. figure:: /images/shots/i_analysis.png |
| 15 |
|
| 16 |
Screenshot of the "Analysis" menu. |
| 17 |
|
| 18 |
When the "Image Panel" is selected, the menus and toolbars are updated to |
| 19 |
provide image-related actions. |
| 20 |
|
| 21 |
The "Analysis" menu allows you to perform various computations on the current |
| 22 |
image or group of images. It also allows you to compute statistics, to compute |
| 23 |
the centroid, to detect peaks, to detect contours, and so on. |
| 24 |
|
| 25 |
.. note:: |
| 26 |
|
| 27 |
In DataLab vocabulary, an "analysis" is a feature that computes a scalar |
| 28 |
result from an image. This result is stored as metadata, and thus attached |
| 29 |
to image. This is different from a "processing" which creates a new image |
| 30 |
from an existing one. |
| 31 |
|
| 32 |
Statistics |
| 33 |
^^^^^^^^^^ |
| 34 |
|
| 35 |
Compute statistics on selected image and show a summary table. |
| 36 |
|
| 37 |
.. figure:: /images/shots/i_stats.png |
| 38 |
|
| 39 |
Example of statistical summary table: each row is associated to an ROI |
| 40 |
(the first row gives the statistics for the whole data). |
| 41 |
|
| 42 |
Histogram |
| 43 |
^^^^^^^^^ |
| 44 |
|
| 45 |
Compute histogram of selected image and show it in the Signal Panel. |
| 46 |
|
| 47 |
Parameters are: |
| 48 |
|
| 49 |
.. list-table:: |
| 50 |
:header-rows: 1 |
| 51 |
:widths: 25, 75 |
| 52 |
|
| 53 |
* - Parameter |
| 54 |
- Description |
| 55 |
* - Bins |
| 56 |
- Number of bins |
| 57 |
* - Lower limit |
| 58 |
- Lower limit of the histogram |
| 59 |
* - Upper limit |
| 60 |
- Upper limit of the histogram |
| 61 |
|
| 62 |
.. figure:: /images/shots/i_histogram.png |
| 63 |
|
| 64 |
Example of histogram. |
| 65 |
|
| 66 |
Intensity profiles |
| 67 |
^^^^^^^^^^^^^^^^^^ |
| 68 |
|
| 69 |
Line profile |
| 70 |
~~~~~~~~~~~~ |
| 71 |
|
| 72 |
Extract an horizontal or vertical profile from each selected image, and create |
| 73 |
new signals from these profiles. |
| 74 |
|
| 75 |
.. figure:: /images/shots/i_profile.png |
| 76 |
|
| 77 |
Line profile dialog. Parameters may also be set manually |
| 78 |
("Edit profile parameters" button). |
| 79 |
|
| 80 |
Segment profile |
| 81 |
~~~~~~~~~~~~~~~ |
| 82 |
|
| 83 |
Extract a segment profile from each selected image, and create new signals |
| 84 |
from these profiles. |
| 85 |
|
| 86 |
Average profile |
| 87 |
~~~~~~~~~~~~~~~ |
| 88 |
|
| 89 |
Extract an horizontal or vertical profile averaged over a rectangular area, from |
| 90 |
each selected image, and create new signals from these profiles. |
| 91 |
|
| 92 |
.. figure:: /images/shots/i_profile_average.png |
| 93 |
|
| 94 |
Average profile dialog: the area is defined by a rectangle shape. |
| 95 |
Parameters may also be set manually ("Edit profile parameters" button). |
| 96 |
|
| 97 |
Radial profile extraction |
| 98 |
~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 99 |
|
| 100 |
Extract a radial profile from each selected image, and create new signals from |
| 101 |
these profiles. |
| 102 |
|
| 103 |
The following parameters are available: |
| 104 |
|
| 105 |
.. list-table:: |
| 106 |
:header-rows: 1 |
| 107 |
:widths: 25, 75 |
| 108 |
|
| 109 |
* - Parameter |
| 110 |
- Description |
| 111 |
* - Center |
| 112 |
- Center around which the radial profile is computed: centroid, image center, or user-defined |
| 113 |
* - X |
| 114 |
- X coordinate of the center (if user-defined), in pixels |
| 115 |
* - Y |
| 116 |
- Y coordinate of the center (if user-defined), in pixels |
| 117 |
|
| 118 |
Horizontal and vertical projections |
| 119 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 120 |
|
| 121 |
Compute horizontal and vertical projection profiles: |
| 122 |
|
| 123 |
- Horizontal projection: Sum the pixel values along each row (projection on the x-axis). |
| 124 |
- Vertical projection: Sum the pixel values along each column (projection on the y-axis). |
| 125 |
|
| 126 |
Centroid |
| 127 |
^^^^^^^^ |
| 128 |
|
| 129 |
Compute the centroid of the image using a robust adaptive algorithm. |
| 130 |
|
| 131 |
DataLab uses the :py:func:`sigima.tools.image.get_centroid_auto` function to estimate |
| 132 |
the image centroid. |
| 133 |
|
| 134 |
This function combines the robustness of a Fourier-based approach |
| 135 |
(as discussed by `Weisshaar et al. <http://www.mnd-umwelttechnik.fh-wiesbaden.de/pig/weisshaar_u5.pdf>`_) |
| 136 |
with fallback mechanisms designed to handle pathological cases, such as: |
| 137 |
|
| 138 |
- truncated or asymmetric shapes, |
| 139 |
- off-center objects, |
| 140 |
- strong background noise. |
| 141 |
|
| 142 |
Internally, :py:func:`sigima.tools.image.get_centroid_auto` compares the |
| 143 |
Fourier result with two alternative estimators (a projected profile-based method |
| 144 |
:py:func:`sigima.tools.image.get_projected_profile_centroid` and a standard centroid |
| 145 |
from `scikit-image`), and selects the most consistent one. |
| 146 |
|
| 147 |
This strategy ensures accurate and stable results across a wide range |
| 148 |
of image types — from clean laboratory data to noisy or partial acquisitions. |
| 149 |
|
| 150 |
Minimum enclosing circle center |
| 151 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 152 |
|
| 153 |
Compute the circle contour enclosing image values above |
| 154 |
a threshold level defined as the half-maximum value. |
| 155 |
|
| 156 |
2D peak detection |
| 157 |
^^^^^^^^^^^^^^^^^ |
| 158 |
|
| 159 |
Automatically find peaks on image using a minimum-maximum filter algorithm. |
| 160 |
|
| 161 |
.. figure:: /images/shots/i_peak2d_test.png |
| 162 |
|
| 163 |
Example of 2D peak detection. |
| 164 |
|
| 165 |
.. seealso:: |
| 166 |
See :ref:`ref-to-2d-peak-detection` for more details on algorithm and associated parameters. |
| 167 |
|
| 168 |
Contour detection |
| 169 |
^^^^^^^^^^^^^^^^^ |
| 170 |
|
| 171 |
Automatically extract contours and fit them using a circle or an ellipse, |
| 172 |
or directly represent them as a polygon. |
| 173 |
|
| 174 |
.. figure:: /images/shots/i_contour_test.png |
| 175 |
|
| 176 |
Example of contour detection. |
| 177 |
|
| 178 |
.. seealso:: |
| 179 |
See :ref:`ref-to-contour-detection` for more details on algorithm and associated parameters. |
| 180 |
|
| 181 |
.. note:: Computed scalar results are systematically stored as metadata. |
| 182 |
Metadata is attached to image and serialized with it when exporting |
| 183 |
current session in a HDF5 file. |
| 184 |
|
| 185 |
Circle Hough transform |
| 186 |
^^^^^^^^^^^^^^^^^^^^^^ |
| 187 |
|
| 188 |
Detect circular shapes using circle Hough transform |
| 189 |
(implementation based on `skimage.transform.hough_circle_peaks <https://scikit-image.org/docs/stable/api/skimage.transform.html?highlight=hough#skimage.transform.hough_circle_peaks>`_). |
| 190 |
|
| 191 |
.. _ima-blob-detection: |
| 192 |
|
| 193 |
Blob detection |
| 194 |
^^^^^^^^^^^^^^ |
| 195 |
|
| 196 |
Blob detection (DOG) |
| 197 |
Detect blobs using Difference of Gaussian (DOG) method |
| 198 |
(implementation based on `skimage.feature.blob_dog <https://scikit-image.org/docs/stable/api/skimage.feature.html#blob-dog>`_). |
| 199 |
|
| 200 |
Blob detection (DOH) |
| 201 |
Detect blobs using Determinant of Hessian (DOH) method |
| 202 |
(implementation based on `skimage.feature.blob_doh <https://scikit-image.org/docs/stable/api/skimage.feature.html#blob-doh>`_). |
| 203 |
|
| 204 |
Blob detection (LOG) |
| 205 |
Detect blobs using Laplacian of Gaussian (LOG) method |
| 206 |
(implementation based on `skimage.feature.blob_log <https://scikit-image.org/docs/stable/api/skimage.feature.html#blob-log>`_). |
| 207 |
|
| 208 |
Blob detection (OpenCV) |
| 209 |
Detect blobs using OpenCV implementation of `SimpleBlobDetector <https://docs.opencv.org/3.4/d0/d7a/classcv_1_1SimpleBlobDetector.html>`_. |
| 210 |
|
| 211 |
.. note:: |
| 212 |
**Automatic ROI creation for detection features** |
| 213 |
|
| 214 |
All detection features (2D peak detection, contour detection, circle Hough |
| 215 |
transform, and blob detection) support automatic ROI creation around detected |
| 216 |
objects. This feature: |
| 217 |
|
| 218 |
- Creates rectangular or circular ROIs around each detected feature |
| 219 |
- Automatically sizes ROIs based on minimum distance between detections |
| 220 |
- Requires at least 2 detected objects to determine appropriate ROI size |
| 221 |
- Enables subsequent processing on individual detected regions |
| 222 |
|
| 223 |
To use this feature, enable "Create regions of interest" in the detection |
| 224 |
parameters dialog and choose the desired ROI geometry. |
| 225 |
|
| 226 |
Show results |
| 227 |
^^^^^^^^^^^^ |
| 228 |
|
| 229 |
Show the results of all analyses performed on the selected images. This shows the |
| 230 |
same table as the one shown after having performed a computation. |
| 231 |
|
| 232 |
Results label |
| 233 |
^^^^^^^^^^^^^ |
| 234 |
|
| 235 |
Toggle the visibility of result labels on the plot. When enabled, this checkable |
| 236 |
menu item displays result annotations (such as centroid markers, detected contours, |
| 237 |
blob circles, or other analysis shapes) directly on the image plot. |
| 238 |
|
| 239 |
This option is synchronized between Signal and Image panels and persists across |
| 240 |
sessions. It is only enabled when results are available for the selected image. |
| 241 |
|
| 242 |
Plot results |
| 243 |
^^^^^^^^^^^^ |
| 244 |
|
| 245 |
Plot the results of analyses performed on the selected images, with user-defined |
| 246 |
X and Y axes (e.g. plot the contour circle radius as a function of the image number). |