Skip to content

Commit 43dc73c

Browse files
committed
Fix horizontal and vertical projection actions and update documentation
1 parent 121f03d commit 43dc73c

5 files changed

Lines changed: 51 additions & 46 deletions

File tree

datalab/gui/actionhandler.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,8 @@ def create_first_actions(self):
12261226

12271227
# MARK: ANALYSIS
12281228
with self.new_category(ActionCategory.ANALYSIS):
1229+
self.action_for("horizontal_projection", separator=True)
1230+
self.action_for("vertical_projection")
12291231
self.action_for("centroid", separator=True)
12301232
self.action_for("enclosing_circle")
12311233
self.new_action(
@@ -1236,25 +1238,11 @@ def create_first_actions(self):
12361238
)
12371239
self.action_for("contour_shape")
12381240
self.action_for("hough_circle_peaks")
1239-
12401241
with self.new_menu(_("Blob detection")):
12411242
self.action_for("blob_dog")
12421243
self.action_for("blob_doh")
12431244
self.action_for("blob_log")
12441245
self.action_for("blob_opencv")
1245-
#! Note projection onto horizontal axis means summing along vertical axis.
1246-
self.new_action(
1247-
_("Horizontal projection"),
1248-
# icon_name="horizontal_projection.svg",
1249-
tip=_("Sum pixels along vertical axis"),
1250-
separator=True,
1251-
)
1252-
#! Note projection onto vertical axis means summing along horizontal axis.
1253-
self.new_action(
1254-
_("Vertical projection"),
1255-
# icon_name="vertical_projection.svg",
1256-
tip=_("Sum pixels along horizontal axis"),
1257-
)
12581246

12591247
def create_last_actions(self):
12601248
"""Create actions that are added to the menus in the end"""

datalab/gui/processor/image.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -665,11 +665,22 @@ def register_computations(self) -> None:
665665
# MARK: ANALYSIS
666666
self.register_1_to_0(sigima_image.stats, _("Statistics"), icon_name="stats.svg")
667667
self.register_1_to_1(
668-
sigima_image.horizontal_projection, _("Sum pixels along vertical axis")
668+
sigima_image.horizontal_projection,
669+
_("Horizontal projection"),
670+
# icon_name="horizontal_projection.svg",
671+
comment=_(
672+
"Compute the sum of pixel intensities along each column "
673+
"(projection on the x-axis)"
674+
),
669675
)
670-
#! Note projection onto vertical axis means summing along horizontal axis.
671676
self.register_1_to_1(
672-
sigima_image.vertical_projection, _("Sum pixels along horizontal axis")
677+
sigima_image.vertical_projection,
678+
# icon_name="vertical_projection.svg",
679+
_("Vertical projection"),
680+
comment=_(
681+
"Compute the sum of pixel intensities along each row "
682+
"(projection on the y-axis)"
683+
),
673684
)
674685

