| 1 |
# SOME DESCRIPTIVE TITLE. |
| 2 |
# Copyright (C) 2023, DataLab Platform Developers |
| 3 |
# This file is distributed under the same license as the DataLab package. |
| 4 |
# FIRST AUTHOR <EMAIL@ADDRESS>, 2024. |
| 5 |
# |
| 6 |
#, fuzzy |
| 7 |
msgid "" |
| 8 |
msgstr "" |
| 9 |
"Project-Id-Version: DataLab \n" |
| 10 |
"Report-Msgid-Bugs-To: \n" |
| 11 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
| 12 |
"Language: fr\n" |
| 13 |
"Language-Team: fr <[email protected]>\n" |
| 14 |
"Plural-Forms: nplurals=2; plural=(n > 1);\n" |
| 15 |
"MIME-Version: 1.0\n" |
| 16 |
"Content-Type: text/plain; charset=utf-8\n" |
| 17 |
"Content-Transfer-Encoding: 8bit\n" |
| 18 |
"Generated-By: Babel 2.17.0\n" |
| 19 |
|
| 20 |
msgid "Tutorial on how to prototype a custom image processing pipeline using DataLab (macro, plugin, external IDE, Jupyter notebook)" |
| 21 |
msgstr "Tutoriel: prototyper une chaîne de traitement d'image avec DataLab (macro, plugin, IDE externe, notebook Jupyter)" |
| 22 |
|
| 23 |
msgid "DataLab, custom function, macro-command, plugin, image processing, prototype, Spyder, Jupyter" |
| 24 |
msgstr "DataLab, fonction personnalisée, macro-commande, plugin, traitement d'image, prototype, Spyder, Jupyter" |
| 25 |
|
| 26 |
msgid ":octicon:`book;1em;sd-text-info` Prototyping a custom processing pipeline" |
| 27 |
msgstr ":octicon:`book;1em;sd-text-info` Prototypage d'une chaîne de traitement personnalisée" |
| 28 |
|
| 29 |
msgid "For your specific application, it is possible that you will need a function that is not available in DataLab by default. In this case, you can define your own function and integrate it in DataLab to conveniently analyze your data. DataLab has been designed to be flexible and extensible, and the goal of this tutorial is to show you how to do that." |
| 30 |
msgstr "Pour votre application spécifique, il est possible que vous ayez besoin d'une fonction qui n'est pas disponible dans DataLab par défaut. Dans ce cas, vous pouvez définir votre propre fonction et l'intégrer dans DataLab pour analyser vos données de manière pratique. DataLab a été conçu pour être flexible et extensible, et le but de ce tutoriel est de vous montrer comment faire cela." |
| 31 |
|
| 32 |
msgid "This example shows how to prototype a custom image processing pipeline using DataLab:" |
| 33 |
msgstr "Cet exemple montre comment prototyper une chaîne de traitement d'image personnalisée en utilisant DataLab :" |
| 34 |
|
| 35 |
msgid "Define a custom processing function" |
| 36 |
msgstr "Définir une fonction de traitement personnalisée" |
| 37 |
|
| 38 |
msgid "Create a macro-command to apply the function to an image" |
| 39 |
msgstr "Créer une macro-commande pour appliquer la fonction à une image" |
| 40 |
|
| 41 |
msgid "Use the same code from an external IDE (e.g. Spyder) or a Jupyter notebook" |
| 42 |
msgstr "Utiliser le même code à partir d'un IDE externe (par exemple Spyder) ou d'un notebook Jupyter" |
| 43 |
|
| 44 |
msgid "Create a plugin to integrate the function in the DataLab GUI" |
| 45 |
msgstr "Créer un plugin pour intégrer la fonction dans l'interface graphique de DataLab" |
| 46 |
|
| 47 |
msgid "To illustrate the extensibility of DataLab, we will use a simple image processing function that is not available in the standard DataLab distribution, and that represents a typical use case for prototyping a custom processing pipeline." |
| 48 |
msgstr "Pour illustrer l'extensibilité de DataLab, nous allons utiliser une fonction de traitement d'image simple qui n'est pas disponible dans la distribution standard de DataLab, et qui représente un cas d'utilisation typique pour le prototypage d'une chaîne de traitement personnalisée." |
| 49 |
|
| 50 |
msgid "The function that we will work on is a denoising filter that combines the ideas of averaging and edge detection. This filter will average the pixel values in the neighborhood, but with a twist: it will give less weight to pixels that are significantly different from the central pixel, assuming they might be part of an edge or noise. Once you have understood how to implement custom processing in DataLab, you will define your own functions adapted to your specific needs." |
| 51 |
msgstr "La fonction sur laquelle nous allons travailler est un filtre de débruitage qui combine les idées de moyenne et de détection de contours. Ce filtre va moyenner les valeurs des pixels dans le voisinage, mais avec une particularité : il donnera moins de poids aux pixels qui sont significativement différents du pixel central, en supposant qu'ils pourraient faire partie d'un contour ou du bruit. Une fois que vous aurez compris comment implémenter un traitement personnalisé dans DataLab, vous pourrez définir vos propres fonctions adaptées à vos besoins spécifiques." |
| 52 |
|
| 53 |
msgid "Here is the code of the ``weighted_average_denoise`` function::" |
| 54 |
msgstr "Voici le code de la fonction ``weighted_average_denoise`` :" |
| 55 |
|
| 56 |
msgid "Setup the test environment" |
| 57 |
msgstr "Configurer l'environnement de test" |
| 58 |
|
| 59 |
msgid "To test our processing function, we will use an image generated from a DataLab plugin example (`plugins/examples/datalab_example_imageproc.py`). Before starting, make sure that the plugin is installed in DataLab (see the first steps of the tutorial :ref:`tutorial_blobs` to understand how to do it)." |
| 60 |
msgstr "Pour tester notre fonction de traitement, nous allons utiliser une image générée à partir d'un exemple de plugin DataLab (`plugins/examples/datalab_example_imageproc.py`). Avant de commencer, assurez-vous que le plugin est installé dans DataLab (voir les premières étapes du tutoriel :ref:`tutorial_blobs` pour comprendre comment le faire)." |
| 61 |
|
| 62 |
msgid "We then reorganize the DataLab window layout to have a comfortable environment for developing and testing our function: we reorganize the window layout of DataLab to have the \"Image Panel\" on the left and the \"Macro Panel\" on the right. To do so, you can simply drag and drop the panels to the desired position. If the \"Macro Panel\" is not visible, you can enable it from the \"View > Panels > Macro Panel\"." |
| 63 |
msgstr "Nous réorganisons ensuite la disposition de la fenêtre de DataLab pour avoir un environnement confortable pour développer et tester notre fonction : nous réorganisons la disposition de la fenêtre de DataLab pour avoir le \"Panneau Image\" à gauche et le \"Gestionnaire de Macros\" à droite. Pour ce faire, vous pouvez simplement faire glisser et déposer les panneaux à la position souhaitée. Si le \"Gestionnaire de Macros\" n'est pas visible, vous pouvez l'activer depuis le menu \"Affichage > Panneaux > Gestionnaire de Macros\"." |
| 64 |
|
| 65 |
msgid "The window layout of DataLab reorganized to have the \"Image Panel\" on the left and the \"Macro Panel\" on the right." |
| 66 |
msgstr "La disposition de la fenêtre de DataLab réorganisée pour avoir le \"Panneau Image\" à gauche et le \"Gestionnaire de Macros\" à droite." |
| 67 |
|
| 68 |
msgid "We can now generate a test image using the plugin that we installed before. To do so, we click on the \"Plugins > Extract blobs (example) > Generate test image\" menu. The function we are developing is quite slow, so we choose a limited size for the image (for example 512x512 pixels)." |
| 69 |
msgstr "Nous pouvons maintenant générer une image de test en utilisant le plugin que nous avons installé précédemment. Pour ce faire, nous cliquons sur le menu \"Plugins > Extract blobs (example) > Generate test image\". La fonction que nous développons est assez lente, nous choisissons donc une taille limitée pour l'image (par exemple 512x512 pixels)." |
| 70 |
|
| 71 |
msgid "We generate a new image using the \"Plugins > Extract blobs (example) > Generate test image\" menu." |
| 72 |
msgstr "Nous générons une nouvelle image en utilisant le menu \"Plugins > Extract blobs (example) > Generate test image\"." |
| 73 |
|
| 74 |
msgid "We select the size for the image and click on \"OK\"." |
| 75 |
msgstr "Nous sélectionnons la taille de l'image et cliquons sur \"OK\"." |
| 76 |
|
| 77 |
msgid "The plugin generates a test image and adds it to the \"Image Panel\"." |
| 78 |
msgstr "Le plugin génère une image de test et l'ajoute au \"Panneau Image\"." |
| 79 |
|
| 80 |
msgid "The generated image in the \"Image Panel\"." |
| 81 |
msgstr "L'image générée dans le \"Panneau Image\"." |
| 82 |
|
| 83 |
msgid "Create a macro-command" |
| 84 |
msgstr "Créer une macro-commande" |
| 85 |
|
| 86 |
msgid "A macro is a code that can be executed directly inside DataLab to automate tasks. Macros are written in Python, and use the DataLab API to interact with DataLab." |
| 87 |
msgstr "Une macro est un code qui peut être exécuté directement dans DataLab pour automatiser des tâches. Les macros sont écrites en Python et utilisent l'API de DataLab pour interagir avec DataLab." |
| 88 |
|
| 89 |
msgid "In addition, macros have the following important features:" |
| 90 |
msgstr "De plus, les macros ont les caractéristiques importantes suivantes :" |
| 91 |
|
| 92 |
msgid "Macros are part of DataLab's **workspace**, which means that they are saved and restored when exporting and importing to/from an HDF5 file." |
| 93 |
msgstr "Les macros font partie de l'**espace de travail** de DataLab, ce qui signifie qu'elles sont sauvegardées et restaurées lors de l'exportation et de l'importation vers/depuis un fichier HDF5." |
| 94 |
|
| 95 |
msgid "Macros are executed in a separate process, so we need to import the necessary modules and initialize the proxy to DataLab. The proxy is a special object that allows us to communicate with DataLab." |
| 96 |
msgstr "Les macros sont exécutées dans un processus séparé, nous devons donc importer les modules nécessaires et initialiser le proxy vers DataLab. Le proxy est un objet spécial qui nous permet de communiquer avec DataLab." |
| 97 |
|
| 98 |
msgid "As a consequence, **when defining a plugin or when controlling DataLab from an external IDE, we can use exactly the same code as in the macro-command**. This is a very important point, because it means that we can prototype our processing pipeline in DataLab, and then use the same code in a plugin or in an external IDE to develop it further." |
| 99 |
msgstr "En conséquence, **lors de la définition d'un plugin ou du contrôle de DataLab à partir d'un IDE externe, nous pouvons utiliser exactement le même code que dans la macro-commande**. C'est un point très important, car cela signifie que nous pouvons prototyper notre chaîne de traitement dans DataLab, puis utiliser le même code dans un plugin ou dans un IDE externe pour le développer davantage." |
| 100 |
|
| 101 |
msgid "The macro-command is executed in DataLab's Python environment, so we can use the modules that are available in DataLab. However, we can also use our own modules, as long as they are installed in DataLab's Python environment or in a Python distribution that is compatible with DataLab's Python environment. A list of the modules that are available in your DataLab's Python environment is available in the \"? > Installation and configuration > Installation configuration\" dialog." |
| 102 |
msgstr "La macro-commande est exécutée dans l'environnement Python de DataLab, nous pouvons donc utiliser les modules disponibles dans DataLab. Cependant, nous pouvons également utiliser nos propres modules, tant qu'ils sont installés dans l'environnement Python de DataLab ou dans une distribution Python compatible avec l'environnement Python de DataLab. Une liste des modules disponibles dans l'environnement Python de votre DataLab est disponible dans la boîte de dialogue \"? > Installation et configuration > Configuration de l'installation\"." |
| 103 |
|
| 104 |
msgid "If your custom modules are not installed in DataLab's Python environment, and if they are compatible with DataLab's Python version, you can prepend the ``sys.path`` with the path to the Python distribution that contains your modules::" |
| 105 |
msgstr "Si vos modules personnalisés ne sont pas installés dans l'environnement Python de DataLab, et s'ils sont compatibles avec la version Python de DataLab, vous pouvez préfixer ``sys.path`` avec le chemin vers la distribution Python qui contient vos modules :" |
| 106 |
|
| 107 |
msgid "This will allow you to import your modules in the macro-command and mix them with the modules that are available in DataLab." |
| 108 |
msgstr "Cela vous permettra d'importer vos modules dans la macro-commande et de les mélanger avec les modules disponibles dans DataLab." |
| 109 |
|
| 110 |
msgid "If you use this method, make sure that your modules are compatible with DataLab's Python version. Otherwise, you will get errors when importing them." |
| 111 |
msgstr "Si vous utilisez cette méthode, assurez-vous que vos modules sont compatibles avec la version Python de DataLab. Sinon, vous obtiendrez des erreurs lors de leur importation." |
| 112 |
|
| 113 |
msgid "To edit macros, we use the \"Macro Panel\" that is available in DataLab. This panel is separated in two parts: the upper part is the macro editor, where we can write and edit the macro code; the lower part is the console, where we can see the output of the macro. If the macro editor is too small to show all the buttons of the macro toolbar, some of them are hidden and can be accessed by clicking on the unfold button. Alternatively, you can resize the macro editor by dragging the splitter between the editor and the console." |
| 114 |
msgstr "Pour éditer les macros, nous utilisons le \"Gestionnaire de Macros\" disponible dans DataLab. Ce panneau est divisé en deux parties : la partie supérieure est l'éditeur de macros, où nous pouvons écrire et éditer le code de la macro ; la partie inférieure est la console, où nous pouvons voir la sortie de la macro. Si l'éditeur de macros est trop petit pour afficher tous les boutons de la barre d'outils des macros, certains d'entre eux sont cachés et peuvent être accessibles en cliquant sur le bouton de dépliage. Alternativement, vous pouvez redimensionner l'éditeur de macros en faisant glisser le séparateur entre l'éditeur et la console." |
| 115 |
|
| 116 |
msgid "Let's get back to our custom function. We can create a new macro-command that will apply the function to the current image. To do so, we open the \"Macro Panel\" and click on the \"New macro\" |libre-gui-add| button." |
| 117 |
msgstr "Revenons à notre fonction personnalisée. Nous pouvons créer une nouvelle macro-commande qui appliquera la fonction à l'image actuelle. Pour ce faire, nous ouvrons le \"Gestionnaire de Macros\" et cliquons sur le bouton \"Nouvelle macro\" |libre-gui-add|." |
| 118 |
|
| 119 |
msgid "libre-gui-add" |
| 120 |
msgstr "" |
| 121 |
|
| 122 |
msgid "DataLab creates a new macro-command which is not empty: it contains a sample code that shows how to create a new image and add it to the \"Image Panel\"." |
| 123 |
msgstr "DataLab crée une nouvelle macro-commande qui n'est pas vide : elle contient un code d'exemple qui montre comment créer une nouvelle image et l'ajouter au \"Panneau Image\"." |
| 124 |
|
| 125 |
msgid "In this code, we can notice the presence of the ``RemoteProxy`` class that is used to communicate with DataLab. This class is part of the DataLab API, and is used to access DataLab objects and functions from a macro-command, a plugin, or an external IDE. You can find the documentation of the DataLab API in the :ref:`api` section." |
| 126 |
msgstr "Dans ce code, nous pouvons remarquer la présence de la classe ``RemoteProxy`` qui est utilisée pour communiquer avec DataLab. Cette classe fait partie de l'API de DataLab, et est utilisée pour accéder aux objets et fonctions de DataLab à partir d'une macro-commande, d'un plugin ou d'un IDE externe. Vous pouvez trouver la documentation de l'API de DataLab dans la section :ref:`api`." |
| 127 |
|
| 128 |
msgid "We can remove this code and replace it with our own code::" |
| 129 |
msgstr "Nous pouvons supprimer ce code et le remplacer par notre propre code :" |
| 130 |
|
| 131 |
msgid "Now, let's execute the macro-command by clicking on the \"Run macro\" |libre-camera-flash-on| button:" |
| 132 |
msgstr "Maintenant, exécutons la macro-commande en cliquant sur le bouton \"Exécuter la macro\" |libre-camera-flash-on| :" |
| 133 |
|
| 134 |
msgid "libre-camera-flash-on" |
| 135 |
msgstr "" |
| 136 |
|
| 137 |
msgid "The macro-command is executed in a separate process, so we can continue to work in DataLab while the macro-command is running. And, if the macro-command takes too long to execute, we can stop it by clicking on the \"Stop macro\" |libre-camera-flash-off| button." |
| 138 |
msgstr "La macro-commande est exécutée dans un processus séparé, nous pouvons donc continuer à travailler dans DataLab pendant que la macro-commande s'exécute. Et, si la macro-commande prend trop de temps à s'exécuter, nous pouvons l'arrêter en cliquant sur le bouton \"Arrêter la macro\" |libre-camera-flash-off|." |
| 139 |
|
| 140 |
msgid "libre-camera-flash-off" |
| 141 |
msgstr "" |
| 142 |
|
| 143 |
msgid "During the execution of the macro-command, we can see the progress in the \"Macro Panel\" window: the process standard output is displayed in the \"Console\" below the macro editor. We can see the following messages:" |
| 144 |
msgstr "Pendant l'exécution de la macro-commande, nous pouvons voir la progression dans la fenêtre \"Gestionnaire de Macros\" : la sortie standard du processus est affichée dans la \"Console\" en dessous de l'éditeur de macro. Nous pouvons voir les messages suivants :" |
| 145 |
|
| 146 |
msgid "``---[...]---[# ==> Running 'Untitled 01' macro...]``: the macro-command starts" |
| 147 |
msgstr "``---[...]---[# ==> Running 'Untitled 01' macro...]`` : la macro-commande démarre" |
| 148 |
|
| 149 |
msgid "``Connecting to DataLab XML-RPC server...OK [...]``: the proxy is connected to DataLab" |
| 150 |
msgstr "``Connecting to DataLab XML-RPC server...OK [...]`` : le proxy est connecté à DataLab" |
| 151 |
|
| 152 |
msgid "``---[...]---[# <== 'Untitled 01' macro has finished]``: the macro-command ends" |
| 153 |
msgstr "``---[...]---[# <== 'Untitled 01' macro has finished]`` : la macro-commande se termine" |
| 154 |
|
| 155 |
msgid "When the macro-command has finished, we can see the new image in the \"Image Panel\". Our filter has been applied to the image, and we can see that the noise has been reduced." |
| 156 |
msgstr "Lorsque la macro-commande est terminée, nous pouvons voir la nouvelle image dans le \"Panneau Image\". Notre filtre a été appliqué à l'image, et nous pouvons voir que le bruit a été réduit." |
| 157 |
|
| 158 |
msgid "Prototyping with an external IDE" |
| 159 |
msgstr "Prototypage avec un IDE externe" |
| 160 |
|
| 161 |
msgid "Now that we have a working prototype of our processing pipeline, we can use the same code in an external IDE to develop it further." |
| 162 |
msgstr "Maintenant que nous avons un prototype fonctionnel de notre chaîne de traitement, nous pouvons utiliser le même code dans un IDE externe pour le développer davantage." |
| 163 |
|
| 164 |
msgid "For example, we can use the Spyder IDE to debug our code. To do so, we need to install Spyder but not necessarily in DataLab's Python environment (in the case of the stand-alone version of DataLab, it wouldn't be possible anyway)." |
| 165 |
msgstr "Par exemple, nous pouvons utiliser l'IDE Spyder pour déboguer notre code. Pour ce faire, nous devons installer Spyder mais pas nécessairement dans l'environnement Python de DataLab (dans le cas de la version autonome de DataLab, ce ne serait de toute façon pas possible)." |
| 166 |
|
| 167 |
msgid "The only requirement is to install a DataLab client in Spyder's Python environment:" |
| 168 |
msgstr "Le seul prérequis est d'installer un client DataLab dans l'environnement Python de Spyder :" |
| 169 |
|
| 170 |
msgid "If you use the stand-alone version of DataLab or if you want or need to keep DataLab and Spyder in separate Python environments, you can install the `Sigima <https://pypi.org/project/sigima/>`_ (``sigima``) package that provides a simple remote client for DataLab. To install it, just run:" |
| 171 |
msgstr "Si vous utilisez la version autonome de DataLab ou si vous souhaitez ou devez garder DataLab et Spyder dans des environnements Python séparés, vous pouvez installer le package `Sigima <https://pypi.org/project/sigima/>`_ (``sigima``) qui fournit un client distant simple pour DataLab. Pour l'installer, il suffit d'exécuter :" |
| 172 |
|
| 173 |
msgid "pip install sigima" |
| 174 |
msgstr "pip install sigima" |
| 175 |
|
| 176 |
msgid "Or you may also install the `DataLab Python package <https://pypi.org/project/datalab-platform/>`_ (``datalab``) which includes the client (but also other modules, so we don't recommend this method if you don't need all DataLab's features in this Python environment)::" |
| 177 |
msgstr "Ou vous pouvez également installer le `paquet Python DataLab <https://pypi.org/project/datalab-platform/>`_ (``datalab``) qui inclut le client (mais aussi d'autres modules, donc nous ne recommandons pas cette méthode si vous n'avez pas besoin de toutes les fonctionnalités de DataLab dans cet environnement Python) :" |
| 178 |
|
| 179 |
msgid "If you use the DataLab Python package, you may run Spyder in the same Python environment as DataLab, so you don't need to install the client: it is already available in the main DataLab package (the ``datalab`` package)." |
| 180 |
msgstr "Si vous utilisez le paquet Python DataLab, vous pouvez exécuter Spyder dans le même environnement Python que DataLab, vous n'avez donc pas besoin d'installer le client : il est déjà disponible dans le paquet principal DataLab (le paquet ``datalab``)." |
| 181 |
|
| 182 |
msgid "Once the client is installed, we can start Spyder and create a new Python script:" |
| 183 |
msgstr "Une fois le client installé, nous pouvons démarrer Spyder et créer un nouveau script Python :" |
| 184 |
|
| 185 |
msgid "We go back to DataLab and select the first image in the \"Image Panel\"." |
| 186 |
msgstr "Nous retournons à DataLab et sélectionnons la première image dans le \"Panneau Image\"." |
| 187 |
|
| 188 |
msgid "The first image in the \"Image Panel\" selected." |
| 189 |
msgstr "La première image dans le \"Panneau Image\" sélectionnée." |
| 190 |
|
| 191 |
msgid "Then, we execute the script in Spyder (or your preferred editor), step-by-step (using the defined cells), and we can see the result in DataLab." |
| 192 |
msgstr "Ensuite, nous exécutons le script dans Spyder (ou votre éditeur préféré), étape par étape (en utilisant les cellules définies), et nous pouvons voir le résultat dans DataLab." |
| 193 |
|
| 194 |
msgid "The Spyder editor environment with the custom processing script." |
| 195 |
msgstr "L'environnement de l'éditeur Spyder avec le script de traitement personnalisé." |
| 196 |
|
| 197 |
msgid "We can see in DataLab that a new image has been added to the \"Image Panel\". This image is the result of the execution of the script in Spyder." |
| 198 |
msgstr "Nous pouvons voir dans DataLab qu'une nouvelle image a été ajoutée au \"Panneau Image\". Cette image est le résultat de l'exécution du script dans Spyder." |
| 199 |
|
| 200 |
msgid "Here we have used the script without any modification, but we could have modified it to test new ideas, and then use the modified script in DataLab." |
| 201 |
msgstr "Ici, nous avons utilisé le script sans aucune modification, mais nous aurions pu le modifier pour tester de nouvelles idées, puis utiliser le script modifié dans DataLab." |
| 202 |
|
| 203 |
msgid "There is another useful application of having an external script interfaced with DataLab: you can imagine letting your external script acquire the data and add it to DataLab automatically, for example in an acquisition loop. In this way you can improve your measurement workflow with the possibility to visualize and analyze data directly after their acquisition." |
| 204 |
msgstr "Il existe une autre application pour laquelle l'usage d'un script externe interfacé avec DataLab est utile : vous pouvez imaginer laisser votre script externe acquérir les données et les ajouter automatiquement à DataLab, par exemple dans une boucle d'acquisition. De cette façon, vous pouvez améliorer votre flux de travail de mesure avec la possibilité de visualiser et d'analyser les données directement après leur acquisition." |
| 205 |
|
| 206 |
msgid "Prototyping with a Jupyter notebook" |
| 207 |
msgstr "Prototypage avec un notebook Jupyter" |
| 208 |
|
| 209 |
msgid "We can also use a Jupyter notebook to prototype our processing pipeline. To do so, we need to install Jupyter but not necessarily in DataLab's Python environment (in the case of the stand-alone version of DataLab, it wouldn't be possible anyway)." |
| 210 |
msgstr "Nous pouvons également utiliser un notebook Jupyter pour prototyper notre chaîne de traitement. Pour ce faire, nous devons installer Jupyter mais pas nécessairement dans l'environnement Python de DataLab (dans le cas de la version autonome de DataLab, ce ne serait de toute façon pas possible)." |
| 211 |
|
| 212 |
msgid "The procedure is the same as for Spyder or any other IDE like Visual Studio Code, for example." |
| 213 |
msgstr "La procédure est la même que pour Spyder ou tout autre IDE comme Visual Studio Code, par exemple." |
| 214 |
|
| 215 |
msgid "A code interfaced with datalab written in a Jupyter notebook." |
| 216 |
msgstr "Un code interfacé avec DataLab écrit dans un notebook Jupyter." |
| 217 |
|
| 218 |
msgid "Creating a plugin" |
| 219 |
msgstr "Création d'un plugin" |
| 220 |
|
| 221 |
msgid "Now that we have a working prototype of our processing pipeline, we can choose to create a plugin to integrate it in DataLab's GUI. To do so, we need to create a new Python module that will contain the plugin code. We can use the same code as in the macro-command, but we need to make some changes." |
| 222 |
msgstr "Maintenant que nous avons un prototype fonctionnel de notre chaîne de traitement, nous pouvons choisir de créer un plugin pour l'intégrer dans l'interface graphique de DataLab. Pour ce faire, nous devons créer un nouveau module Python qui contiendra le code du plugin. Nous pouvons utiliser le même code que dans la macro-commande, mais nous devons apporter quelques modifications." |
| 223 |
|
| 224 |
msgid "The plugin system is described in the :ref:`about_plugins` section." |
| 225 |
msgstr "Le système de plugins est décrit dans la section :ref:`about_plugins`." |
| 226 |
|
| 227 |
msgid "Apart from integrating the feature to DataLab's GUI which is more convenient for the user, the advantage of creating a plugin is that we can take benefit of the DataLab infrastructure if we encapsulate our processing function in a certain way (see below):" |
| 228 |
msgstr "Outre l'intégration de la fonctionnalité dans l'interface graphique de DataLab, ce qui est plus pratique pour l'utilisateur, l'avantage de créer un plugin est que nous pouvons bénéficier de l'infrastructure de DataLab si nous encapsulons notre fonction de traitement d'une certaine manière (voir ci-dessous) :" |
| 229 |
|
| 230 |
msgid "Our function will be executed in a separate process, so we can interrupt it if it takes too long to execute." |
| 231 |
msgstr "Notre fonction sera exécutée dans un processus séparé, nous pouvons donc l'interrompre si elle prend trop de temps à s'exécuter." |
| 232 |
|
| 233 |
msgid "Warnings and errors will be handled by DataLab, so we don't need to handle them ourselves." |
| 234 |
msgstr "Les avertissements et les erreurs seront gérés par DataLab, nous n'avons donc pas besoin de les gérer nous-mêmes." |
| 235 |
|
| 236 |
msgid "The most significant change we need to make to our code is that we need to define a function that will be operating on DataLab's native image objects (:class:`sigima.objects.ImageObj`), instead of operating on NumPy arrays. So we need to find a way to call our custom function ``weighted_average_denoise`` with a :class:`sigima.objects.ImageObj` as input and output. To avoid writing a lot of boilerplate code, we can use the function wrapper provided by DataLab: :class:`sigima.proc.image.Wrap1to1Func`." |
| 237 |
msgstr "Le changement le plus significatif que nous devons apporter à notre code est que nous devons définir une fonction qui opérera sur les objets d'image natifs de DataLab (:class:`sigima.objects.ImageObj`), au lieu d'opérer sur des tableaux NumPy. Nous devons donc trouver un moyen d'appeler notre fonction personnalisée ``weighted_average_denoise`` avec un :class:`sigima.objects.ImageObj` en entrée et en sortie. Pour éviter d'écrire beaucoup de code standard, nous pouvons utiliser le wrapper de fonction fourni par DataLab : :class:`sigima.proc.image.Wrap1to1Func`." |
| 238 |
|
| 239 |
msgid "Besides we need to define a class that describes our plugin, which must inherit from :class:`datalab.plugins.PluginBase` and name the Python script that contains the plugin code with a name that starts with ``datalab_`` (e.g., ``datalab_custom_func.py``), so that DataLab can discover it at startup." |
| 240 |
msgstr "De plus, nous devons définir une classe qui décrit notre plugin, qui doit hériter de :class:`datalab.plugins.PluginBase` et nommer le script Python qui contient le code du plugin avec un nom qui commence par ``datalab_`` (par exemple, ``datalab_custom_func.py``), afin que DataLab puisse le découvrir au démarrage." |
| 241 |
|
| 242 |
msgid "Moreover, inside the plugin code, we want to add an entry in the \"Plugins\" menu, so that the user can access our plugin from the GUI." |
| 243 |
msgstr "De plus, dans le code du plugin, nous voulons ajouter une entrée dans le menu \"Plugins\", afin que l'utilisateur puisse accéder à notre plugin depuis l'interface graphique." |
| 244 |
|
| 245 |
msgid "Here is the plugin code:" |
| 246 |
msgstr "Voici le code du plugin :" |
| 247 |
|
| 248 |
msgid "To test it, we have to add the plugin script to one of the plugin directories that are discovered by DataLab at startup: you can find it under \"Files > Settings\" (see the :ref:`about_plugins` section for more details, or the :ref:`tutorial_blobs` for an example). We then restart DataLab and we can see that the plugin has been loaded." |
| 249 |
msgstr "Pour le tester, nous devons ajouter le script du plugin à l'un des répertoires de plugins qui sont découverts par DataLab au démarrage : vous pouvez le trouver sous \"Fichiers > Paramètres\" (voir la section :ref:`about_plugins` pour plus de détails, ou le :ref:`tutorial_blobs` pour un exemple). Nous redémarrons ensuite DataLab et nous pouvons voir que le plugin a été chargé." |
| 250 |
|
| 251 |
msgid "At the restart we can see that the plugin has been loaded." |
| 252 |
msgstr "Au redémarrage, nous pouvons voir que le plugin a été chargé." |
| 253 |
|
| 254 |
msgid "We generate again our test image using (see the first steps of the tutorial), and we process it using the plugin: \"Plugins > My custom filters > Weighted average denoise\"." |
| 255 |
msgstr "Nous générons à nouveau notre image de test en utilisant (voir les premières étapes du tutoriel), et nous la traitons en utilisant le plugin : \"Plugins > My custom filters > Weighted average denoise\"." |