675686
self.register_1_to_1(

datalab/locale/fr/LC_MESSAGES/datalab.po

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ msgid ""
66
msgstr ""
77
"Project-Id-Version: datalab\n"
88
"Report-Msgid-Bugs-To: p.raybaut@codra.fr\n"
9-
"POT-Creation-Date: 2025-09-08 21:20+0200\n"
9+
"POT-Creation-Date: 2025-09-09 15:45+0200\n"
1010
"PO-Revision-Date: 2025-05-22 15:46+0200\n"
1111
"Last-Translator: Christophe Debonnel <c.debonnel@codra.fr>\n"
1212
"Language: fr\n"
@@ -529,18 +529,6 @@ msgstr "Détection automatique de pics 2D"
529529
msgid "Blob detection"
530530
msgstr "Détection de taches"
531531

532-
msgid "Horizontal projection"
533-
msgstr "Projection horizontale"
534-
535-
msgid "Sum pixels along vertical axis"
536-
msgstr "Somme des pixels le long de l'axe vertical"
537-
538-
msgid "Vertical projection"
539-
msgstr "Projection verticale"
540-
541-
msgid "Sum pixels along horizontal axis"
542-
msgstr "Somme des pixels le long de l'axe horizontal"
543-
544532
msgid "Resize"
545533
msgstr "Redimensionner"
546534

@@ -1399,6 +1387,18 @@ msgstr "Rééchantillonnage"
13991387
msgid "Statistics"
14001388
msgstr "Statistiques"
14011389

1390+
msgid "Horizontal projection"
1391+
msgstr "Projection horizontale"
1392+
1393+
msgid "Compute the sum of pixel intensities along each column (projection on the x-axis)"
1394+
msgstr "Calcule la somme des intensités des pixels le long de chaque colonne (projection sur l'axe des x)"
1395+
1396+
msgid "Vertical projection"
1397+
msgstr "Projection verticale"
1398+
1399+
msgid "Compute the sum of pixel intensities along each row (projection on the y-axis)"
1400+
msgstr "Calcule la somme des intensités des pixels le long de chaque ligne (projection sur l'axe des y)"
1401+
14021402
msgid "Histogram"
14031403
msgstr "Histogramme"
14041404

@@ -2666,3 +2666,4 @@ msgstr "Merci de sélectionner le fichier à importer."
26662666

26672667
msgid "Example Wizard"
26682668
msgstr "Assistant exemple"
2669+

doc/features/image/menu_analysis.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ Parameters are:
6363

6464
Example of histogram.
6565

66+
Horizontal and vertical projections
67+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68+
69+
Compute horizontal and vertical projection profiles:
70+
71+
- Horizontal projection: Sum the pixel values along each row (projection on the x-axis).
72+
- Vertical projection: Sum the pixel values along each column (projection on the y-axis).
73+
6674
Centroid
6775
^^^^^^^^
6876

@@ -146,15 +154,6 @@ Blob detection (LOG)
146154
Blob detection (OpenCV)
147155
Detect blobs using OpenCV implementation of `SimpleBlobDetector <https://docs.opencv.org/3.4/d0/d7a/classcv_1_1SimpleBlobDetector.html>`_.
148156

149-
150-
Horizontal and vertical projections
151-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152-
153-
Sum the pixel values along the vertical or horizontal axis to obtain a projection
154-
profile. The horizontal projection is obtained by summing the pixel values along the
155-
vertical axis, while the vertical projection is obtained by summing the pixel values
156-
along the horizontal axis.
157-
158157
Show results
159158
^^^^^^^^^^^^
160159

doc/locale/fr/LC_MESSAGES/features/image/menu_analysis.po

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: DataLab \n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-07-26 18:32+0200\n"
11+
"POT-Creation-Date: 2025-09-09 15:45+0200\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language: fr\n"
@@ -85,6 +85,18 @@ msgstr "Limite supérieure de l'histogramme"
8585
msgid "Example of histogram."
8686
msgstr "Exemple d'histogramme."
8787

88+
msgid "Horizontal and vertical projections"
89+
msgstr "Projections horizontale et verticale"
90+
91+
msgid "Compute horizontal and vertical projection profiles:"
92+
msgstr "Calcule les profils de projection horizontale et verticale :"
93+
94+
msgid "Horizontal projection: Sum the pixel values along each row (projection on the x-axis)."
95+
msgstr "Projection horizontale : somme des valeurs des pixels le long de chaque ligne (projection sur l'axe des x)."
96+
97+
msgid "Vertical projection: Sum the pixel values along each column (projection on the y-axis)."
98+
msgstr "Projection verticale : somme des valeurs des pixels le long de chaque colonne (projection sur l'axe des y)."
99+
88100
msgid "Centroid"
89101
msgstr "Barycentre"
90102

@@ -178,12 +190,6 @@ msgstr "Détection de taches (OpenCV)"
178190
msgid "Detect blobs using OpenCV implementation of `SimpleBlobDetector <https://docs.opencv.org/3.4/d0/d7a/classcv_1_1SimpleBlobDetector.html>`_."
179191
msgstr "Détection de taches basée sur l'implémentation OpenCV de `SimpleBlobDetector <https://docs.opencv.org/3.4/d0/d7a/classcv_1_1SimpleBlobDetector.html>`_."
180192

181-
msgid "Horizontal and vertical projections"
182-
msgstr "Projections horizontale et verticale"
183-
184-
msgid "Sum the pixel values along the vertical or horizontal axis to obtain a projection profile. The horizontal projection is obtained by summing the pixel values along the vertical axis, while the vertical projection is obtained by summing the pixel values along the horizontal axis."
185-
msgstr "Somme les valeurs des pixels le long de l'axe horizontal ou vertical pour obtenir un profil de projection. La projection horizontale est obtenue en sommant les valeurs des pixels le long de l'axe vertical, tandis que la projection verticale est obtenue en sommant les valeurs des pixels le long de l'axe horizontal."
186-
187193
msgid "Show results"
188194
msgstr "Afficher les résultats"
189195

0 commit comments

Comments
 (0)